summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/mixins
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #7581 from peterh/aixJussi Pakkanen2020-08-251-1/+1
|\ | | | | Add AIX support
| * find_library: include get_linker_always_args in link argsPeter Harris2020-08-171-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.
* | clike: optimize to_nativePaolo Bonzini2020-08-181-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.
* Make meson recognize the Qualcomm LLVM toolchainAntony Chan2020-08-021-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 ... ```
* compilers: Cache gnu-mixins has_arguments() checksNirbheek Chauhan2020-07-231-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.
* visualstudio: warning_level 0 should not map to /W1Xavier Claessens2020-07-221-1/+1
| | | | In every other compilers level 0 maps to no argument at all.
* Fix native builds on Windows ARM64 machinesNirbheek Chauhan2020-07-132-5/+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.
* arglist: Split the C/C++ specifics parts into a subclass for CLikeDylan Baker2020-06-221-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.
* compilers: Return CompilerArgs from compiler instanceDylan Baker2020-06-221-1/+17
| | | | | | | 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.
* compilers: Split CompilerArgs into a separate moduleDylan Baker2020-06-221-3/+4
| | | | | 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
* Merge pull request #7256 from peterh/openmpJussi Pakkanen2020-06-071-0/+3
|\ | | | | Fix OpenMP on Visual Studio
| * msvc: Avoid spurious openmp link warningsPeter Harris2020-06-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | The linker that comes with MSVC does not understand the /openmp flag. This results in a string of LINK : warning LNK4044: unrecognized option '/openmp'; ignored warnings, one for each static_library linked with an executable. Avoid this by only setting the linker openmp flag when the compiler is not MSVC.
* | Remove warnings from sample code. Closes #7248.newlinesJussi Pakkanen2020-06-071-1/+1
| |
* | End test code with a newline. Closes #7247.Jussi Pakkanen2020-06-071-2/+2
|/
* Ignore file access errors when scanning .so files in system libdirsMike Gilbert2020-06-021-9/+18
| | | | Bug: https://bugs.gentoo.org/726524
* add type anno: compilers/clikeMichael Hirsch, Ph.D2020-05-271-15/+15
|
* Modifed buildtypes and armclang compiler flags to match documented resultsDrew Reed2020-05-221-6/+6
|
* Allow building with b_coverage set to true when clang is being used ↔georgev932020-05-221-0/+3
| | | | regardless of linker selection.
* compilers: add fetching of define list for clangYevhenii Kolesnikov2020-05-221-1/+8
| | | | | | | | | | | | | | | 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>
* compilers: Move b_ndebug into the compiler classesDylan Baker2020-05-201-0/+3
| | | | | | | Right now we hardcode -DNDEBUG as the value to be added for b_ndebug. Which is a not the correct behavior for non C/C++ languages. By pushing this back into the compiler classes we can change this for other languages.
* Merge pull request #7103 from dankegel/bug4027-rpath-rememberJussi Pakkanen2020-05-181-2/+2
|\ | | | | Let .pc files and LDFLAGS provide rpaths.
| * Let .pc files specify rpath.Dan Kegel2020-05-161-2/+2
| | | | | | | | Fixes #4027
* | Add flags to support generation of dependency files with armclangDrew Reed2020-05-161-1/+1
| |
* | Modifed buildtypes and armcc compiler flags to match documented resultsDrew Reed2020-05-161-7/+7
| |
* | Fix outdated cross-compilation checksOle André Vadla RavnÄs2020-05-131-2/+3
| |
* | Fix has_function() for clang on 64bit WindowsChristoph Reiter2020-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | has_function() tries to link an example program using the function to see if it is available, but with clang on 64bit Windows this example always already failed at the compile step: error: cast from pointer to smaller type 'long' loses information long b = (long) a; This is due to long!=pointer with LLP64 Change from "long" to "long long" which is min 64bit and should always fit a pointer. While "long long" is strictly a C99 feature every non super ancient compiler should still support it.
* | Fix builtin check in has_function() with GCC 10 on WindowsChristoph Reiter2020-05-111-11/+16
|/ | | | | | | | | | | | | | | The builtin check had a special case that if a header was provided and the function wasn't defined, it would ignore the builtin to avoid non-functional builtins (for example __builtin_posix_memalign in MSYS2). GCC 10 gained support for __has_builtin() which now skipps this check and because __has_builtin(__builtin_posix_memalign) returns true the non functional builtin is now reported as available. To get the old behaviour back move the special case in front of the actual availability check. Fixes #7113
* compilers: fix type issueAndrew Udvare2020-04-231-1/+1
| | | | | mesonlib.darwin_get_object_archs() only accepts a string argument so convert it.
* compilers: Silence warning about gnu_inline with clangNirbheek Chauhan2020-04-203-3/+18
| | | | | | | | | | 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`.
* compilers: Honor <lang>_ld when linking C-like outputsOle André Vadla RavnÄs2020-04-171-0/+4
|
* compilers: Move things out of clikeDylan Baker2020-04-102-6/+3
| | | | | One method belongs in the base Compiler class, the other belongs in the GnuLikeCompiler class.
* compilers: disable b_sanitize on hurdPino Toscano2020-04-101-1/+3
| | | | ASAN is not supported on the Hurd yet.
* quality / test: Fortran type hintingMichael Hirsch, Ph.D2020-04-051-4/+6
| | | | enhance fortran args tests
* Make cc.has_function work on GCC/Clang __builtinsAndrei Alexeyev2020-04-041-5/+6
|
* compilers: Clang can take linkers that are pathsDylan Baker2020-03-241-0/+14
| | | | | This will be a regression in 0.54.0 because we now enforce that gnu compilers only get gold, bfd, or lld.
* Fix legacy env var support with crossJohn Ericson2020-03-231-12/+0
| | | | Fix #3969
* Fix ARMCC dependency generation.Szabi Tolnai2020-03-231-1/+1
| | | | Change-Id: I661684ee8adf5a998641369cf5f13641699742d5
* -Add xc16 and c2000 C,Cpp toolchain supportalanNz2020-03-212-0/+243
|
* Merge pull request #6789 from dcbaker/deprecated-c-ldJussi Pakkanen2020-03-192-4/+4
|\ | | | | Make linker selection environment variables match docs
| * compilers: Error if invalid linker selectedDylan Baker2020-03-172-4/+4
| |
* | Fix exe_wrapper usage in EmptyExternalProgram caseRichard Weinberger2020-03-191-1/+1
|/ | | | | | | | | | | | | | | | | | If no exe_wrapper is set in the meson cross file the exe_wrapper object will be an instance of EmptyExternalProgram. So, found is True and prorgram is an empty list. This will cause meson to tun the compiler sanity check because it checks only for self.is_cross and self.exe_wrapper being not None. I ran into that situation while cross compiling for ia32 on a x64_64 host. The host had no ia32 userspace installed, so the self test failed. As workaround I currently set exe_wrapper to 'true'. Signed-off-by: Richard Weinberger <richard@nod.at>
* Resolve Clang failure to use -Og with --optimization=gPhillip Johnston2020-03-151-2/+9
| | | | | | | | 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
* Merge pull request #6356 from dcbaker/fix-d-compiler-abstractionsJussi Pakkanen2020-03-121-4/+0
|\ | | | | Fix d compiler abstractions
| * linkers: Move import_library_args to from VS compiler to linkerDylan Baker2020-03-091-4/+0
| | | | | | | | | | | | | | This is the argument to name the implib when using the Visual Studio Linker. This is needed by LDC and DMD when using link.exe or lld-link.exe on windows, and is really a linker argument not a compiler argument.
* | compilers/linkers: Add a representation for wasm-ldDylan Baker2020-02-271-20/+0
| | | | | | | | | | | | | | Emscripten does have a stand alone linker, wasm-ld. This patch adds the linker, adds detection for the linker, and removes the IsLinkerMixin for emscripten. This is a little more correct, and makes the code a lot cleaner and more robust.
* | compilers/mixins/emscripten: Implement thread supportDylan Baker2020-02-271-0/+26
| | | | | | | | | | | | | | | | | | | | | | Emscripten has pthread support (as well as C++ threads), but we don't currently implement them. This fixes that by adding the necessary code. The one thing I'm not sure about is setting the pool size. The docs suggest that you really want to do this to ensure that your code works correctly, but the number should really be configurable, not sure how to set that. Fixes #6684
* | compilers/mixins/islinker: Add stubs for thread_*_flagsDylan Baker2020-02-271-0/+6
| |
* | compilers/emcc: Fix inheritance orderDylan Baker2020-02-271-0/+1
| | | | | | | | | | | | Sot hat the BasicLinkerIsCompilerMixin comes before ClangCCompiler, which hides its "call the linker" methods, as emcc doesn't have a separate linker.
* | compilers/mixins/islinker: Add missing methodDylan Baker2020-02-271-0/+3
|/ | | | In particular emcc needs this
* -Fixed Renesas RX Family compiler to work with latest meson, updated ↔alanNz2020-01-302-2/+8
| | | | cross-file, fixed assembly file use