aboutsummaryrefslogtreecommitdiff
path: root/Rules.mak
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-01-15 14:04:57 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-01-15 14:04:57 +0000
commita532478c9fef863dea125eb66441f715cf5d5c38 (patch)
treec0aaacfeb97a9bc74e73f8ff36ecbf1fd173808b /Rules.mak
parent0c482ced822cfada034ff19b3e1b81f0ef6a6cf8 (diff)
downloadbusybox-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.mak36
1 files changed, 34 insertions, 2 deletions
diff --git a/Rules.mak b/Rules.mak
index b142ee41f..df3c22e7d 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -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
83WARNINGS=-Wall -Wstrict-prototypes -Wshadow 83WARNINGS=-Wall -Wstrict-prototypes -Wshadow
84CFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) 84CFLAGS+=-I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)
85
85ARFLAGS=cru 86ARFLAGS=cru
86 87
87 88
@@ -125,6 +126,8 @@ endif
125 126
126CFLAGS+=$(call check_gcc,-funsigned-char,) 127CFLAGS+=$(call check_gcc,-funsigned-char,)
127 128
129CFLAGS+=$(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
134OPTIMIZATION:=$(call check_gcc,-Os,-O2) 137OPTIMIZATION:=$(call check_gcc,-Os,-O2)
135 138
139ifeq ($(CONFIG_BUILD_AT_ONCE),y)
140# gcc 2.95 exits with 0 for "unrecognized option"
141ifeq ($(strip $(shell [ $(CC_MAJOR) -ge 3 ] ; echo $$?)),0)
142 OPTIMIZATION+=$(call check_gcc,-combine,)
143endif
144OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,)
145PROG_CFLAGS+=$(call check_gcc,-fwhole-program,)
146endif # CONFIG_BUILD_AT_ONCE
147
136# Some nice architecture specific optimizations 148# Some nice architecture specific optimizations
137ifeq ($(strip $(TARGET_ARCH)),arm) 149ifeq ($(strip $(TARGET_ARCH)),arm)
138 OPTIMIZATION+=-fstrict-aliasing 150 OPTIMIZATION+=-fstrict-aliasing
151 OPTIMIZATION+=$(call check_gcc,-msingle-pic-base,)
139endif 152endif
140ifeq ($(strip $(TARGET_ARCH)),i386) 153ifeq ($(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
156ifneq ($(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)
160endif # gcc-4.0 and older
161
162# gcc-4.1 and beyond seem to benefit from these
163ifeq ($(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,)
170endif # gcc-4.1 and beyond
145endif 171endif
146OPTIMIZATIONS:=$(OPTIMIZATION) -fomit-frame-pointer 172OPTIMIZATIONS:=$(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
174else 200else
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
178endif 204endif
179ifeq ($(strip $(CONFIG_STATIC)),y) 205ifeq ($(strip $(CONFIG_STATIC)),y)
180 LDFLAGS += --static 206 LDFLAGS += --static
207#else
208# LIBRARIES += -ldl
209endif
210
211ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
212 CFLAGS_PIC:= -fPIC #-DPIC
181endif 213endif
182 214
183ifeq ($(strip $(CONFIG_SELINUX)),y) 215ifeq ($(strip $(CONFIG_SELINUX)),y)