diff options
author | Michael BrĂ¼ning <michael.bruning@qt.io> | 2024-03-05 09:02:25 +0100 |
---|---|---|
committer | Michael BrĂ¼ning <michael.bruning@qt.io> | 2024-04-08 13:07:06 +0100 |
commit | 0107863cc5ac27b133165578e04c5e19fcfce817 (patch) | |
tree | 73f2cb18183fc8932ef1e8c8a9f1ddf37a76a7f1 | |
parent | b0e44197db12f400dd3102ee96b5d64891de4340 (diff) |
Force use of classic linker on AppleClang 15
The new linker ld_prime became the default option, but has issues when
building large libraries such as Qt WebEngine. Use the temporary work-
around of forcing the classic linker until the issue has been resolved
in AppleClang.
Task-number: QTBUG-122655
Change-Id: I1c21d6b1ac9f1fb89878bf8cc9786d24fe1c94da
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit df40c77a9a2bb2da90c5367f2ed217f027106e8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8a5a1a7beb785c6c15c537f4da5f09c38664e952)
(cherry picked from commit 3f576486d25ff4581f2590e9b2aebaba6f5ac7e2)
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r-- | cmake/Functions.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake index f22e96056..95b252277 100644 --- a/cmake/Functions.cmake +++ b/cmake/Functions.cmake @@ -1192,6 +1192,15 @@ function(add_gn_build_artifacts_to_target) endforeach() list(GET archs 0 arch) set(target ${arg_NINJA_TARGET}_${config}_${arch}) + # Work around for broken builds with new Apple linker ld_prime. Force + # use of the classic linker until this has been fixed. + # TODO: remove once this has been fixed by Apple. See issue FB13667242 + # or QTBUG-122655 for details. + if(APPLECLANG) + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15.0.0") + target_link_options(${arg_CMAKE_TARGET} PRIVATE -ld_classic) + endif() + endif() if(QT_IS_MACOS_UNIVERSAL) add_lipo_command(${target} ${arg_BUILDDIR}/${config}) endif() |