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.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-11-14 23:36:20 +01:00
parent 779dc15bf6
commit 03f80960cf
4 changed files with 32 additions and 6 deletions

View File

@ -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.

View 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)

View 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

View 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;