use the new linker on macOS (introduced in XCode 15)

the classic linker will be removed in upcoming versions of XCode and is
deprecated
XCode 15.0 has a bug that would cause runtime crashes on macOS 11, but
that bug has been fixed with XCode 15.1 and all users of XCode 15.0
could update to 15.1 or 15.2 (15.3 or later requires newer version of
macOS) - so remove the workaround of using the old linker and instead
require a fixed version of Xcode (or a different minimum deployment
target)

Change-Id: If516ac85539da83f54b1792450cf43ea55d0d808
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170640
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Tested-by: Jenkins
This commit is contained in:
Christian Lohmaier 2024-07-17 19:24:42 +02:00
parent 3dcc288468
commit ad383c896a

View file

@ -3721,18 +3721,12 @@ if test $_os = Darwin; then
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 1700; 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=
if test "$my_xcode_ver3" -eq 1500; then
dnl the bug was aleady fixed on 15.1 and 15.2 still has the same OS requirements as 15.0
dnl in other words all affected users could update to a working Xcode version
AC_MSG_WARN([Use a current version of XCode or bump the minimum deployment target])
AC_MSG_WARN([[see https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking]])
AC_MSG_ERROR([Xcode 15.0 has a bug in the new linker that causes runtime crashes on macOS 11 - aborting])
fi
fi
else