]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Don't add -lgcc on i386 and x86_64.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 14 Nov 2010 22:36:20 +0000 (23:36 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 14 Nov 2010 22:36:20 +0000 (23:36 +0100)
* configure.ac (LIBS): Don't add -lgcc on i386 and x86_64.
* conf/Makefile.common (LDADD_KERNEL): Likewise.
* grub-core/Makefile.core.def (kernel): Use LDADD_KERNEL.

ChangeLog
conf/Makefile.common
configure.ac
grub-core/Makefile.core.def

index c282b309c4d68bc3efa20e8e6e101150333facc3..19b6631fdb9f3f1ed218b9af6569bca0166aa295 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-14  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Don't add -lgcc on i386 and x86_64.
+
+       * configure.ac (LIBS): Don't add -lgcc on i386 and x86_64.
+       * conf/Makefile.common (LDADD_KERNEL): Likewise.
+       * grub-core/Makefile.core.def (kernel): Use LDADD_KERNEL.
+
 2010-11-14  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * configure.ac: Add -Wno-trampolines when supported.
index a3ccebcc53eb82a885c384753f68362809805536..73b3d819bd70d1d4163ce3eefbb6295f3a84ec14 100644 (file)
@@ -45,7 +45,24 @@ CPPFLAGS_DEFAULT += -I$(top_srcdir)/include
 CPPFLAGS_DEFAULT += -I$(top_builddir)/include
 CCASFLAGS_DEFAULT = -DASM_FILE=1
 
-LDADD_KERNEL = -lgcc
+LDADD_KERNEL =
+
+if ! COND_i386_pc
+if ! COND_i386_efi
+if ! COND_i386_qemu
+if ! COND_i386_coreboot
+if ! COND_i386_multiboot
+if ! COND_i386_ieee1275
+if ! COND_x86_64_efi
+LDADD_KERNEL += -lgcc
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+
 CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
 LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N -static-libgcc
 CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
index a576d1c83f6383df4b062a9653d0407b252a9324..2b75883bcacd71801c756ec5e3caeafcb62ed7d7 100644 (file)
@@ -579,8 +579,11 @@ else
 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100 -Wno-error"
 fi
 CPPFLAGS="$TARGET_CPPFLAGS"
-LDFLAGS="$TARGET_LDFLAGS"
+if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 ; then
+LIBS=
+else
 LIBS=-lgcc
+fi
 
 grub_ASM_USCORE
 if test x$grub_cv_asm_uscore = xyes; then
index 8845c26ea43dd1ff723028d1c76272f5dabbe955..46c65adac6fbf4de0a475809a3963fc048748fdd 100644 (file)
@@ -27,6 +27,8 @@ kernel = {
   i386_qemu_ldflags        = '$(TARGET_IMG_LDFLAGS)';
   i386_qemu_ldflags        = '$(TARGET_IMG_BASE_LDOPT),0x8200';
 
+  ldadd = '$(LDADD_KERNEL)';
+
   i386_coreboot_ldflags    = '-Wl,-Ttext=0x8200';
   i386_multiboot_ldflags   = '-Wl,-Ttext=0x8200';
   i386_ieee1275_ldflags    = '-Wl,-Ttext=0x10000';
@@ -39,10 +41,6 @@ kernel = {
   emu_cflags = '$(CFLAGS_GNULIB)';
   emu_cppflags = '$(CPPFLAGS_GNULIB)';
 
-  mips_ldadd = '-lgcc';
-  powerpc_ldadd = '-lgcc';
-  sparc64_ldadd = '-lgcc';
-
   i386_pc_startup = kern/i386/pc/startup.S;
   i386_efi_startup = kern/i386/efi/startup.S;
   x86_64_efi_startup = kern/x86_64/efi/startup.S;