From cce5a162381c5d38fe3f8382b1acc8434ec08984 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Mon, 26 Jan 2026 18:19:05 -0800 Subject: [PATCH] Fixed build on MacOS after 220b9b03 (0.9.5). MacOS linker does not support -Wl,-E as it exports binary symbols by default. This fixes #1015 on Github. --- auto/cc | 14 ++++++++++++++ auto/options | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/auto/cc b/auto/cc index 5b21e17e..d2ce8f89 100644 --- a/auto/cc +++ b/auto/cc @@ -169,6 +169,20 @@ case $NJS_CC_NAME in esac +njs_feature="-Wl,-E" +njs_feature_name= +njs_feature_run=value +njs_feature_path= +njs_feature_incs= +njs_feature_libs=-Wl,-E +njs_feature_test="int main(void) { return 0; }" + +. auto/feature + +if [ $njs_found = yes ]; then + NJS_LINK="$NJS_LINK -Wl,-E" +fi + if [ "$NJS_DEBUG" = "YES" ]; then njs_define=NJS_DEBUG . auto/define fi diff --git a/auto/options b/auto/options index e99f9b97..1e563136 100644 --- a/auto/options +++ b/auto/options @@ -5,7 +5,7 @@ NJS_CC_OPT= NJS_LD_OPT= -NJS_LINK="-Wl,-E" +NJS_LINK= NJS_PIC=-fPIC NJS_DEBUG=NO -- 2.47.3