From 3ddc8518767087a51ac6b30b49c36b4cac31d537 Mon Sep 17 00:00:00 2001 From: Patrick Grimm Date: Sat, 29 Jan 2022 23:08:47 +0100 Subject: [PATCH] Fixed bsd compile error ld: unknown option: --gc-sections (#217) Signed-off-by: Patrick Grimm --- apps/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/Makefile b/apps/Makefile index 31c78555..6e9032f6 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -127,7 +127,11 @@ endif LFLAGS += -Wl,$(SYSTEM_LIB) # GCC dead code removal CFLAGS += -ffunction-sections -fdata-sections +ifeq ($(shell uname -s),Darwin) +LFLAGS += -Wl,-dead_strip +else LFLAGS += -Wl,--gc-sections +endif .EXPORT_ALL_VARIABLES: