Enable compilation with -fwhole-program for initram. The setting can be

chosen via Kconfig. Default off.
Depending on the target, this saves between 10% and 20% of initram size.

Compilation still broken for:
- ADL MSM800SEV
- Gigabyte M57SLI

Compilation changed for:
- AMD DB800 (checker doesn't trigger anymore, but we get an unresolved
symbol instead)
- AMD Norwich (same)
(The compilation changes are not bad per se, just a bit misleading. It
seems that gcc 4.2.x is really smart. gcc 4.3.x and later are even
smarter and even fix compilation completely.)

Compilation OK for:
- AMD Serengeti
- Artec DBE61
- Artec DBE62
- PCEngines Alix.1C
- PCEngines Alix.2C3
- 

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@825 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Carl-Daniel Hailfinger 2008-08-27 01:10:27 +00:00
commit 282ffb535a
2 changed files with 23 additions and 1 deletions

16
Kconfig
View file

@ -60,6 +60,22 @@ config BEEPS
help
Enable this option to make coreboot beep upon certain events.
config WHOLE_PROGRAM_COMPILE
bool "Enable whole-program optimizations (DANGEROUS)"
depends EXPERT && EXPERIMENTAL
help
Enable gcc -fwhole-program -combine for select code.
Needs lots of annotation in stage1 and stage2.
Works for initram only.
This increases compile time (no parallel compilation possible
anymore) and compiler memory usage (up to a factor of 20) and
makes debugging really hard.
Requires at least gcc 4.2.x, but miscompilations may occur.
Say No.
If you are a Gentoo user, say NO!
endmenu
source mainboard/Kconfig

View file

@ -132,6 +132,12 @@ else
PARSEELF = -e
endif
ifeq ($(CONFIG_WHOLE_PROGRAM_COMPILE), y)
COMBINEFLAGS = -fwhole-program
else
COMBINEFLAGS =
endif
STAGE0_SRC := $(patsubst %,$(src)/lib/%,$(STAGE0_LIB_SRC)) \
$(patsubst %,$(src)/arch/x86/%,$(STAGE0_ARCH_X86_SRC)) \
$(STAGE0_MAINBOARD_SRC) $(STAGE0_CHIPSET_SRC)
@ -268,7 +274,7 @@ $(obj)/arch/x86/amd/stage0.o: $(src)/arch/x86/amd/stage0.S
$(obj)/coreboot.initram $(obj)/coreboot.initram.map: $(obj)/stage0.init $(obj)/stage0-prefixed.o $(INITRAM_SRC)
$(Q)printf " CC $(subst $(shell pwd)/,,$(@)) (XIP)\n"
$(Q)$(CC) $(INITCFLAGS) -fPIE -c -combine $(INITRAM_SRC) -o $(obj)/coreboot.initram_partiallylinked.o
$(Q)$(CC) $(INITCFLAGS) -fPIE -c -combine $(COMBINEFLAGS) $(INITRAM_SRC) -o $(obj)/coreboot.initram_partiallylinked.o
$(Q)# .data and .bss must be empty because they aren't handled
$(Q)printf " CHECK initram (non-empty writable/allocatable sections)\n"