<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
On 5/17/10 3:00 AM, Carl-Daniel Hailfinger wrote:
<blockquote cite="mid:4BF0953B.30900@gmx.net" type="cite">
<pre wrap="">On 16.05.2010 21:45, Patrick Georgi wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Am 14.05.2010 19:19, schrieb Stefan Reinauer:
</pre>
<blockquote type="cite">
<pre wrap="">See patch
</pre>
</blockquote>
<pre wrap="">+GCC_VERSION=4.4.4
+GCC_VERSION=4.5.0 # enable for Link Time Optimization& Co
That's supposed to be a user option with 4.5.0 as default? Why
"enable" in that line?
</pre>
</blockquote>
<pre wrap="">
Does GCC 4.5.0 generate smaller code than 4.4.4?
Regards,
Carl-Daniel
</pre>
</blockquote>
<br>
It does create slightly smaller code than 4.4.2:<br>
<br>
kontron 986lcd-m with 4.4.2:<br>
<br>
<b><small><font face="Courier New, Courier, monospace">Name
Offset Type Size<br>
fallback/romstage 0x0 stage 33881<br>
fallback/coreboot_ram 0x84c0 stage 101427<br>
(empty) 0x21140 null 912358</font><br>
</small></b><br>
vs kontron 986lcd-m with 4.5.0:<br>
<br>
<b><small><font face="Courier New, Courier, monospace">Name
Offset Type Size<br>
fallback/romstage 0x0 stage 32673<br>
fallback/coreboot_ram 0x8000 stage 100936<br>
(empty) 0x20a80 null 914086</font></small></b><br>
<br>
In my tests there was absolutely no difference when using -flto,
though. Not even when getting rid of coreboot.a (which, as Kevin stated
earlier, might confuse lto)<br>
<br>
<b><font face="Courier New, Courier, monospace"><small>Index:
src/arch/i386/Makefile.inc<br>
===================================================================<br>
--- src/arch/i386/Makefile.inc (revision 5568)<br>
+++ src/arch/i386/Makefile.inc (working copy)<br>
@@ -83,20 +83,15 @@<br>
#######################################################################<br>
# Build the coreboot_ram (stage 2)<br>
<br>
-$(obj)/coreboot_ram: $(obj)/coreboot_ram.o
$(src)/arch/i386/coreboot_ram.ld #ldoptions<br>
+$(obj)/coreboot_ram: $(obj)/coreboot_ram.o
$(src)/arch/i386/coreboot_ram.ld<br>
@printf " CC $(subst $(obj)/,,$(@))\n"<br>
- $(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T
$(src)/arch/i386/coreboot_ram.ld $(obj)/coreboot_ram.o<br>
+ $(CC) $(CFLAGS) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T
$(src)/arch/i386/coreboot_ram.ld $(obj)/coreboot_ram.o<br>
$(NM) -n $(obj)/coreboot_ram | sort > $(obj)/coreboot_ram.map<br>
<br>
-$(obj)/coreboot_ram.o: $(obj)/arch/i386/lib/c_start.o $$(drivers)
$(obj)/coreboot.a $(LIBGCC_FILE_NAME)<br>
+$(obj)/coreboot_ram.o: $(obj)/arch/i386/lib/c_start.o $$(drivers)
$$(objs) $(LIBGCC_FILE_NAME)<br>
@printf " CC $(subst $(obj)/,,$(@))\n"<br>
- $(CC) -nostdlib -r -o $@ $(obj)/arch/i386/lib/c_start.o $(drivers)
-Wl,--wrap,__divdi3 -Wl,--wrap,__udivdi3 -Wl,--wrap,__moddi3
-Wl,--wrap,__umoddi3 -Wl,--start-group $(obj)/coreboot.a
$(LIBGCC_FILE_NAME) -Wl,--end-group<br>
+ $(CC) $(CFLAGS) -nostdlib -r -o $@ $(obj)/arch/i386/lib/c_start.o
$(drivers) -Wl,--wrap,__divdi3 -Wl,--wrap,__udivdi3 -Wl,--wrap,__moddi3
-Wl,--wrap,__umoddi3 -Wl,--start-group $$(objs) $(LIBGCC_FILE_NAME)
-Wl,--end-group<br>
<br>
-$(obj)/coreboot.a: $$(objs)<br>
- @printf " AR $(subst $(obj)/,,$(@))\n"<br>
- rm -f $(obj)/coreboot.a<br>
- $(AR) cr $(obj)/coreboot.a $^<br>
-<br>
#######################################################################<br>
# coreboot_ap.rom<br>
<br>
@@ -104,7 +99,7 @@<br>
<br>
$(obj)/coreboot_ap: $(obj)/mainboard/$(MAINBOARDDIR)/ap_romstage.o<br>
@printf " CC $(subst $(obj)/,,$(@))\n"<br>
- $(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T
$(src)/arch/i386/init/ldscript_apc.lb $^<br>
+ $(CC) $(CFLAGS) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T
$(src)/arch/i386/init/ldscript_apc.lb $^<br>
$(NM) -n $(obj)/coreboot_ap | sort > $(obj)/coreboot_ap.map<br>
<br>
<br>
Index: util/xcompile/xcompile<br>
===================================================================<br>
--- util/xcompile/xcompile (revision 5568)<br>
+++ util/xcompile/xcompile (working copy)<br>
@@ -78,6 +78,7 @@<br>
testcc "$CC" "$CFLAGS-Wa,--divide " &&
CFLAGS="$CFLAGS-Wa,--divide "<br>
testcc "$CC" "$CFLAGS-fno-stack-protector " &&
CFLAGS="$CFLAGS-fno-stack-protector "<br>
testcc "$CC" "$CFLAGS-Wl,--build-id=none " &&
CFLAGS="$CFLAGS-Wl,--build-id=none "<br>
+testcc "$CC" "$CFLAGS-flto " && CFLAGS="$CFLAGS-flto "<br>
<br>
if which gcc 2>/dev/null >/dev/null; then<br>
HOSTCC=gcc</small></font></b><br>
<br>
<br>
</body>
</html>