mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-19 02:11:28 +00:00
Use -Wl,--gc-sections and drop -rdynamic in order to allow the linker to leave out unused functions Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 lines
437 B
Plaintext
15 lines
437 B
Plaintext
--- a/src/lib/common/unit.mk
|
|
+++ b/src/lib/common/unit.mk
|
|
@@ -42,7 +42,10 @@ UNIT_SRC += src/os_exec.c
|
|
UNIT_CFLAGS := -I$(UNIT_PATH)/inc
|
|
UNIT_CFLAGS += -fasynchronous-unwind-tables
|
|
UNIT_CFLAGS += -Isrc/lib/osa/inc
|
|
-UNIT_LDFLAGS := -rdynamic -ldl -ljansson -lrt
|
|
+UNIT_LDFLAGS := -ldl -ljansson -lrt
|
|
+ifndef NO_RDYNAMIC
|
|
+ UNIT_LDFLAGS += -rdynamic
|
|
+endif
|
|
|
|
UNIT_EXPORT_CFLAGS := $(UNIT_CFLAGS)
|
|
UNIT_EXPORT_LDFLAGS := $(UNIT_LDFLAGS)
|