aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
AgeCommit message (Collapse)AuthorFilesLines
2020-09-24compilers/mixins: make xc16 type safeDylan Baker1-2/+7
2020-09-24compilers/mixins: make visual studio type safeDylan Baker1-2/+21
2020-09-24compilers/mixins/pgi: Make type safeDylan Baker1-2/+11
2020-09-24compilers/mixins/islinker: Make type safeDylan Baker1-0/+4
2020-09-24compilers/mixins/intel: make type safeDylan Baker1-11/+22
2020-09-24compilers/mixins/intel: Use the has_func_attribute_extra_args functionDylan Baker2-1/+6
Instead of putting that extra argument in the base compiles() class
2020-09-24compilers/mixins/emscripten: make type safeDylan Baker1-4/+11
2020-09-24compilers/mixins/elbrus: make type safeDylan Baker1-1/+5
2020-09-24compilers/mixins: make compcert type safeDylan Baker1-2/+6
2020-09-24compilers/mixins/clang: Make type safeDylan Baker2-5/+24
2020-09-24compilers/mixings/gnu: make type safeDylan Baker1-11/+34
2020-09-24compilers/mixins/clike: fix mypy issuesDylan Baker3-147/+296
2020-09-24compilers/mixins/ccrx: make mypy safeDylan Baker1-1/+6
2020-09-24compilers/mixins/c2000: Make mypy safeDylan Baker1-1/+6
2020-09-24compilers/mixins/arm: make type safeDylan Baker1-26/+24
2020-09-24compilers/compilers: Fully type annotateDylan Baker3-165/+259
2020-09-24compilers: Use a distinct type for compile/link resultsDylan Baker4-27/+40
Currently we do some crazy hackery where we add extra properties to a Popen object and return that. That's crazy. Especially since some of our hackery is to delete attributes off of the Popen we don't want. Instead, let's just have a discrete type that has exactly the properties we want.
2020-09-18Some fixes for CompCertSebastian Meyer1-2/+2
1. Like with gcc's `ld`, also use the `group_start` code to create a `--start-group`/`--end-group` 2. xc16 tricked into believing the 'link_whole' was about `--*-group`, but it should use gcc's `--whole-archive` instead. 3. Not clear what the get_lib_prefix should really do, but for picolibc it seems I want just `''`. The problem with picolibc was that the `-l` would be prefixed to a lib like `picolib/libm/libm.a`. Though of course the `-l` would be necessary for just a plain `m` (that's what I assumed this would be used for). I think this might need some clarification from the meson devs ;-)
2020-09-17Canonicalize target architectures aarch64/armv* into arm64/arm for MSVC toolsMartin Storsjö1-0/+4
If the architectures are taken from the output of "clang-cl --version", we need to convert these names into names that the MSVC tools accept as the -machine: parameter.
2020-09-16linkers/compilers: Move an emscripten method to the compilerDylan Baker1-0/+7
This needed an attribute the linker doesn't have.
2020-09-15Add support for the CompCert C CompilerSebastian Meyer3-0/+160
* Add preliminary support for the CompCert C Compiler The intention is to use this with the picolibc, so some GCC flags are automatically filtered. Since CompCert uses GCC is for linking, those GCC-linker flags which are used by picolibc, are automatically prefixed with '-WUl', so that they're passed to GCC. Squashed commit of the following: commit 4e0ad66dca9de301d2e41e74aea4142afbd1da7d Author: Sebastian Meyer <meyer@absint.com> Date: Mon Aug 31 14:20:39 2020 +0200 remove '-fall' from default arguments, also filter -ftls-model=.* commit 41afa3ccc62ae72824eb319cb8b34b7e6693cb67 Author: Sebastian Meyer <meyer@absint.com> Date: Mon Aug 31 14:13:55 2020 +0200 use regex for filtering ccomp args commit d68d242d0ad22f8bf53923ce849da9b86b696a75 Author: Sebastian Meyer <meyer@absint.com> Date: Mon Aug 31 13:54:36 2020 +0200 filter some gcc arguments commit 982a01756266bddbbd211c54e8dbfa2f43dec38f Author: Sebastian Meyer <meyer@absint.com> Date: Fri Aug 28 15:03:14 2020 +0200 fix ccomp meson configuration commit dce0bea00b1caa094b1ed0c6c77cf6c12f0f58d9 Author: Sebastian Meyer <meyer@absint.com> Date: Thu Aug 27 13:02:19 2020 +0200 add CompCert to meson (does not fully work, yet) * remove unused import and s/cls/self/ fixes the two obvious LGTM warnings * CompCert: Do not ignore unsupported GCC flags Some are safe to ignore, however, as per https://github.com/mesonbuild/meson/pull/7674, they should not be ignored by meson itself. Instead the meson.build should take care to select only those which are actually supported by the compiler. * remove unused variable * Only add arguments once. * Apply suggestions from code review Co-authored-by: Dylan Baker <dylan@pnwbakers.com> * Remove erroneous ' ' from '-o {}'.format() As noticed by @dcbaker * added release note snippet for compcert * properly split parameters As suggested by @dcbaker, these parameters should be properly split into multiple strings. Co-authored-by: Dylan Baker <dylan@pnwbakers.com> * Update add_compcert_compiler.md Added a sentence about the state of the implementation (experimental); use proper markdown * properly separate arguments Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2020-09-13external-project: New module to build configure/make projectsXavier Claessens1-0/+3
This adds an experimental meson module to build projects with other build systems. Closes: #4316
2020-09-08typing: get rid of most T.castDaniel Mensinger1-1/+1
2020-09-08typing: fully annotate arglistDaniel Mensinger1-2/+2
2020-09-06backends: check external rpaths for all languages using ldflagsJames Hilliard1-0/+1
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-08-30D: fix include orderPierrick Bouvier1-0/+7
Commit 93c3ec7e introduced a new way to handle deduplication with compiler args. This resulted in D includes to be reversed.
2020-08-27Fix typo when fetching buildtype option for compiler checksNirbheek Chauhan1-1/+1
This type happened in https://github.com/mesonbuild/meson/pull/7432 and wasn't noticed because I didn't add a test for it. Rectified now. If we don't specify the CRT, MSVC will pick /MT by default (!?) and link to `libcmt.lib`. This actually *breaks* UWP because `libcmt.lib` is not available by default when building for UWP. Was noticed here: https://github.com/cisco/libsrtp/pull/505
2020-08-25Merge pull request #7581 from peterh/aixJussi Pakkanen1-1/+1
Add AIX support
2020-08-23Merge pull request #7600 from alexrp/masterJussi Pakkanen1-2/+13
Add C2x option support.
2020-08-22Merge pull request #7609 from dcbaker/submit/2020-08/cmake-fix-apple-clangJussi Pakkanen3-0/+15
Fix mapping of apple compilers in cmake
2020-08-22compilers: Add Apple subclasses for ObjC and ObjC++Dylan Baker3-0/+15
These are needed because in some cases we need to be able to know if we're using vanilla clang or Apple's clang.
2020-08-22Add C2x option support.Alex Rønne Petersen1-2/+13
2020-08-22Merge pull request #7607 from bonzini/speedupJussi Pakkanen1-4/+8
Various speedups from profiling QEMU's meson.build
2020-08-22Merge pull request #7447 from scivision/nvcJussi Pakkanen4-4/+45
Add support for NVidia HPC SDK compilers
2020-08-20Correctly determine C++ stds for Elbrus compilermakise-homura1-5/+13
2020-08-18clike: optimize to_nativePaolo Bonzini1-4/+8
Look for group-able flags with a single regex match, since we are already using regexes for .so files. Also weed out flags other than -isystem very quickly with a single startswith call. On a QEMU build, the time spent in to_native goes from 2.279s to 1.322s.
2020-08-17find_library: include get_linker_always_args in link argsPeter Harris1-1/+1
The linker always args, as the name implies, should always be included. For example, the AIX get_allow_undefined_link_args are a syntax error unless the AIX get_linker_always_args are also used.
2020-08-09msvc: enable /std:c11 flagMichael Hirsch1-0/+20
2020-08-02Make meson recognize the Qualcomm LLVM toolchainAntony Chan1-0/+5
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-07-23compilers: Cache gnu-mixins has_arguments() checksNirbheek Chauhan1-1/+1
want_output gives us the output file. We don't need the file. We just need the compiler stderr, which is always stored.
2020-07-22visualstudio: warning_level 0 should not map to /W1Xavier Claessens1-1/+1
In every other compilers level 0 maps to no argument at all.
2020-07-19fix msvc not recognising b_ndebugElliot Haisley1-1/+1
fixes #7404
2020-07-13Fix native builds on Windows ARM64 machinesNirbheek Chauhan4-11/+10
I made the mistake of always selecting the debug CRT for compiler checks on Windows 4 years ago: https://github.com/mesonbuild/meson/pull/543 https://github.com/mesonbuild/meson/pull/614 The idea was to always build the tests with debugging enabled so that the compiler doesn't optimize the tests away. But we stopped doing that a while ago, and also the debug CRT has no relation to that. We should select the CRT in the same way that we do for building targets: based on the options. On Windows ARM64, the debug CRT for ARM64 isn't always available, and the release CRT is available only after installing the runtime package. Without this, we will always try to pick the debug CRT even when --buildtype=debugoptimized or release.
2020-07-13add Nvidia HPC SDK compilersMichael Hirsch, Ph.D4-4/+45
2020-06-22arglist: Split the C/C++ specifics parts into a subclass for CLikeDylan Baker1-3/+53
This means that we don't need work arounds for D-like compilers, as the special c-like hanlding wont be used for D compilers.
2020-06-22compilers: Return CompilerArgs from compiler instanceDylan Baker3-5/+25
Since the CompileArgs class already needs to know about the compiler, and we really need at least per-lanaguage if not per-compiler CompilerArgs classes, let's get the CompilerArgs instance from the compiler using a method.
2020-06-22compilers: Split CompilerArgs into a separate moduleDylan Baker4-376/+7
I've also moved this out of the compilers pacakge because we're soon going to need it in linkers, and that creates some serious spagetti
2020-06-22compilers: Add missing annotations to CompilerArgs classDylan Baker1-16/+14
2020-06-22compilers: Use enum for for deupdlication returns in CompilerArgsDylan Baker1-27/+36
2020-06-21compiler: add 'force_align_arg_pointer' function attributeTim-Philipp Müller1-0/+2