Unify libgcc processing.

* Makefile.in (kernel_img_LDFLAGS): New variable.
	* conf/common.rmk (kernel_img_HEADERS): Add libgcc.h.
	* conf/i386-coreboot.rmk (kernel_img_LDFLAGS): Append instead of
	overwriting.
	* conf/i386-ieee1275.rmk (kernel_img_LDFLAGS): Likewise.
	* conf/i386-pc.rmk (kernel_img_LDFLAGS): Likewise.
	* conf/i386-qemu.rmk (kernel_img_LDFLAGS): Likewise.
	* conf/x86-efi.rmk (kernel_img_LDFLAGS): Likewise.
	* conf/mips-qemu-mips.rmk (kernel_img_LDFLAGS): Append instead of
	overwriting. Remove -lgcc and -static-libgcc
	* conf/mips-yeeloong.rmk (kernel_img_LDFLAGS): Likewise.
	* conf/mips.rmk (kernel_img_HEADERS): Remove cpu/libgcc.h
	* conf/powerpc-ieee1275.rmk (kernel_img_HEADERS): Remove cpu/libgcc.h
	(kernel_img_LDFLAGS): Append instead of overwriting.
	Remove -lgcc and -static-libgcc
	* conf/sparc64-ieee1275.rmk: Likewise.
	* include/grub/powerpc/libgcc.h: Move to ...
	* include/grub/libgcc.h: .. this.
	* include/grub/libgcc.h: Don't export most of the function on x86.
	(__bswapsi2): New export.
	(__bswapdi2): Likewise.
	* include/grub/mips/libgcc.h: Removed.
	* include/grub/sparc64/libgcc.h: Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-04-11 01:14:31 +02:00
parent b7f3ac299d
commit 5d04b11e0e
16 changed files with 60 additions and 91 deletions

View file

@ -1,3 +1,31 @@
2010-04-11 Vladimir Serbinenko <phcoder@gmail.com>
Unify libgcc processing.
* Makefile.in (kernel_img_LDFLAGS): New variable.
* conf/common.rmk (kernel_img_HEADERS): Add libgcc.h.
* conf/i386-coreboot.rmk (kernel_img_LDFLAGS): Append instead of
overwriting.
* conf/i386-ieee1275.rmk (kernel_img_LDFLAGS): Likewise.
* conf/i386-pc.rmk (kernel_img_LDFLAGS): Likewise.
* conf/i386-qemu.rmk (kernel_img_LDFLAGS): Likewise.
* conf/x86-efi.rmk (kernel_img_LDFLAGS): Likewise.
* conf/mips-qemu-mips.rmk (kernel_img_LDFLAGS): Append instead of
overwriting. Remove -lgcc and -static-libgcc
* conf/mips-yeeloong.rmk (kernel_img_LDFLAGS): Likewise.
* conf/mips.rmk (kernel_img_HEADERS): Remove cpu/libgcc.h
* conf/powerpc-ieee1275.rmk (kernel_img_HEADERS): Remove cpu/libgcc.h
(kernel_img_LDFLAGS): Append instead of overwriting.
Remove -lgcc and -static-libgcc
* conf/sparc64-ieee1275.rmk: Likewise.
* include/grub/powerpc/libgcc.h: Move to ...
* include/grub/libgcc.h: .. this.
* include/grub/libgcc.h: Don't export most of the function on x86.
(__bswapsi2): New export.
(__bswapdi2): Likewise.
* include/grub/mips/libgcc.h: Removed.
* include/grub/sparc64/libgcc.h: Likewise.
2010-04-10 Vladimir Serbinenko <phcoder@gmail.com>
* util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Remove

View file

@ -103,6 +103,7 @@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@
TARGET_IMG_LDFLAGS = -nostdlib @TARGET_IMG_LDFLAGS@
TARGET_IMG_CFLAGS = @TARGET_IMG_CFLAGS@
TARGET_OBJ2ELF = @TARGET_OBJ2ELF@
kernel_img_LDFLAGS = -static-libgcc -lgcc
EXEEXT = @EXEEXT@
OBJCOPY = @OBJCOPY@
STRIP = @STRIP@

