diff options
author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-01-15 14:04:57 +0000 |
---|---|---|
committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-01-15 14:04:57 +0000 |
commit | a532478c9fef863dea125eb66441f715cf5d5c38 (patch) | |
tree | c0aaacfeb97a9bc74e73f8ff36ecbf1fd173808b /Rules.mak | |
parent | 0c482ced822cfada034ff19b3e1b81f0ef6a6cf8 (diff) | |
download | busybox-w32-a532478c9fef863dea125eb66441f715cf5d5c38.tar.gz busybox-w32-a532478c9fef863dea125eb66441f715cf5d5c38.tar.bz2 busybox-w32-a532478c9fef863dea125eb66441f715cf5d5c38.zip |
- shared libbusybox.
- IMA compilation option (aka IPO, IPA,..)
Please holler if i broke something..
git-svn-id: svn://busybox.net/trunk/busybox@13346 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'Rules.mak')
-rw-r--r-- | Rules.mak | 36 |
1 files changed, 34 insertions, 2 deletions
@@ -81,7 +81,8 @@ CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS))) | |||
81 | #GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp") | 81 | #GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp") |
82 | 82 | ||
83 | WARNINGS=-Wall -Wstrict-prototypes -Wshadow | 83 | WARNINGS=-Wall -Wstrict-prototypes -Wshadow |
84 | CFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) | 84 | CFLAGS+=-I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) |
85 | |||
85 | ARFLAGS=cru | 86 | ARFLAGS=cru |
86 | 87 | ||
87 | 88 | ||
@@ -125,6 +126,8 @@ endif | |||
125 | 126 | ||
126 | CFLAGS+=$(call check_gcc,-funsigned-char,) | 127 | CFLAGS+=$(call check_gcc,-funsigned-char,) |
127 | 128 | ||
129 | CFLAGS+=$(call check_gcc,-mmax-stack-frame=256,) | ||
130 | |||
128 | #-------------------------------------------------------- | 131 | #-------------------------------------------------------- |
129 | # Arch specific compiler optimization stuff should go here. | 132 | # Arch specific compiler optimization stuff should go here. |
130 | # Unless you want to override the defaults, do not set anything | 133 | # Unless you want to override the defaults, do not set anything |
@@ -133,15 +136,38 @@ CFLAGS+=$(call check_gcc,-funsigned-char,) | |||
133 | # use '-Os' optimization if available, else use -O2 | 136 | # use '-Os' optimization if available, else use -O2 |
134 | OPTIMIZATION:=$(call check_gcc,-Os,-O2) | 137 | OPTIMIZATION:=$(call check_gcc,-Os,-O2) |
135 | 138 | ||
139 | ifeq ($(CONFIG_BUILD_AT_ONCE),y) | ||
140 | # gcc 2.95 exits with 0 for "unrecognized option" | ||
141 | ifeq ($(strip $(shell [ $(CC_MAJOR) -ge 3 ] ; echo $$?)),0) | ||
142 | OPTIMIZATION+=$(call check_gcc,-combine,) | ||
143 | endif | ||
144 | OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,) | ||
145 | PROG_CFLAGS+=$(call check_gcc,-fwhole-program,) | ||
146 | endif # CONFIG_BUILD_AT_ONCE | ||
147 | |||
136 | # Some nice architecture specific optimizations | 148 | # Some nice architecture specific optimizations |
137 | ifeq ($(strip $(TARGET_ARCH)),arm) | 149 | ifeq ($(strip $(TARGET_ARCH)),arm) |
138 | OPTIMIZATION+=-fstrict-aliasing | 150 | OPTIMIZATION+=-fstrict-aliasing |
151 | OPTIMIZATION+=$(call check_gcc,-msingle-pic-base,) | ||
139 | endif | 152 | endif |
140 | ifeq ($(strip $(TARGET_ARCH)),i386) | 153 | ifeq ($(strip $(TARGET_ARCH)),i386) |
141 | OPTIMIZATION+=$(call check_gcc,-march=i386,) | 154 | OPTIMIZATION+=$(call check_gcc,-march=i386,) |
155 | # gcc-4.0 and older seem to suffer from these | ||
156 | ifneq ($(strip $(shell [ $(CC_MAJOR) -ge 4 -a $(CC_MINOR) -ge 1 ] ; echo $$?)),0) | ||
142 | OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,) | 157 | OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,) |
143 | OPTIMIZATION+=$(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,\ | 158 | OPTIMIZATION+=$(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,\ |
144 | -malign-functions=0 -malign-jumps=0 -malign-loops=0) | 159 | -malign-functions=0 -malign-jumps=0 -malign-loops=0) |
160 | endif # gcc-4.0 and older | ||
161 | |||
162 | # gcc-4.1 and beyond seem to benefit from these | ||
163 | ifeq ($(strip $(shell [ $(CC_MAJOR) -ge 4 -a $(CC_MINOR) -ge 1 ] ; echo $$?)),0) | ||
164 | # turn off flags which hurt -Os | ||
165 | OPTIMIZATION+=$(call check_gcc,-fno-tree-loop-optimize,) | ||
166 | OPTIMIZATION+=$(call check_gcc,-fno-tree-dominator-opts,) | ||
167 | OPTIMIZATION+=$(call check_gcc,-fno-strength-reduce,) | ||
168 | |||
169 | OPTIMIZATION+=$(call check_gcc,-fno-branch-count-reg,) | ||
170 | endif # gcc-4.1 and beyond | ||
145 | endif | 171 | endif |
146 | OPTIMIZATIONS:=$(OPTIMIZATION) -fomit-frame-pointer | 172 | OPTIMIZATIONS:=$(OPTIMIZATION) -fomit-frame-pointer |
147 | 173 | ||
@@ -173,11 +199,17 @@ ifeq ($(strip $(CONFIG_DEBUG)),y) | |||
173 | STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging | 199 | STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging |
174 | else | 200 | else |
175 | CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG | 201 | CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG |
176 | LDFLAGS += -Wl,-warn-common | 202 | LDFLAGS += -Wl,-warn-common -Wl,--sort-common |
177 | STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment | 203 | STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment |
178 | endif | 204 | endif |
179 | ifeq ($(strip $(CONFIG_STATIC)),y) | 205 | ifeq ($(strip $(CONFIG_STATIC)),y) |
180 | LDFLAGS += --static | 206 | LDFLAGS += --static |
207 | #else | ||
208 | # LIBRARIES += -ldl | ||
209 | endif | ||
210 | |||
211 | ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) | ||
212 | CFLAGS_PIC:= -fPIC #-DPIC | ||
181 | endif | 213 | endif |
182 | 214 | ||
183 | ifeq ($(strip $(CONFIG_SELINUX)),y) | 215 | ifeq ($(strip $(CONFIG_SELINUX)),y) |