try to fix apple build
authornotaz <notasas@gmail.com>
Sat, 26 Oct 2024 20:12:21 +0000 (23:12 +0300)
committernotaz <notasas@gmail.com>
Sat, 26 Oct 2024 20:12:21 +0000 (23:12 +0300)
Makefile
Makefile.libretro

index 7f95fe4..80186b5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,8 @@ LDFLAGS += -fsanitize=address
 endif
 ifneq ($(NO_FSECTIONS), 1)
 CFLAGS += -ffunction-sections -fdata-sections
-LDFLAGS += -Wl,--gc-sections
+FSECTIONS_LDFLAGS ?= -Wl,--gc-sections
+LDFLAGS += $(FSECTIONS_LDFLAGS)
 endif
 CFLAGS += -DP_HAVE_MMAP=$(if $(NO_MMAP),0,1) \
          -DP_HAVE_PTHREAD=$(if $(NO_PTHREAD),0,1) \
index 1b9dd71..6bacb3f 100644 (file)
@@ -201,6 +201,7 @@ else ifeq ($(platform), osx)
        CXXFLAGS  += $(ARCHFLAGS)
        LDFLAGS += $(ARCHFLAGS)
        HAVE_PHYSICAL_CDROM = 0
+       FSECTIONS_LDFLAGS = -Wl,-dead_strip
 
 # iOS
 else ifneq (,$(findstring ios,$(platform)))
@@ -238,6 +239,7 @@ else
        MINVERSION = -miphoneos-version-min=5.0
 endif
        CFLAGS += $(MINVERSION)
+       FSECTIONS_LDFLAGS = -Wl,-dead_strip
 
 else ifeq ($(platform), tvos-arm64)
        TARGET := $(TARGET_NAME)_libretro_tvos.dylib
@@ -261,6 +263,7 @@ endif
        CC_AS = perl ./tools/gas-preprocessor.pl $(CC)
        MINVERSION = -mappletvos-version-min=11.0
        CFLAGS += $(MINVERSION)
+       FSECTIONS_LDFLAGS = -Wl,-dead_strip
 
 # Nintendo Switch (libnx)
 else ifeq ($(platform), libnx)