summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2024-01-17 17:04:45 +0100
committerEli Schwartz <eschwartz93@gmail.com>2024-01-18 14:22:36 -0500
commit33527630f1bd0e51093044016557cb44e7bb6547 (patch)
tree33e104ffb3382938608607805776fbd761f40361
parent85cfc1fafcda047fa497d1d6219a8c742523b5a6 (diff)
downloadmeson-33527630f1bd0e51093044016557cb44e7bb6547.tar.gz
linkers_detect: detect xtools (Apple ld64 derivative)
xtools is in use on Gentoo Prefix x86_64 and ppc based Darwin installs. Pick it up as a valid linker. Since xtools is answering with a version to --version, as opposed to ld64, detection of xtools in the ld64 handling block is not possible, since --version already succeeded. Bug: https://bugs.gentoo.org/868516 Bug: https://github.com/mesonbuild/meson/issues/10805 Signed-off-by: Fabian Groffen <grobian@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
-rw-r--r--mesonbuild/linkers/detect.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/linkers/detect.py b/mesonbuild/linkers/detect.py
index 918f2e634..1bce413f4 100644
--- a/mesonbuild/linkers/detect.py
+++ b/mesonbuild/linkers/detect.py
@@ -174,6 +174,11 @@ def guess_nix_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Ty
v = search_version(o)
linker = linkers.LLVMDynamicLinker(compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v)
+ # detect xtools first, bug #10805
+ elif 'xtools-' in o.split('\n', maxsplit=1)[0]:
+ xtools = o.split(' ', maxsplit=1)[0]
+ v = xtools.split('-', maxsplit=2)[1]
+ linker = linkers.AppleDynamicLinker(compiler, for_machine, comp_class.LINKER_PREFIX, override, version=v)
# First might be apple clang, second is for real gcc, the third is icc.
# Note that "ld: unknown option: " sometimes instead is "ld: unknown options:".
elif e.endswith('(use -v to see invocation)\n') or 'macosx_version' in e or 'ld: unknown option' in e: