diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | Rules.mak | 18 |
2 files changed, 8 insertions, 14 deletions
@@ -280,8 +280,8 @@ $(LIBBUSYBOX_SONAME): | |||
280 | ifndef MAJOR_VERSION | 280 | ifndef MAJOR_VERSION |
281 | $(error MAJOR_VERSION needed for $@ is not defined) | 281 | $(error MAJOR_VERSION needed for $@ is not defined) |
282 | endif | 282 | endif |
283 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -shared \ | 283 | $(CC) $(CFLAGS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) \ |
284 | $(CFLAGS_PIC) \ | 284 | $(LIB_LDFLAGS) \ |
285 | -Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \ | 285 | -Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \ |
286 | -Wl,-z,combreloc $(LIB_LDFLAGS) \ | 286 | -Wl,-z,combreloc $(LIB_LDFLAGS) \ |
287 | -o $(@) \ | 287 | -o $(@) \ |
@@ -118,13 +118,7 @@ check_gcc=$(shell \ | |||
118 | # A not very robust macro to check for available ld flags | 118 | # A not very robust macro to check for available ld flags |
119 | check_ld=$(shell \ | 119 | check_ld=$(shell \ |
120 | if [ "x$(1)" != "x" ]; then \ | 120 | if [ "x$(1)" != "x" ]; then \ |
121 | $(LD) --help | grep -q \\$(1) && echo "-Wl,$(1)$(2)" ; \ | 121 | $(LD) --help | grep -q "\$(1)" && echo "-Wl,$(1)" ; \ |
122 | fi) | ||
123 | |||
124 | # A not very robust macro to check for available as flags | ||
125 | check_as=$(shell \ | ||
126 | if [ "x$(1)" != "x" ]; then \ | ||
127 | $(AS) --help | grep -q "\\$(1)" && echo "-Wa,$(1)$(2)" ; \ | ||
128 | fi) | 122 | fi) |
129 | 123 | ||
130 | 124 | ||
@@ -213,19 +207,19 @@ else | |||
213 | endif | 207 | endif |
214 | ifeq ($(strip $(CONFIG_DEBUG)),y) | 208 | ifeq ($(strip $(CONFIG_DEBUG)),y) |
215 | CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE | 209 | CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE |
216 | LDFLAGS += $(call check_ld,-warn-common,) | 210 | LDFLAGS += $(call check_ld,--warn-common,) |
217 | STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging | 211 | STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging |
218 | else | 212 | else |
219 | CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG | 213 | CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG |
220 | LDFLAGS += $(call check_ld,-warn-common,) | 214 | LDFLAGS += $(call check_ld,--warn-common,) |
221 | LDFLAGS += $(call check_ld,--sort-common,) | 215 | LDFLAGS += $(call check_ld,--sort-common,) |
222 | STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment | 216 | STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment |
223 | endif | 217 | endif |
224 | ifeq ($(strip $(CONFIG_STATIC)),y) | 218 | ifeq ($(strip $(CONFIG_STATIC)),y) |
225 | LDFLAGS += $(call check_ld,--static,) | 219 | PROG_CFLAGS += $(call check_gcc,-static,) |
226 | #else | ||
227 | # LIBRARIES += -ldl | ||
228 | endif | 220 | endif |
221 | CFLAGS_SHARED += $(call check_gcc,-shared,) | ||
222 | LIB_CFLAGS+=$(CFLAGS_SHARED) | ||
229 | 223 | ||
230 | ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) | 224 | ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) |
231 | CFLAGS_PIC:= $(call check_gcc,-fPIC,) | 225 | CFLAGS_PIC:= $(call check_gcc,-fPIC,) |