diff options
author | Wolfgang Denk <wd@denx.de> | 2011-05-01 14:00:27 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-05-02 02:50:46 +0200 |
commit | 91b77c3953d6b88770e3102fc2ce428e8f9a8f13 (patch) | |
tree | 4ac4a83d1d54c92b43aafa982671d9adf82389a1 | |
parent | 90ea1e34548e36e800b1c9699885167f9b3e9ff0 (diff) | |
download | busybox-w32-91b77c3953d6b88770e3102fc2ce428e8f9a8f13.tar.gz busybox-w32-91b77c3953d6b88770e3102fc2ce428e8f9a8f13.tar.bz2 busybox-w32-91b77c3953d6b88770e3102fc2ce428e8f9a8f13.zip |
Compile options: default to -O2 when -Os is not available
Recent versions of GCC for PowerPC systems suffer from some compiler
bugs which prevent the use of "--enable-target-optspace" in their
configuration, which makes the compiler option "-Os" unavailable;
for reference see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48278
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45053
In the result, BusyBox will be compiled without any optimization
options, which causes a huge binary (1.8 MiB for default configuration
on PPC, built with gcc 54.51 from the Yocto / Poky / OpenEmbedded tool
chains). This commit changes behaviour so "-O2" gets used as fallback
when "-Os" is not available. This reduces the image size in above
test to 1.3 MiB. This is still 10...15% more then what we get with
"-Os", but much better than using no optimization at all.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | Makefile.flags | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile.flags b/Makefile.flags index 363300b52..b3e13713d 100644 --- a/Makefile.flags +++ b/Makefile.flags | |||
@@ -58,14 +58,14 @@ CFLAGS += $(call cc-option,-falign-functions=1 -falign-jumps=1 -falign-labels=1 | |||
58 | #CFLAGS += $(call cc-option,-Wconversion,) | 58 | #CFLAGS += $(call cc-option,-Wconversion,) |
59 | 59 | ||
60 | ifneq ($(CONFIG_DEBUG),y) | 60 | ifneq ($(CONFIG_DEBUG),y) |
61 | CFLAGS += $(call cc-option,-Os,) | 61 | CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,)) |
62 | else | 62 | else |
63 | CFLAGS += $(call cc-option,-g,) | 63 | CFLAGS += $(call cc-option,-g,) |
64 | #CFLAGS += "-D_FORTIFY_SOURCE=2" | 64 | #CFLAGS += "-D_FORTIFY_SOURCE=2" |
65 | ifeq ($(CONFIG_DEBUG_PESSIMIZE),y) | 65 | ifeq ($(CONFIG_DEBUG_PESSIMIZE),y) |
66 | CFLAGS += $(call cc-option,-O0,) | 66 | CFLAGS += $(call cc-option,-O0,) |
67 | else | 67 | else |
68 | CFLAGS += $(call cc-option,-Os,) | 68 | CFLAGS += $(call cc-option,-Os,$(call cc-option,-O2,)) |
69 | endif | 69 | endif |
70 | endif | 70 | endif |
71 | 71 | ||