mirror of
https://gitlab.com/d3tn/ud3tn.git
synced 2026-08-17 13:07:35 +02:00
mk: Only link dynamic library with --whole-archive
For the executable we should not use this option as it unnecessarily increases binary size. There might also be incompatibilities with Mac, see #126 Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This commit is contained in:
parent
e58181818e
commit
602c4ce00a
2 changed files with 5 additions and 3 deletions
|
|
@ -41,7 +41,8 @@ $(eval $(call addComponentWithRules,external/util/src))
|
|||
$(eval $(call generateComponentRules,components/daemon))
|
||||
$(eval $(call generateComponentRules,test/unit))
|
||||
|
||||
build/$(PLATFORM)/libud3tn.so: LDFLAGS += $(LDFLAGS_LIB)
|
||||
build/$(PLATFORM)/libud3tn.so: LDFLAGS += $(LDFLAGS_LIB) -Wl,--no-whole-archive
|
||||
build/$(PLATFORM)/libud3tn.so: LDFLAGS_PRE += -Wl,--whole-archive
|
||||
build/$(PLATFORM)/libud3tn.so: LIBS = $(LIBS_libud3tn.so)
|
||||
build/$(PLATFORM)/libud3tn.so: $(LIBS_libud3tn.so) | build/$(PLATFORM)
|
||||
$(call cmd,link)
|
||||
|
|
|
|||
|
|
@ -55,9 +55,10 @@ cmd_ar = "$(AR)" rcs "$@" $(OBJECTS)
|
|||
|
||||
quiet_cmd_link = LINK $@
|
||||
cmd_link = "$(LD)" -o "$@" \
|
||||
-Wl,--whole-archive -Wl,--start-group \
|
||||
$(LDFLAGS_PRE) \
|
||||
-Wl,--start-group \
|
||||
$(OBJECTS) $(LIBS) \
|
||||
-Wl,--end-group -Wl,--no-whole-archive \
|
||||
-Wl,--end-group \
|
||||
$(LDFLAGS)
|
||||
|
||||
quiet_cmd_mkdir = MKDIR $@
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue