Subject: libtool.m4 linker flag selection does not work for macOS Big Sur

From: JRR <[email-masked]>
Date: Mon, 16 Nov 2020 14:51:18 +0100

Hi all,
it seems that the setup in
lines 1065-1083 in m4/libtool.m4
(cf. below) do not work for macOS Big Sur because they changed the major 
development version
of the macOS. When I am linking my programs, I need
-Wl,-undefined, -Wl,-dynamic_lookup
but I end up with
-Wl,-flat_namespace -Wl,-suppress
When I run my own configure with
MACOSX_DEPLOYMOMENT_TARGET='10.16' everything works again.
I provided a potential patch below, with two changes, the first assumes
the MACOSX_DEPLOYMENT_TARGET that libtool seems to default to,
namely 10.0, where now we have to take care of the fact that macOS
changed from darwin19.x -> darwin20.1
The second change accounts for a correct setting if someone sets
MACOSX_DEPLOYMENT_TARGET='11.0'
Probably someone else has already reported that issue.
Cheers,
     JRR (Juergen Reuter)

$ git diff
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index f2d1f398..be9d50f3 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1072,11 +1072,11 @@ _LT_EOF
        # to the OS version, if on x86, and 10.4, the deployment
        # target defaults to 10.4. Don't you love it?
        case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-    10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+    10.0,*86*-darwin8*|10.0,*-darwin[[912]]*)
        _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
      10.[[012]][[,.]]*)
        _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined 
${wl}suppress' ;;
-    10.*)
+    10.*|11.*)
        _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
        esac
      ;;

-- 
--
---------------------------------
Juergen Reuter
DESY Theory Group, Bldg. 2a
Notkestr. 85
22607 Hamburg, GERMANY
Tel +49 (0)40 8998 3895
Fax +49 (0)40 8998 2777
skype: jr_reuter
---------------------------------