From 1e2d02e449adb820aec96b6beaccab764efa4cd5 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Mon, 14 Aug 2023 04:28:59 -0700 Subject: [PATCH] changed macOS to not use "-dead_strip_dylibs" The macOS ld documentation states that option should not be used when linking against a dylib which is required at runtime for some indirect reason such as the dylib has an important initializer. The libcustcalc appears to have such an initializer. --- CHANGES | 3 +-- Makefile.target | 9 ++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index ec3db01..0d5f243 100644 --- a/CHANGES +++ b/CHANGES @@ -89,8 +89,7 @@ The following are the changes from calc version 2.14.3.1 to date: Under macOS, to reduce dependency chains, we remove functions and data that are unreachable by the entry point or exported symbols. - In particular, the linker is run with "-dead_strip" and with - "-dead_strip_dylibs". + In particular, the linker is run with "-dead_strip". The following are the changes from calc version 2.14.2.1 to 2.14.3.0: diff --git a/Makefile.target b/Makefile.target index 09dbe39..5f72b7b 100644 --- a/Makefile.target +++ b/Makefile.target @@ -165,7 +165,14 @@ LIBCUSTCALC_SHLIB= -dynamiclib -undefined dynamic_lookup \ # To reduce dependency chains under macOS, we remove functions and # data that are unreachable by the entry point or exported symbols. # -LDFLAGS+= -Wl,-dead_strip -Wl,-dead_strip_dylibs +COMMON_LDFLAGS+= -Wl,-dead_strip + +# We cannot use: COMMON_LDFLAGS+= -Wl,-dead_strip_dylibs +# +# The macOS ld documentation states that option should not be used +# when linking against a dylib which is required at runtime for some +# indirect reason such as the dylib has an important initializer. +# The libcustcalc appears to have such an initializer. # static library option #