From c9e5919ba0e70ff316d9eb40dffcbe34de96e58c Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 26 Oct 2024 23:12:21 +0300 Subject: [PATCH] try to fix apple build --- Makefile | 3 ++- Makefile.libretro | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7f95fe4a..80186b5e 100644 --- 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) \ diff --git a/Makefile.libretro b/Makefile.libretro index 1b9dd715..6bacb3f4 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -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) -- 2.39.5