From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1CsMmE-0002fz-AL for mharc-grub-devel@gnu.org; Sat, 22 Jan 2005 10:02:14 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CsMlZ-0002aY-Cp for grub-devel@gnu.org; Sat, 22 Jan 2005 10:01:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CsMlN-0002VP-4i for grub-devel@gnu.org; Sat, 22 Jan 2005 10:01:27 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CsMlK-0002Pl-VM for grub-devel@gnu.org; Sat, 22 Jan 2005 10:01:18 -0500 Received: from [80.190.231.112] (helo=khepri.openbios.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CsMJx-0005jk-VC for grub-devel@gnu.org; Sat, 22 Jan 2005 09:33:02 -0500 Received: from stepan by khepri.openbios.org with local (Exim 4.22) id 1CsMJv-000564-T6; Sat, 22 Jan 2005 15:32:59 +0100 Date: Sat, 22 Jan 2005 15:32:59 +0100 From: Stefan Reinauer To: The development of GRUB 2 Message-ID: <20050122143259.GA19529@openbios.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: Linux 2.6.8-20041029200618-smp on an x86_64 X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff Cc: duwe@suse.de Subject: building grub on AMD64 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2005 15:02:05 -0000 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, with the attached patch grub2 can be built on AMD64 systems. It is not completely clean I would say, but it solves the problem with minimum impact. Please dont tare my head off ;-) It is necessary to call autoconf before the code can be used. Since Linux and other 64bit operating systems switch to long mode themselfes, it is not needed to have grub2 64bit. It can/should stay 32bit for now, unless someone is willing to properly do a lot of cleanup work in Linux and other places. Comments welcome Regards, Stefan --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="grub2-amd64.diff" Index: Makefile.in =================================================================== RCS file: /cvsroot/grub/grub2/Makefile.in,v retrieving revision 1.8 diff -u -r1.8 Makefile.in --- Makefile.in 27 Dec 2004 13:46:19 -0000 1.8 +++ Makefile.in 22 Jan 2005 14:24:05 -0000 @@ -34,7 +34,7 @@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ -pkgdatadir = $(datadir)/@PACKAGE_TARNAME@/$(host_cpu)-$(host_vendor) +pkgdatadir = $(datadir)/@PACKAGE_TARNAME@/$(target_cpu)-$(host_vendor) pkglibdir = $(libdir)/@PACKAGE_TARNAME@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -43,7 +43,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -host_cpu = @host_cpu@ +host_cpu = @target_cpu@ host_vendor = @host_vendor@ INSTALL = @INSTALL@ Index: configure.ac =================================================================== RCS file: /cvsroot/grub/grub2/configure.ac,v retrieving revision 1.9 diff -u -r1.9 configure.ac --- configure.ac 4 Apr 2004 13:45:59 -0000 1.9 +++ configure.ac 22 Jan 2005 14:24:14 -0000 @@ -21,18 +21,19 @@ AC_CANONICAL_HOST case "$host_cpu" in - i[[3456]]86) host_cpu=i386 ;; - powerpc) ;; + i[[3456]]86) target_cpu=i386 ;; + x86_64) target_cpu=i386 ;; + powerpc) target_cpu=powerpc;; *) AC_MSG_ERROR([unsupported CPU type]) ;; esac -case "$host_cpu"-"$host_vendor" in +case "$target_cpu"-"$host_vendor" in i386-*) host_vendor=pc ;; powerpc-*) host_vendor=ieee1275 ;; *) AC_MSG_ERROR([unsupported machine type]) ;; esac -AC_SUBST(host_cpu) +AC_SUBST(target_cpu) AC_SUBST(host_vendor) # Checks for programs. @@ -51,6 +52,11 @@ tmp_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \ -Wundef -Wstrict-prototypes -g" + if test "x$host_cpu" = xx86_64; then + CC="gcc -m32" + LD="ld -melf_i386" + fi + # optimization flags. AC_CACHE_CHECK([whether optimization for size works], size_flag, [ CFLAGS=-Os @@ -63,7 +69,7 @@ fi # Force no alignment to save space on i386. - if test "x$host_cpu" = xi386; then + if test "x$target_cpu" = xi386; then AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [ CFLAGS="-falign-loops=1" AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no]) @@ -82,13 +88,13 @@ # Defined in aclocal.m4. grub_ASM_USCORE -if test "x$host_cpu" = xi386; then +if test "x$target_cpu" = xi386; then grub_CHECK_START_SYMBOL grub_CHECK_BSS_START_SYMBOL grub_CHECK_END_SYMBOL fi -if test "x$host_cpu" = xi386; then +if test "x$target_cpu" = xi386; then grub_I386_ASM_PREFIX_REQUIREMENT grub_I386_ASM_ADDR32 grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK @@ -131,7 +137,7 @@ AC_CHECK_SIZEOF(long) # Check LZO when compiling for the i386. -if test "x$host_cpu" = xi386; then +if test "x$target_cpu" = xi386; then AC_CHECK_LIB(lzo, __lzo_init2, , AC_MSG_ERROR([LZO library version 1.02 or later is required])) AC_CHECK_FUNC(lzo1x_999_compress, , @@ -143,8 +149,8 @@ CPPFLAGS="$tmp_CPPFLAGS" # Output files. -AC_CONFIG_LINKS([include/grub/cpu:include/grub/$host_cpu - include/grub/machine:include/grub/$host_cpu/$host_vendor]) +AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu + include/grub/machine:include/grub/$target_cpu/$host_vendor]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) AC_OUTPUT --vtzGhvizbBRQ85DL--