configure.ac |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 809733714b7501490c5a6fa690d254ec7f9bc8f9
Author:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
AuthorDate: Wed Sep 27 17:17:14 2023 +0200
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Wed Oct 4 14:59:18 2023 +0200

    macOS /w Xcode 15: force the old linker when targeting macOS 11 or lower
    
    the new linker has problems with weak symbols and causes runtime crashes 
when
    trying to run those builds on older versions of macOS
    
    
https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking
    
    they write the classic linker will be removed in a future release, so have 
it
    error out for Xcode 16 for now just in case. The brave soul who tries it out
    first will have to disable that AC_MSG_ERROR… (or expliticly set macOS 12 as
    min target)
    
    Change-Id: I653e5bce70b3eae0f512be11dc7e07ffc98e9812
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157336
    Tested-by: Jenkins
    Reviewed-by: Patrick Luby <plub...@neooffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/configure.ac b/configure.ac
index 858984f7f946..3fe42df3978c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3518,6 +3518,21 @@ if test $_os = Darwin; then
     my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print 
$1*100+($2<100?$2:99) }')
     if test "$my_xcode_ver3" -ge 1205; then
         AC_MSG_RESULT([yes ($my_xcode_ver2)])
+        if test $MAC_OS_X_VERSION_MIN_REQUIRED -lt 120000; then
+            if test "$my_xcode_ver3" -ge 1600; then
+                dnl the Xcode 15 relnotes state that the classic linker will 
disappear in the next version, but nothing about
+                dnl fixing the problem with weak symbols/macOS 11 
compatibility, so assume for now that Xcode 16 will break it...
+                AC_MSG_ERROR([Check that Xcode 16 still supports the old 
linker/that it doesn't break macOS 11 compatibility, then remove this check]);
+            fi
+            if test "$my_xcode_ver3" -ge 1500; then
+                AC_MSG_WARN([Xcode 15 has a new linker that causes runtime 
crashes on macOS 11])
+                add_warning "Xcode 15 has a new linker that causes runtime 
crashes on macOS 11, forcing the old linker."
+                add_warning "see 
https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking";
+                LDFLAGS="$LDFLAGS -Wl,-ld_classic"
+                # if LDFLAGS weren't set already, a check above sets 
x_LDFLAGS=[#] to comment-out the export LDFLAGS line in config_host.mk
+                x_LDFLAGS=
+            fi
+        fi
     else
         AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at 
least Xcode 12.5])
     fi

Reply via email to