mirror of
https://github.com/sheumann/hush.git
synced 2025-01-13 21:31:51 +00:00
- pass -static via CC rather than LD
This commit is contained in:
parent
39e7510664
commit
81b94960a2
4
Makefile
4
Makefile
@ -280,8 +280,8 @@ $(LIBBUSYBOX_SONAME):
|
|||||||
ifndef MAJOR_VERSION
|
ifndef MAJOR_VERSION
|
||||||
$(error MAJOR_VERSION needed for $@ is not defined)
|
$(error MAJOR_VERSION needed for $@ is not defined)
|
||||||
endif
|
endif
|
||||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -shared \
|
$(CC) $(CFLAGS) $(LIB_CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) \
|
||||||
$(CFLAGS_PIC) \
|
$(LIB_LDFLAGS) \
|
||||||
-Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
|
-Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
|
||||||
-Wl,-z,combreloc $(LIB_LDFLAGS) \
|
-Wl,-z,combreloc $(LIB_LDFLAGS) \
|
||||||
-o $(@) \
|
-o $(@) \
|
||||||
|
18
Rules.mak
18
Rules.mak
@ -118,13 +118,7 @@ check_gcc=$(shell \
|
|||||||
# A not very robust macro to check for available ld flags
|
# A not very robust macro to check for available ld flags
|
||||||
check_ld=$(shell \
|
check_ld=$(shell \
|
||||||
if [ "x$(1)" != "x" ]; then \
|
if [ "x$(1)" != "x" ]; then \
|
||||||
$(LD) --help | grep -q \\$(1) && echo "-Wl,$(1)$(2)" ; \
|
$(LD) --help | grep -q "\$(1)" && echo "-Wl,$(1)" ; \
|
||||||
fi)
|
|
||||||
|
|
||||||
# A not very robust macro to check for available as flags
|
|
||||||
check_as=$(shell \
|
|
||||||
if [ "x$(1)" != "x" ]; then \
|
|
||||||
$(AS) --help | grep -q "\\$(1)" && echo "-Wa,$(1)$(2)" ; \
|
|
||||||
fi)
|
fi)
|
||||||
|
|
||||||
|
|
||||||
@ -213,19 +207,19 @@ else
|
|||||||
endif
|
endif
|
||||||
ifeq ($(strip $(CONFIG_DEBUG)),y)
|
ifeq ($(strip $(CONFIG_DEBUG)),y)
|
||||||
CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE
|
CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE
|
||||||
LDFLAGS += $(call check_ld,-warn-common,)
|
LDFLAGS += $(call check_ld,--warn-common,)
|
||||||
STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
|
STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
|
||||||
else
|
else
|
||||||
CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
|
CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
|
||||||
LDFLAGS += $(call check_ld,-warn-common,)
|
LDFLAGS += $(call check_ld,--warn-common,)
|
||||||
LDFLAGS += $(call check_ld,--sort-common,)
|
LDFLAGS += $(call check_ld,--sort-common,)
|
||||||
STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment
|
STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment
|
||||||
endif
|
endif
|
||||||
ifeq ($(strip $(CONFIG_STATIC)),y)
|
ifeq ($(strip $(CONFIG_STATIC)),y)
|
||||||
LDFLAGS += $(call check_ld,--static,)
|
PROG_CFLAGS += $(call check_gcc,-static,)
|
||||||
#else
|
|
||||||
# LIBRARIES += -ldl
|
|
||||||
endif
|
endif
|
||||||
|
CFLAGS_SHARED += $(call check_gcc,-shared,)
|
||||||
|
LIB_CFLAGS+=$(CFLAGS_SHARED)
|
||||||
|
|
||||||
ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
|
ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
|
||||||
CFLAGS_PIC:= $(call check_gcc,-fPIC,)
|
CFLAGS_PIC:= $(call check_gcc,-fPIC,)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user