aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2023-12-10 15:32:45 +0300
committerIvan Komissarov <ABBAPOH@gmail.com>2023-12-11 15:41:14 +0000
commite6216e9fcf76264cbb8698fab0c6674c874ec2a2 (patch)
treec2c764b3516368b68eda72325b0adb3416e84c18
parente56cbf7b64810ca0fadc8d3ffbc92a5ba1b293a0 (diff)
apple: disable lazy linker mode for Xcode 15
According to the ld man, this mode is deprecated; with clang 15.0.0, it is no longer possible to pass this option via compiler frontend (it treats -lazy_library flag as -l flag and tries to link to "azy_library"). Change-Id: I74a877c359ae3550d372486e055a9b4c3e9be997 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--doc/reference/modules/cpp-module.qdoc1
-rw-r--r--share/qbs/modules/cpp/gcc.js3
2 files changed, 4 insertions, 0 deletions
diff --git a/doc/reference/modules/cpp-module.qdoc b/doc/reference/modules/cpp-module.qdoc
index 271787fbc..2b344aac2 100644
--- a/doc/reference/modules/cpp-module.qdoc
+++ b/doc/reference/modules/cpp-module.qdoc
@@ -80,6 +80,7 @@
May contain the values: "weak", "lazy", "reexport", and "upward"; refer to the Apple
ld64 man page for full details. \c{undefined} uses normal linking.
Currently only applies when linking for Apple platforms.
+ Note that \c "lazy" mode is deprecated and doesn't work with Xcode 15 and above.
\endtable
\section2 Relevant File Tags
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index b60608682..82f6889e4 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -477,7 +477,10 @@ function linkerFlags(project, product, inputs, outputs, primaryOutput, linkerPat
if (isDarwin && symbolLinkMode) {
if (!["lazy", "reexport", "upward", "weak"].includes(symbolLinkMode))
throw new Error("unknown value '" + symbolLinkMode + "' for cpp.symbolLinkMode");
+ }
+ var supportsLazyMode = Utilities.versionCompare(product.cpp.compilerVersion, "15.0.0") < 0;
+ if (isDarwin && symbolLinkMode && (symbolLinkMode !== "lazy" || supportsLazyMode)) {
if (FileInfo.isAbsolutePath(lib) || lib.startsWith('@'))
escapableLinkerFlags.push("-" + symbolLinkMode + "_library", lib);
else if (dep.framework)