]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
m4: Update disabling chained fixups for macOS
authorIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Tue, 25 Jun 2024 14:09:52 +0000 (17:09 +0300)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Wed, 26 Jun 2024 18:14:33 +0000 (21:14 +0300)
This is an update for commit 001d22d7d587e85a911c71c4d0c798ede8014b77.

* m4/libtool.m4: Replace version testing with a feature test for
  the '-no_fixup_chains' flag.
* tests/no-executables.at: Set cache variable for link test.

m4/libtool.m4
tests/no-executables.at

index a1fcdf7aeec317a00a6a082c33026b307b0485f8..381d4cb3587fd7c6251462c57ff6b4aad5e75789 100644 (file)
@@ -974,6 +974,7 @@ _lt_linker_boilerplate=`cat conftest.err`
 $RM -r conftest*
 ])# _LT_LINKER_BOILERPLATE
 
+
 # _LT_REQUIRED_DARWIN_CHECKS
 # -------------------------
 m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
@@ -1024,6 +1025,21 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
        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+=" -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
@@ -1069,28 +1085,14 @@ _LT_EOF
     darwin1.*)
       _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
     darwin*)
-      # $MACOSX_DEPLOYMENT_TARGET seems to be deprecated as a darwin
-      # environment variable
       case $MACOSX_DEPLOYMENT_TARGET,$host in
         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' ;;
-      esac
-      # Disable chained fixups since it is not compatible with
-      # '-undefined dynamic_lookup'
-      macos_version=`sw_vers -productVersion`
-      case $macos_version in
-        11.[[3-7]]*|1[[2-4]]*)
-          xcode_version=`pkgutil --pkg-info=com.apple.pkg.CLTools_Executables`
-          case $xcode_version in
-            *version:\ 1[[3-5]]*)
-              _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup $wl-no_fixup_chains' ;;
-            *)
-            ;;
-          esac
-        ;;
-        *)
+          _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup'
+          if test yes = "$lt_cv_support_no_fixup_chains"; then
+            _lt_dar_allow_undefined+=' $wl-no_fixup_chains'
+          fi
         ;;
       esac
     ;;
index 46225a6f6efdb62e7d0e34c11da45b2b32ecc959..7530fe366fb29f92a4cd4dff4da9a925ee844aa9 100644 (file)
@@ -50,6 +50,7 @@ AM_PROG_GCJ
 lt_cv_shlibpath_overrides_runpath=no
 lt_cv_archive_cmds_need_lc=no
 lt_cv_cc_needs_belf=no
+lt_cv_support_no_fixup_chains=no
 lt_cv_ld_exported_symbols_list=no
 lt_cv_prog_compiler_static_works=no
 lt_cv_aix_libpath=/usr/lib:/lib