View file

@ -116,7 +116,7 @@ DEFSYMFILES += kernel_syms.lst
kernel_img_HEADERS += boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
list.h handler.h command.h i18n.h env_private.h
list.h handler.h command.h i18n.h env_private.h libgcc.h
ifneq ($(platform), emu)
kernel_img_HEADERS += machine/memory.h machine/loader.h machine/kernel.h

View file

@ -26,7 +26,7 @@ kernel_img_SOURCES = kern/i386/coreboot/startup.S \
symlist.c
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,$(GRUB_KERNEL_MACHINE_LINK_ADDR),-Bstatic
kernel_img_LDFLAGS += $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,$(GRUB_KERNEL_MACHINE_LINK_ADDR),-Bstatic
sbin_SCRIPTS += grub-install
grub_install_SOURCES = util/grub-install.in

View file

@ -27,7 +27,7 @@ kernel_img_SOURCES = kern/i386/ieee1275/startup.S \
kernel_img_HEADERS += ieee1275/ieee1275.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic
kernel_img_LDFLAGS += $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic
# Scripts.
sbin_SCRIPTS = grub-install

View file

@ -58,7 +58,7 @@ kernel_img_HEADERS += machine/biosdisk.h machine/vga.h machine/vbe.h \
machine/pxe.h i386/pit.h
kernel_img_CFLAGS = $(COMMON_CFLAGS) $(TARGET_IMG_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR) $(COMMON_CFLAGS)
kernel_img_LDFLAGS += $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR) $(COMMON_CFLAGS)
kernel_img_FORMAT = binary
# Utilities.

View file

@ -39,7 +39,7 @@ kernel_img_SOURCES = kern/i386/qemu/startup.S \
symlist.c
kernel_img_CFLAGS = $(COMMON_CFLAGS) -DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR)
kernel_img_LDFLAGS += $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR)
kernel_img_FORMAT = binary
sbin_SCRIPTS += grub-install

View file

@ -18,6 +18,5 @@ kernel_img_SOURCES = kern/$(target_cpu)/startup.S \
symlist.c kern/$(target_cpu)/cache.S
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
-Wl,-N,-S,-Ttext,$(LINK_BASE),-Bstatic
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,$(LINK_BASE),-Bstatic
kernel_img_FORMAT = binary

View file

@ -29,8 +29,7 @@ kernel_img_SOURCES = kern/$(target_cpu)/startup.S \
symlist.c
kernel_img_CFLAGS = $(COMMON_CFLAGS) -DUSE_ASCII_FAILBACK
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
-Wl,-N,-S,-Ttext,$(LINK_BASE),-Bstatic
kernel_img_LDFLAGS += $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,$(LINK_BASE),-Bstatic
kernel_img_FORMAT = binary
# For ata.mod.

View file

@ -4,7 +4,7 @@
COMMON_CFLAGS += -mexplicit-relocs -mflush-func=grub_cpu_flush_cache
# Images.
kernel_img_HEADERS += cpu/libgcc.h cpu/cache.h
kernel_img_HEADERS += cpu/cache.h
# Scripts.
sbin_SCRIPTS =

View file

@ -3,7 +3,7 @@
# Images.
kernel_img_HEADERS += cpu/libgcc.h ieee1275/ieee1275.h
kernel_img_HEADERS += ieee1275/ieee1275.h
# Programs
pkglib_PROGRAMS = kernel.img
@ -23,8 +23,7 @@ kernel_img_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \
symlist.c kern/$(target_cpu)/cache.S
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
-Wl,-N,-S,-Ttext,0x200000,-Bstatic
kernel_img_LDFLAGS += $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x200000,-Bstatic
# Scripts.
sbin_SCRIPTS = grub-install

View file

