Commit Graph

11 Commits

Author SHA1 Message Date
Dylan Baker 48a181866f compilers/mixins/clang: Make type safe 2020-09-24 12:14:13 -07:00
Antony Chan 70edf82c6c 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
...
```
2020-08-02 10:39:44 -07:00
georgev93 eee117aa24 Allow building with b_coverage set to true when clang is being used regardless of linker selection. 2020-05-22 17:18:54 +03:00
Yevhenii Kolesnikov 9dc3ca2c1c compilers: add fetching of define list for clang
Simmilar to gcc, the list of pre-processor defines can be fetched with
`-dM -E` option. The way cpu_family is determined on linux relies on
this list.

Fixes incorrect value of cpu_family on linux, when crosscompiling:

```
CC="clang -m32" meson ./build
```

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2020-05-22 16:58:12 +03:00
Nirbheek Chauhan dc19b13202 compilers: Silence warning about gnu_inline with clang
The warning is due to a change in behaviour in Clang 10 and newer:

https://releases.llvm.org/10.0.0/tools/clang/docs/ReleaseNotes.html#c-language-changes-in-clang

This was already fixed for clang++, but not for clang for some reason.
It was also fixed incorrectly; by adding `extern` instead of moving
from `-Werror` to `-Werror=attributes`.
2020-04-20 19:30:57 +03:00
Dylan Baker 61f5618828 compilers: Clang can take linkers that are paths
This will be a regression in 0.54.0 because we now enforce that gnu
compilers only get gold, bfd, or lld.
2020-03-24 10:05:01 +02:00
Phillip Johnston 79198de6cf Resolve Clang failure to use -Og with --optimization=g
Clang supports the GCC -Og flag, but --optimization=g is not setting that. This is because Clang is referencing the clike_optimization_args, which does not define a flag for 'g'.

To address this, we'll mimic the GNU options instead of the C-like ones.

Fixes #6619
2020-03-15 22:29:29 +02:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Dylan Baker 0c22798b1a compilers: replace CompilerType with MachineInfo
Now that the linkers are split out of the compilers this enum is
only used to know what platform we're compiling for. Which is
what the MachineInfo class is for
2019-10-07 12:08:20 -07:00
Dylan Baker 1b276598ce compilers/mixins/clang: Add type annotations 2019-07-15 10:59:22 -07:00
Dylan Baker bc4438b34f compilers: Put clang mixin in a module 2019-07-15 10:59:22 -07:00