summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2023-09-27 17:17:14 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-10-15 22:13:59 +0200
commitf453d9e5198e003f016b352cb13f99d4c49927ba (patch)
treeab0ba20419537fc803ed78ac894880f728cc38c5
parent5ab2f5712306fd9c6af4d0a18e191659ccc2024a (diff)
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 605764bc59348fa43d1e3dc8899d5c058e5d2a29) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157539 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 c1d3652df187..ce490b8c6f09 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3489,6 +3489,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