summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2023-09-27 17:17:14 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-10-05 11:23:55 +0200
commit3ae831d3ee0e361f6e194f525a2fe0fa6f6968d1 (patch)
tree6222b26083d56ae9527a18becef9d07b6917a8bd
parentremove obsolete -single_module linker flag (is the default) (diff)
downloadcore-3ae831d3ee0e361f6e194f525a2fe0fa6f6968d1.tar.gz
core-3ae831d3ee0e361f6e194f525a2fe0fa6f6968d1.zip
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 <plubius@neooffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit 809733714b7501490c5a6fa690d254ec7f9bc8f9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157540 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--configure.ac15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index c22309469f2d..90cf027a14ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3505,6 +3505,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