From f0b40b563fd03b03c7b75db47a7e179943d4cf82 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 17 Mar 2026 04:43:34 +0300
Subject: [PATCH] acinclude/libtool.m4: updates from mainstream git:
- Disables chained fixups for macOS ('-no_fixup_chains' if supported by
linker), because it is not compatible with '-undefined dynamic_lookup'
---
acinclude/libtool.m4 | 18 ++++++++++++-
configure | 61 ++++++++++++++++++++++++++++++++++++--------
2 files changed, 67 insertions(+), 12 deletions(-)
diff --git a/acinclude/libtool.m4 b/acinclude/libtool.m4
index d4221abee..a6ba8fe0d 100644
--- a/acinclude/libtool.m4
+++ b/acinclude/libtool.m4
@@ -931,6 +931,17 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
rm -rf libconftest.dylib*
rm -f conftest.*
fi])
+ # Feature test to disable chained fixups since it is not
+ # compatible with '-undefined dynamic_lookup'
+ AC_CACHE_CHECK([for -no_fixup_chains linker flag],
+ [lt_cv_support_no_fixup_chains],
+ [save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_support_no_fixup_chains=yes],
+ [lt_cv_support_no_fixup_chains=no])
+ LDFLAGS=$save_LDFLAGS
+ ])
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
[lt_cv_ld_exported_symbols_list],
[lt_cv_ld_exported_symbols_list=no
@@ -952,7 +963,12 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ if test yes = "$lt_cv_support_no_fixup_chains"; then
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup ${wl}-no_fixup_chains'
+ else
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup'
+ fi
+ ;;
esac
;;
esac
diff --git a/configure b/configure
index b31b1dac8..a0685e8b1 100755
--- a/configure
+++ b/configure
@@ -6720,6 +6720,40 @@ else $as_nop
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; }
+ # Feature test to disable chained fixups since it is not
+ # compatible with '-undefined dynamic_lookup'
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5
+printf %s "checking for -no_fixup_chains linker flag... " >&6; }
+if test ${lt_cv_support_no_fixup_chains+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ lt_cv_support_no_fixup_chains=yes
+else $as_nop
+ lt_cv_support_no_fixup_chains=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5
+printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
printf %s "checking for -exported_symbols_list linker flag... " >&6; }
if test ${lt_cv_ld_exported_symbols_list+y}
@@ -6764,7 +6798,12 @@ printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; }
10.[012],*|,*powerpc*-darwin[5-8]*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ if test yes = "$lt_cv_support_no_fixup_chains"; then
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup ${wl}-no_fixup_chains'
+ else
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup'
+ fi
+ ;;
esac
;;
esac
@@ -7657,11 +7696,11 @@ else $as_nop
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7660: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7699: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7664: \$? = $ac_status" >&5
+ echo "$as_me:7703: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8007,11 +8046,11 @@ else $as_nop
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8010: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8049: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8014: \$? = $ac_status" >&5
+ echo "$as_me:8053: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8114,11 +8153,11 @@ else $as_nop
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8117: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8156: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8121: \$? = $ac_status" >&5
+ echo "$as_me:8160: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -8170,11 +8209,11 @@ else $as_nop
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8173: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8212: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8177: \$? = $ac_status" >&5
+ echo "$as_me:8216: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -10613,7 +10652,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10616 "configure"
+#line 10655 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10710,7 +10749,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10713 "configure"
+#line 10752 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H