Some 64-bit PowerPC compilers default to 64-bit output. Right now we're building all the object files with -m32, but then the linker complains when it tries to link a 64-bit grubof. We need to add -m32 to LDFLAGS as well as CFLAGS.

Could somebody please confirm that this patch doesn't break x86-64?

-Hollis
Index: Makefile.in
===================================================================
RCS file: /sources/grub/grub2/Makefile.in,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile.in
--- Makefile.in 3 Jan 2006 17:58:02 -0000       1.17
+++ Makefile.in 15 Apr 2006 03:59:21 -0000
@@ -56,6 +56,7 @@ mkinstalldirs = $(srcdir)/mkinstalldirs
 
 CC = @CC@
 CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
 CPPFLAGS = -I. -Iinclude -I$(srcdir)/include -Wall -W
 BUILD_CC = @BUILD_CC@
 BUILD_CFLAGS = -g -O2
Index: configure
===================================================================
RCS file: /sources/grub/grub2/configure,v
retrieving revision 1.31
diff -u -p -r1.31 configure
--- configure   2 Apr 2006 08:53:31 -0000       1.31
+++ configure   15 Apr 2006 03:59:22 -0000
@@ -2907,6 +2907,8 @@ echo "${ECHO_T}$falign_loop_flag" >&6
 
   if test "x$biarch32" = x1; then
     tmp_CFLAGS="$tmp_CFLAGS -m32"
+    LDFLAGS="$tmp_LDFLAGS -m32"
+
   fi
 
   CFLAGS="$tmp_CFLAGS"
Index: configure.ac
===================================================================
RCS file: /sources/grub/grub2/configure.ac,v
retrieving revision 1.22
diff -u -p -r1.22 configure.ac
--- configure.ac        2 Apr 2006 08:53:31 -0000       1.22
+++ configure.ac        15 Apr 2006 03:59:22 -0000
@@ -89,6 +89,8 @@ if test "x$default_CFLAGS" = xyes; then
 
   if test "x$biarch32" = x1; then
     tmp_CFLAGS="$tmp_CFLAGS -m32"
+    LDFLAGS="$tmp_LDFLAGS -m32"
+    AC_SUBST(LDFLAGS)
   fi
 
   CFLAGS="$tmp_CFLAGS"
Index: conf/powerpc-ieee1275.rmk
===================================================================
RCS file: /sources/grub/grub2/conf/powerpc-ieee1275.rmk,v
retrieving revision 1.52
diff -u -p -r1.52 powerpc-ieee1275.rmk
--- conf/powerpc-ieee1275.rmk   25 Dec 2005 15:59:50 -0000      1.52
+++ conf/powerpc-ieee1275.rmk   15 Apr 2006 03:59:23 -0000
@@ -69,7 +69,7 @@ grubof_SOURCES = kern/powerpc/ieee1275/c
 grubof_HEADERS = grub/powerpc/ieee1275/ieee1275.h
 grubof_CFLAGS = $(COMMON_CFLAGS)
 grubof_ASFLAGS = $(COMMON_ASFLAGS)
-grubof_LDFLAGS = -nostdlib -static-libgcc -lgcc 
-Wl,-N,-S,-Ttext,0x200000,-Bstatic
+grubof_LDFLAGS = -nostdlib -static-libgcc -lgcc 
-Wl,-N,-S,-Ttext,0x200000,-Bstatic $(LDFLAGS)
 
 # For genmoddep.
 genmoddep_SOURCES = util/genmoddep.c
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to