@ -19,7 +19,7 @@ diskboot_img_ASFLAGS = $(COMMON_ASFLAGS)
diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,0x4200
diskboot_img_FORMAT = binary
kernel_img_HEADERS += cpu/libgcc.h ieee1275/ieee1275.h cpu/ieee1275/ieee1275.h
kernel_img_HEADERS += ieee1275/ieee1275.h cpu/ieee1275/ieee1275.h
kernel_img_SOURCES = kern/sparc64/ieee1275/crt0.S kern/ieee1275/cmain.c \
kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
@ -36,7 +36,7 @@ kernel_img_SOURCES = kern/sparc64/ieee1275/crt0.S kern/ieee1275/cmain.c \
symlist.c kern/$(target_cpu)/cache.S
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,0x4400,-Bstatic,-melf64_sparc -static-libgcc -lgcc
kernel_img_LDFLAGS += -nostdlib -Wl,-N,-Ttext,0x4400,-Bstatic,-melf64_sparc
kernel_img_FORMAT = binary
# Utilities.

View file

@ -40,7 +40,7 @@ endif
kernel_img_HEADERS += efi/efi.h efi/time.h efi/disk.h i386/pit.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
kernel_img_LDFLAGS += $(COMMON_LDFLAGS)
# For acpi.mod.
acpi_mod_SOURCES = commands/acpi.c commands/efi/acpi.c

View file

@ -18,21 +18,31 @@
#include <config.h>
#ifdef HAVE___ASHLDI3
/* On x86 these functions aren't really needed. Save some space. */
#if !defined (__i386__) && !defined (__x86_64__)
# ifdef HAVE___ASHLDI3
void EXPORT_FUNC (__ashldi3) (void);
#endif
#ifdef HAVE___ASHRDI3
# endif
# ifdef HAVE___ASHRDI3
void EXPORT_FUNC (__ashrdi3) (void);
#endif
#ifdef HAVE___LSHRDI3
# endif
# ifdef HAVE___LSHRDI3
void EXPORT_FUNC (__lshrdi3) (void);
# endif
# ifdef HAVE___UCMPDI2
void EXPORT_FUNC (__ucmpdi2) (void);
# endif
# ifdef HAVE___BSWAPSI2
void EXPORT_FUNC (__bswapsi2) (void);
# endif
# ifdef HAVE___BSWAPDI2
void EXPORT_FUNC (__bswapdi2) (void);
# endif
#endif
#ifdef HAVE___TRAMPOLINE_SETUP
void EXPORT_FUNC (__trampoline_setup) (void);
#endif
#ifdef HAVE___UCMPDI2
void EXPORT_FUNC (__ucmpdi2) (void);
#endif
#ifdef HAVE__RESTGPR_14_X
void EXPORT_FUNC (_restgpr_14_x) (void);

View file

@ -1,38 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2004,2007,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#ifdef HAVE___ASHLDI3
void EXPORT_FUNC (__ashldi3) (void);
#endif
#ifdef HAVE___ASHRDI3
void EXPORT_FUNC (__ashrdi3) (void);
#endif
#ifdef HAVE___LSHRDI3
void EXPORT_FUNC (__lshrdi3) (void);
#endif
#ifdef HAVE___UCMPDI2
void EXPORT_FUNC (__ucmpdi2) (void);
#endif
#ifdef HAVE___BSWAPSI2
void EXPORT_FUNC (__bswapsi2) (void);
#endif
#ifdef HAVE___BSWAPDI2
void EXPORT_FUNC (__bswapdi2) (void);
#endif

View file

@ -1,29 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2004,2007,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#ifdef HAVE___BSWAPSI2
typedef int SItype __attribute__ ((mode (SI)));
SItype EXPORT_FUNC (__bswapsi2) (SItype);
#endif
#ifdef HAVE___BSWAPDI2
typedef int DItype __attribute__ ((mode (DI)));
DItype EXPORT_FUNC (__bswapdi2) (DItype);
#endif