aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers.py
diff options
context:
space:
mode:
authorAntony Chan <antony@truepic.com>2020-07-02 13:16:21 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-08-02 10:39:44 -0700
commit70edf82c6c77902cd64f44848302bbac92d611d8 (patch)
tree9430c74684e8c708af79a7e37c70b73cbcf9b709 /mesonbuild/linkers.py
parent3040f3c8dc620152afea73066f0048c3bbeb7266 (diff)
downloadmeson-70edf82c6c77902cd64f44848302bbac92d611d8.zip
meson-70edf82c6c77902cd64f44848302bbac92d611d8.tar.gz
meson-70edf82c6c77902cd64f44848302bbac92d611d8.tar.bz2
Make meson recognize the Qualcomm LLVM toolchain
Meson calls `path/to/clang++ --version` to guess which build toolchain the user has picked to build the source code. For the Qualcomm LLVM toolchain, the output have an unusual output as shown below: ``` clang version 8.0.12 Snapdragon LLVM ARM Compiler 8.0.12 (based on llvm.org 7.0+) Target: arm-unknown-linux-gnueabi Thread model: posix Repository: (ssh://git-hexagon-aus.qualcomm.com:...) InstalledDir: /pkg/qct/software/llvm/release/arm/8.0.12/bin ``` Another unusual pattern is the output of `path/to/ld.qcld --version`: ``` ARM Linker from Snapdragon LLVM ARM Compiler Version 8.0.12 ARM Linker based on LLVM version: 8.0 ``` The Meson logic is modified accordingly so that Meson can correctly determine toolchain as "LLVM aarch64 cross-compiler on GNU/Linux64 OS". This is the expected output of `meson --native-file native_file.ini --cross-file cross_file.ini build/aarch64-debug/`: ``` ... C++ compiler for the host machine: ... (clang 8.0.12 "clang version 8.0.12") C++ linker for the host machine: ... ld.lld 8.0.12 ... ```
Diffstat (limited to 'mesonbuild/linkers.py')
-rw-r--r--mesonbuild/linkers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py
index fa30b9a..3ce7111 100644
--- a/mesonbuild/linkers.py
+++ b/mesonbuild/linkers.py
@@ -927,6 +927,12 @@ class ArmClangDynamicLinker(ArmDynamicLinker):
def import_library_args(self, implibname: str) -> T.List[str]:
return ['--symdefs=' + implibname]
+class QualcommLLVMDynamicLinker(LLVMDynamicLinker):
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+ # ARM Linker from Snapdragon LLVM ARM Compiler
+ self.id = 'ld.qcld'
class PGIDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):