All of lore.kernel.org
 help / color / mirror / Atom feed
* [ppc patch] fix biarch linking
@ 2006-04-19  2:51 Hollis Blanchard
  2006-04-19  9:08 ` Yoshinori K. Okuji
  2006-04-19  9:15 ` Marco Gerards
  0 siblings, 2 replies; 3+ messages in thread
From: Hollis Blanchard @ 2006-04-19  2:51 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

2006-04-18  Hollis Blanchard  <hollis@penguinppc.org>

         * Makefile.in (LDFLAGS): Add variable.
         (LD): Remove variable.
         * configure.ac: Add -m32 to LDFLAGS.
         * genmk.rb (PModule#rule): Use $(CC) instead of $(LD).
         * conf/powerpc-ieee1275.rmk (COMMON_LDFLAGS): Add variable.
         (grubof_LDFLAGS): Use $(COMMON_LDFLAGS).
         (_linux_mod_LDFLAGS, linux_mod_LDFLAGS, normal_mod_LDFLAGS,
         suspend_mod_LDFLAGS, reboot_mod_LDFLAGS, halt_mod_LDFLAGS): New
         variables.

Could somebody please confirm that x86 still builds and works with this 
patch? Thanks.

-Hollis


[-- Attachment #2: grub2-link-m32.txt --]
[-- Type: text/plain, Size: 4059 bytes --]

Index: Makefile.in
===================================================================
RCS file: /sources/grub/grub2/Makefile.in,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile.in
--- Makefile.in	18 Apr 2006 06:18:15 -0000	1.18
+++ Makefile.in	19 Apr 2006 02:40:08 -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
@@ -64,7 +65,6 @@ BUILD_CPPFLAGS = -I. -Iinclude -I$(srcdi
 OBJCOPY = @OBJCOPY@
 STRIP = @STRIP@
 NM = @NM@
-LD = @LD@
 RUBY = @RUBY@
 LIBCURSES = @LIBCURSES@
 LIBLZO = @LIBLZO@
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	19 Apr 2006 02:40:09 -0000
@@ -89,6 +89,8 @@ if test "x$default_CFLAGS" = xyes; then
 
   if test "x$biarch32" = x1; then
     tmp_CFLAGS="$tmp_CFLAGS -m32"
+    LDFLAGS="$LDFLAGS -m32"
+    AC_SUBST(LDFLAGS)
   fi
 
   CFLAGS="$tmp_CFLAGS"
Index: genmk.rb
===================================================================
RCS file: /sources/grub/grub2/genmk.rb,v
retrieving revision 1.19
diff -u -p -r1.19 genmk.rb
--- genmk.rb	18 Apr 2006 06:18:15 -0000	1.19
+++ genmk.rb	19 Apr 2006 02:40:09 -0000
@@ -121,12 +121,12 @@ UNDSYMFILES += #{undsym}
 
 #{@name}: #{pre_obj} #{mod_obj}
 	-rm -f $@
-	$(LD) $(#{prefix}_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
+	$(CC) $(#{prefix}_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
 	$(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 #{pre_obj}: #{objs_str}
 	-rm -f $@
-	$(LD) $(#{prefix}_LDFLAGS) -r -d -o $@ $^
+	$(CC) $(#{prefix}_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
 
 #{mod_obj}: #{mod_src}
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
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	19 Apr 2006 02:40:09 -0000
@@ -3,6 +3,7 @@
 
 COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__
 COMMON_CFLAGS = -ffreestanding -msoft-float
+COMMON_LDFLAGS += -nostdlib
 
 # Images.
 
@@ -69,7 +70,8 @@ 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 = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
+	-Wl,-N,-S,-Ttext,0x200000,-Bstatic
 
 # For genmoddep.
 genmoddep_SOURCES = util/genmoddep.c
@@ -91,10 +93,12 @@ pkgdata_MODULES = halt.mod \
 # For _linux.mod.
 _linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
 _linux_mod_CFLAGS = $(COMMON_CFLAGS)
+_linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For linux.mod.
 linux_mod_SOURCES = loader/powerpc/ieee1275/linux_normal.c
 linux_mod_CFLAGS = $(COMMON_CFLAGS)
+linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For normal.mod.
 normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c	\
@@ -103,18 +107,22 @@ normal_mod_SOURCES = normal/arg.c normal
 	normal/menu_entry.c normal/misc.c grub_script.tab.c 		\
 	normal/script.c normal/powerpc/setjmp.S
 normal_mod_CFLAGS = $(COMMON_CFLAGS)
+normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
 normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
 
 # For suspend.mod
 suspend_mod_SOURCES = commands/ieee1275/suspend.c
 suspend_mod_CFLAGS = $(COMMON_CFLAGS)
+suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For reboot.mod
 reboot_mod_SOURCES = commands/ieee1275/reboot.c
 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
+reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For halt.mod
 halt_mod_SOURCES = commands/ieee1275/halt.c
 halt_mod_CFLAGS = $(COMMON_CFLAGS)
+halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 include $(srcdir)/conf/common.mk

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-19  9:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-19  2:51 [ppc patch] fix biarch linking Hollis Blanchard
2006-04-19  9:08 ` Yoshinori K. Okuji
2006-04-19  9:15 ` Marco Gerards

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.