aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
AgeCommit message (Collapse)AuthorFilesLines
2022-04-13compilers: fix broken CompCert support for release flagsEli Schwartz1-1/+1
This has been broken ever since the original implementation. Due to a typo, the optimization flag used a zero instead of an uppercase "o", which the compiler then breaks on during argument parsing because it is an invalid argument. Fixes #10267
2022-03-31Merge pull request #9989 from ePirat/epirat-fix-uscore-prefix-detectionJussi Pakkanen2-7/+91
Fix underscore detection
2022-03-31clike: print stderr instead of stdout for debuggingMarvin Scholz1-1/+1
When something goes wrong with running the compiler in _symbols_have_underscore_prefix_searchbin, print stderr instead, as it actually contains helpful output while stdout is usually empty in this case.
2022-03-31visualstudio: do not query underscore define with MSVCMarvin Scholz1-0/+17
MSVC does not has the builtin define to check for the symbol prefix, so do not try to query it at all, to save some time.
2022-03-31clike: add more reliable ways to check underscore prefixMarvin Scholz1-6/+73
Fix #5482
2022-03-30compilers/gnu: use Popen_safe to prevent resource leaksMarvin Scholz1-8/+1
Fixes the following ResourceWarnings: ResourceWarning: subprocess 25556 is still running _warn("subprocess %s is still running" % self.pid, ResourceWarning: Enable tracemalloc to get the object allocation traceback mesonbuild/compilers/mixins/gnu.py:195: ResourceWarning: unclosed file <_io.BufferedReader name=4> return gnulike_default_include_dirs(tuple(self.exelist), self.language).copy() ResourceWarning: Enable tracemalloc to get the object allocation traceback
2022-03-24Debian renamed cython to cython3, support bothXavier Claessens1-1/+1
2022-03-22OptionOverrideProxy: Make it immutable to avoid copiesXavier Claessens10-46/+46
It is always used as an immutable view so there is no point in doing copies. However, mypy insist it must implement the same APIs as Dict[OptionKey, UserOption[Any]] so keep faking it.
2022-03-22compilers: fix mypy warning in Rust detectionDylan Baker1-0/+1
2022-03-16fix detection of language standard library pathsPaolo Bonzini2-20/+10
The code in the C++ and Fortran compilers' language_stdlib_only_link_flags method is broken and cannot possibly have ever worked. Instead of splitting by line, it splits by whitespace and therefore, instead of the last line of the compiler output: programs: =/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin libraries: =/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0 it is only the last field that has its first 11 characters removed. Instead of reinventing the wheel with a new and brittle pattern, reuse get_compiler_dirs. Fixes: 64c267c49 ("compilers: Add default search path stdlib_only_link_flags", 2021-09-25) Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-12remove unused type ignore that mypy 0.940 no longer needsEli Schwartz1-1/+1
And now that it doesn't need it, it errors out when you use it.
2022-03-07treewide: string-quote the first argument to T.castEli Schwartz1-1/+1
Using future annotations, type annotations become strings at runtime and don't impact performance. This is not possible to do with T.cast though, because it is a function argument instead of an annotation. Quote the type argument everywhere in order to have the same effect as future annotations. This also allows linters to better detect in some cases that a given import is typing-only.
2022-03-02compilers/gnu: set level 0 optimization to '-O0'Dylan Baker1-1/+1
GCC with optimization set to 0 does not actually result in no optimizations, which can be annoying when trying to use a debugger like gdb, and finding that your variable has been optimized out. We already do this with clang, so gcc is a bit of an outlier here.
2022-03-01compilers/d: fix mangling of rpath-link in DMD-like compilersEli Schwartz1-1/+1
We didn't consider that it has arguments following it, so the resulting compiler command line ended up with stuff like: -L=-rpath-link -L=-L=/path/to/directory -L=more-args and the directory for rpath-link got eaten up as a regular -L path to the compiler rather than being passed as -Xlinker to the linker. Then the -rpath-link would consume the next -Xlinker argument, end up with the wrong rpath-link (may or may not cause link errors) and then disappear arguments we need. As an example failure mode, if the next argument is -soname this treats the soname text as an input file, which probably does not exist if it was generated in a subdirectory, and also because it can never be successfully built in the first place -- though if it did, it would link to itself which is very wrong.
2022-02-16flake8: fix various whitespace errors with badly aligned codeEli Schwartz4-9/+9
2022-02-16flake8: remove some redundant separatorsEli Schwartz1-1/+1
2022-02-16flake8: fix wrong numbers of blank line separatorsEli Schwartz1-0/+3
2022-02-16flake8: fix typoed whitespace surrounding tokensEli Schwartz1-1/+1
2022-02-06dlang: fix #9250 invalid include flag for root directoryTobias Pankrath1-0/+2
2022-02-02Genericise TI compiler and add MSP430 supportWilliam Toohey5-62/+83
2022-01-27mark regex string as raw string to fix invalid escapesEli Schwartz1-2/+2
2022-01-27flake8: fix indentation styleEli Schwartz1-23/+23
2022-01-26compilers/c_function_attributes: add retainArsen Arsenović1-0/+1
retain is a relatively young attribute which has proven itself useful for working with --gc-sections -z start-stop-gc.
2022-01-15Fix system include arguments for clang-clGatgat1-0/+4
2022-01-10compilers: push the compiler id to a class variableDylan Baker21-74/+79
It really is a per class value, and shouldn't be set per instance. It also allows us to get rid of useless constructors, including those breaking mypy
2022-01-10Merge pull request #9739 from mathstuf/armclang-supportJussi Pakkanen5-1/+59
Armclang support
2022-01-03armltdclang: add support for ARM Ltd.'s `armclang` toolchainBen Boeckel4-1/+48
This is another toolchain also called `armclang`, but it is not a cross compiler like Keil's `armclang`. It is essentially the same as `clang` based on its interface and CMake's support of the toolchain. Use an `armltd` prefix for the compiler ID. Fixes: #7255
2021-12-30fix type annotations for compiler toolchain rpathsEli Schwartz4-4/+4
We pass around a tuple of rpaths, because rpaths *can* be more than one. But all the annotations said it would be a str instead.
2021-12-30Fix mypy 0.930 issuesTristan Partin1-1/+1
Removed errant "type: ignore". Fixed issue with "fetch" call. This issue was the following: Dict::get() and Dict::pop() have the following signature: T.Callable[[_T, _U], _U | None] OR T.Callable[[_T], _U | None] Note how the return type is _U here. When the fetch() function was actually being called, it had the following signature: T.Callable[[_T, T.List[_U]], T.Union[T.List[_U], _U]] This is incompatible with the previous definitions. The solution is simply to move where the default value is introduced if fetch() produces None.
2021-12-16armclang: clarify that this is support for the Keil cross-compilerBen Boeckel3-0/+11
2021-12-08clang-cl: add a translation pass for `-isystem` args to workSahnvour1-0/+14
2021-11-27Fix _calculate_toolset_version for VS2022.Luke Elliott1-0/+2
2021-11-27Add -g for debug builds.Nathanael Gray1-1/+1
2021-11-27Fix more code which appears copied from CcrxCompiler.Nathanael Gray1-4/+6
2021-11-22ldc2: invoke -Oz instead of -OsDenis Feklushkin1-1/+1
2021-11-16Support ancient (<3.4.0) gcc versionsWilliam Toohey1-1/+4
2021-11-15only pass clang LTO arguments when they are neededEli Schwartz1-2/+4
If the LTO threads == 0 clang will default to the same argument we manually pass, which meant we dropped support for admittedly ancient versions of clang that didn't yet add that option. Drop the extraneous argument, and add a specific error condition when too old versions of clang are detected. Fixes #9569
2021-11-14Remove incorrect arguments for C2000 C++ compiler. Add correct form for ↵Nathanael Gray1-12/+13
output and include args.
2021-11-08compilers/java: Add no_warn_args and debug_args methodsDylan Baker1-0/+8
2021-11-01various manual conversion of percent-formatted strings to f-stringsEli Schwartz1-2/+2
2021-10-31Add 64-bit paths to check for unsupported Watcom cl.exe clones.William D. Jones1-1/+4
2021-11-01migrate python 3.5 compatible superclass variable annotations to 3.6Eli Schwartz1-5/+3
As we now require python 3.6, we can declare their types without initializing them.
2021-11-01Revert "known Python 3.5 on windows workaround for subprocess(cwd=str(Path))"Eli Schwartz1-2/+1
This reverts commit c89aa2094170b2ffd7151187c1c092db2a178f44. We no longer support 3.5 so this can go.
2021-10-29Remove duplicated CEXE_MAPPING tableXavier Claessens1-5/+0
2021-10-27fix various flake8 whitespace errorsEli Schwartz9-22/+22
2021-10-25Add sccache support.Jussi Pakkanen1-2/+7
2021-10-24Add stdc++20 support for Visual Studio 2019 v16.11Moroz Oleg1-0/+4
fix #9242
2021-10-21compilers/rust: fix typo in standard descriptionDylan Baker1-1/+1
2021-10-21compilers/rust: add support for the 2021 editionDylan Baker1-1/+1
2021-10-14cuda: Override std=none to avoid host_compiler to emit -std argumentXavier Claessens1-6/+3