Commit Graph

1079 Commits

Author SHA1 Message Date
Antonin Décimo 39ede12aa5 Fix misspells
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-13 12:53:10 -05:00
Dylan Baker 4b0b44afac move handling of CFLAGS and friends to environment
This has a bunch of nice features. It obviously centralizes everything,
which is nice. It also means that env is only re-read at `meson --wipe`,
not `meson --reconfigure`. And it's going to allow more cleanups.
2021-01-11 11:15:06 -08:00
Dylan Baker f202da0689 use PEP8 style naming for LANGUAGES_USING_* as well 2021-01-11 11:15:06 -08:00
Dylan Baker 4580433b82 rename cflags_mapping to CFLAGS_MAPPING
This is PEP8 convention for a const variable. Also, make the type
Mapping, which doesn't have mutation methods. This means mypy will warn
us if someone tries to change this.
2021-01-11 11:15:06 -08:00
Dylan Baker e81acbd606 Use a single coredata dictionary for options
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
2021-01-04 12:20:58 -08:00
Dylan Baker 71db6b04a3 use OptionKey for builtin and base options
I would have prefered to do these seperatately, but they are combined in
some cases, so it was much easier to convert them together.

this eliminates the builtins_per_machine dict, as it's duplicated with
the OptionKey's machine parameter.
2021-01-04 12:20:40 -08:00
Dylan Baker f9b19e73a5 move OptionKey to mesonlib
There's starting to be a lot of things including coredata that coredata
needs to itself include. putting it in mesonlib makes more sense
2021-01-04 12:20:40 -08:00
Dylan Baker fe973d9fc4 use OptionKey for compiler_options 2021-01-04 12:20:39 -08:00
Dylan Baker bdca05e2e6 Add choices to OptionProxy
they're probably not strictly needed, but it makes mypy happy.
2021-01-04 12:15:41 -08:00
Remi Thebault 7a9a9e4a99
Implement support of dlang -makedeps switch (#8119)
* Implement support of dlang -makedeps switch

Fix #8118

* resolve code review comments
2020-12-29 09:56:35 -08:00
Laurin-Luis Lehning 4164efceca Propagate Windows target checks up 2020-12-14 11:23:53 -08:00
Laurin-Luis Lehning 919278e3e1 Give get_gui_app_args access to the Environment 2020-12-14 11:23:53 -08:00
Laurin-Luis Lehning 4053babf9c Slight consistency changes to get_gui_app_args 2020-12-14 11:23:53 -08:00
Laurin-Luis Lehning 9de09e9aa6 Give get_win_subsystem_args access to env 2020-12-14 11:23:53 -08:00
Laurin-Luis Lehning 2fb4d1f751 Make win_subsystem a linker property 2020-12-14 11:23:53 -08:00
Jussi Pakkanen 9f1ba40252
Merge pull request #8013 from mesonbuild/cppmodules
C++ module support
2020-12-14 15:00:04 +00:00
Laurin-Luis Lehning bab1087422
Add support for driving lld-link indirectly through clang on Windows 2020-12-13 16:34:50 +02:00
Jussi Pakkanen 5bd1276d20 Create unit test for C++ modules and accept ixx as C++ source extension. 2020-12-11 19:21:02 +00:00
Florian Schmaus a7aba905a0 compilers: add support for c++20/gnu++20
Fixes #8084.
2020-12-10 00:30:48 +02:00
Jussi Pakkanen c21b04ba08 Add prelinking support for static libraries. 2020-12-03 22:58:07 +02:00
Dylan Baker 8915538c31 compilers/fortran: Add "none" to intel compielrs for standards
Fixes #8023
2020-11-24 23:11:23 -05:00
Christoph Reiter abc7e6af01 Add a variant of TemporaryDirectory that uses windows_proof_rmtree()
Adds TemporaryDirectoryWinProof which calls windows_proof_rmtree() on
error.

Use instead of hacky error handling (which might shadow other OSError)
in Compiler.compile().
2020-11-23 09:26:41 -08:00
Dylan Baker f6672c7a19 use real pathlib module
We added the _pathlib module to work around defeciencies in python 3.5's
implementation, since we now rely on 3.6 lets drop this
2020-11-20 15:08:40 -08:00
Jussi Pakkanen c8af3c8d29 Revert "Add thinlto support. Closes #7493."
This reverts commit 3e6fbde94c.
2020-11-17 17:51:23 +02:00
Jussi Pakkanen 299a67781e
Merge pull request #7843 from dcbaker/submit/rustc-fixes
A few fixups for rust
2020-11-14 13:47:39 +02:00
jpark37 2748c9fb3d msvc: enable /std:c17 flag
Increase allowed c_std options, and check compiler version.

Also update mlog pattern to not crash.
2020-11-13 16:13:02 -08:00
Dylan Baker 5afd608a75 compilers/rust: add and use an implementation of use_linker_args 2020-11-13 09:00:35 -08:00
Jussi Pakkanen 91876b4031
Merge pull request #7866 from dcbaker/submit/compiler-std-in-base
Put the Compiler standard option in the Language mixin
2020-11-13 17:49:52 +02:00
Dylan Baker f31acbe2a4 clang-cl: Allow clang-cl (when compiling C) to pass std to underlying clang)
This allows a wider array of standard support than would be available
directly from clang-cl, emulating MSVC stds.
2020-11-12 12:52:27 -08:00
Dylan Baker 0217faf13f compilers/c: Log that MSVC doesn't support gnu stds
Since the current approach of demoting to the nearest C standard *might*
work, but might not. For projects like Glib that detect which standard
is used and fall back this is fine. For projects like libdrm that only
work with gnu standards, this wont. We're nog tusing a warning because
this shouldn't be fatal if --meson-fatal-warnings is used. Also demote a
similar message in IntelCl from warning to log.
2020-11-12 10:06:11 -08:00
Dylan Baker 2844afedde compilers: define standards in the base language compiler
And then update the choices in each leaf class. This way we don't end up
with another case where we implicitly allow an invalid standard to be
set on a compiler that doesn't have a 'std' setting currently.
2020-11-12 10:03:15 -08:00
Dylan Baker a28a34c684 compilers: Standardize the names of compiler options
Most options don't use language prefaced options (std vs c_std)
internally, as we don't need that due to namespacing. Let's do that
across the board
2020-11-12 10:03:14 -08:00
Dylan Baker 3e62307f3a compilers/c: Clang-cl also needs specific handling for standards 2020-11-12 10:03:14 -08:00
Jussi Pakkanen 333e0aeef4 Make MSVC accept gnu11 as a language standard version. Closes: #7611.
Fixes: #7611
2020-11-12 10:03:14 -08:00
Dylan Baker ce46070b4e compilers/rust: Add color output
Rust has color output, although it's help doesn't document it. It uses
the same values as cargo (and everything else), auto, never, always.
2020-11-10 12:09:21 -08:00
Dylan Baker e430c01ef5 compilers/rust: Add vs_crt support
As far as I can Tell, rust just handles this for us (it's always worked
with no special arguments from us). However, since we're going to add
support for base options for rust, we need to add the method.
2020-11-10 12:09:03 -08:00
Jussi Pakkanen dffd66e0ff Fix WASM thread count option. Closes #7921. 2020-11-09 23:06:52 +02:00
Christoph Reiter 5dd174c60b Fix "generator doesn't stop" on Windows
When TemporaryDirectory() cleans up on __exit__ it sometimes throws
OSError noting that the dir isn't empty. This happens after the
first yield in this generator and leads to the exception being handled
which leads to a second yield.

contextlib.contextmanager() fails then since the function it wraps is only
allowed to yield once.

Fix this by not yielding again in the error case.

Fixes #7947
2020-11-08 19:10:48 +02:00
Jussi Pakkanen 3e6fbde94c Add thinlto support. Closes #7493. 2020-11-08 16:00:05 +02:00
Dylan Baker 7860a6aeab rust: implement support for --edition
Using the std option, so now `rust_std=..` will work. I've chosen to use
"std" even though rust calls these "editions", as meson refers to
language versions as "standards", which makes meson feel more uniform,
and be less surprising.

Fixes: #5100
2020-11-05 21:24:20 +02:00
Xavier Claessens 7902d2032d Refactor handling of machine file options
It is much easier to not try to parse options into complicated
structures until we actually collected all options: machine files,
command line, project()'s default_options, environment.
2020-10-16 17:42:24 -04:00
Carlos Bederian c3b3dc598e compilers/cuda: Use format_map(mapping) instead of format(**mapping) 2020-10-16 18:18:46 +02:00
Carlos Bederian f09457a1e8 compilers/cuda: Fix has_header_symbol check 2020-10-16 18:18:46 +02:00
Peter Harris 8b8a610ea4 vs: add static_from_buildtype to b_vscrt 2020-10-14 19:35:28 +03:00
Jussi Pakkanen 1a0603835e Add win_subsystem kwarg. Closes #7765. 2020-10-07 18:55:25 +03:00
Vinson Lee 5d7069664b compilers: Enable C++20 for Intel C++ Compiler.
Intel C++ Compiler 19.1 has C++20 features.

https://software.intel.com/content/www/us/en/develop/articles/intel-c-compiler-191-for-linux-release-notes-for-intel-parallel-studio-xe-2020.html

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2020-10-06 22:11:34 +03:00
Daniel Mensinger 1dfaccfd91 pathlib: Fix resolve() by overriding it in Python 3.5 2020-10-04 10:45:48 +02:00
Dylan Baker 2fe400c350 compilers/icl fix IntelClCPP argument checking
Unlike MSVC and ClangCl it needs to call into it's own compiler check
args
2020-10-01 15:06:10 -07:00
Dylan Baker f9316fbb46 compilers/icl: Fix pch usage 2020-10-01 15:06:10 -07:00
Dylan Baker b309f4904b compilers/fortran: make ifort on windows signature match ICL's 2020-10-01 15:06:10 -07:00
Dylan Baker ff51e1c5aa compilers/clike: Store exe_wrapper as ExternalProgram
Which is what other languages do.
2020-10-01 15:06:10 -07:00
Dylan Baker 135f5d5838 compilers: make get_optimization_args abstract 2020-10-01 15:06:10 -07:00
Dylan Baker 577a2de7e8 compilers/fortran: fix has_multi_*_arguments
The implementation of the link variant was what should have been the
compiler variant, and there was no valid compiler variant, which meant
it was getting C code.
2020-10-01 15:06:10 -07:00
Dylan Baker 6a9761a2c0 compilers/d: add type annotations 2020-10-01 15:06:10 -07:00
Dylan Baker 6eb981e0c0 compilers/gnu: Don't pretend to inherit CLike
We don't need it anymore, and it would be problematic for the D
compilers.
2020-10-01 15:05:01 -07:00
Dylan Baker 738e343860 compilers: move _build_wrapper out of clike into Compiler
This abstraction is really useful, and most compilers could use it
(including D). It also will allow the Gnu mixins to work properly
without the CLikeCompiler in their mro.
2020-10-01 15:05:01 -07:00
Dylan Baker cd59ce98dc compilers: clang: use get_compiler_check_args 2020-10-01 15:05:01 -07:00
Dylan Baker 1c20f187e8 compilers/intel: use get_compiler_check_args
Instead of trying to override the compiles() method, which gets skipped
in a bunch of cases.
2020-10-01 15:05:01 -07:00
Dylan Baker 8291e947f5 compilers: move get_compile_check_args() to Compiler
This is groundwork to put _build_wrapper in the base Compiler, which is
needed to make the D compilers truly type safe.
2020-10-01 15:05:01 -07:00
Dylan Baker e039727e63 compilers/fortran: add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker 3fc37fc13e compilers/java: Add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker 4430269d4e compilers/rust: add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker e437bdd0a9 compilers/swift: Add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker efceec9615 Compilers/vala: Add type annotations 2020-10-01 15:05:00 -07:00
Dylan Baker d3a059b55f compilers/cuda: make type safe 2020-10-01 15:05:00 -07:00
Dylan Baker 224a752489 compilres: move depfile_for_object to compiler 2020-10-01 15:05:00 -07:00
Dylan Baker 413f4d87e9 compilers/cs: Add type annotations 2020-10-01 15:05:00 -07:00
Dylan Baker e7f0890cb9 compilers: move get_dependency_gen_args to base Compiler
So that every subclass doesn't have to reimplement it. Especially since
the Gnu implementation moved out of the CCompiler and into the
GnuLikeCompiler mixin
2020-10-01 15:05:00 -07:00
Dylan Baker 1513aa437d compilers: move split_shlib_to_parts to the base compiler
Only the GnuLikeCompiler overrides this, and it's implemented multiple
places
2020-10-01 15:05:00 -07:00
Dylan Baker fe97977b00 compilers/cpp: Add type annotations 2020-10-01 15:05:00 -07:00
Dylan Baker 96a1ae6dfe compilers: fully type annotate the C compilers 2020-10-01 15:05:00 -07:00
Ian Harvey 3afe18228a compilers: Use /Od for no-optimisation flag for Intel compilers on windows
Intel compilers on Windows (and the Microsoft C++ compiler) use /Od to disable optimisation, not /O0.
2020-09-30 12:01:50 -07:00
Vili Väinölä d1638a4fde compilers/VS: fix build to use optimization and debug flags
- Fixed using debug and optimization built-in options in MSVC.
- Fixed that VS backend does not create pdb files in release mode.
VS implicitly adds the debug fields if left out.
- Fix that it is possible to add debug info with ninja backend with
optimizations.
2020-09-29 19:25:50 +03:00
Dylan Baker da4c1945fc compilers/objcpp: add type annotations 2020-09-24 12:14:13 -07:00
Dylan Baker 05df8320db compilers/objc: Add type annotations 2020-09-24 12:14:13 -07:00
Dylan Baker 682d22129c compilers: Tell mypy that the compiler mixins are just that
We do this by making the mixins inherit the Compiler class only when
mypy is examining the code (using some clever inheritance shenanigans).
This caught a bunch of issues, and also lets us delete a ton of code.
2020-09-24 12:14:13 -07:00
Dylan Baker 2c0fbe161d compilers: make is_cross part of the base Compiler class
Every class needs to set this, so it should be part of the base. For
classes that require is_cross, the positional argument remains in their
signature. For those that don't, they just allow the base class to set
their value to it's default of False.
2020-09-24 12:14:13 -07:00
Dylan Baker 1592b7a800 compilers: make sanity_check_impl a protected method
It's an implementation detail after all
2020-09-24 12:14:13 -07:00
Dylan Baker 98416e7f75 compilers: put name_string method in base compiler
Every language had the exact same implementation
2020-09-24 12:14:13 -07:00
Dylan Baker fa1398f86c compilers/mixins: make xc16 type safe 2020-09-24 12:14:13 -07:00
Dylan Baker 4911e8eef4 compilers/mixins: make visual studio type safe 2020-09-24 12:14:13 -07:00
Dylan Baker b6c8b8a5be compilers/mixins/pgi: Make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker 6dc774f1b6 compilers/mixins/islinker: Make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker 8ee1e6b768 compilers/mixins/intel: make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker a0a8ef567e compilers/mixins/intel: Use the has_func_attribute_extra_args function
Instead of putting that extra argument in the base compiles() class
2020-09-24 12:14:13 -07:00
Dylan Baker 1e93d2875e compilers/mixins/emscripten: make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker 04a98baafb compilers/mixins/elbrus: make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker bc532a8543 compilers/mixins: make compcert type safe 2020-09-24 12:14:13 -07:00
Dylan Baker 48a181866f compilers/mixins/clang: Make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker 4b52184dc6 compilers/mixings/gnu: make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker bb3fe3c451 compilers/mixins/clike: fix mypy issues 2020-09-24 12:14:13 -07:00
Dylan Baker 4cfddd1fe6 compilers/mixins/ccrx: make mypy safe 2020-09-24 12:14:13 -07:00
Dylan Baker c93395bfc7 compilers/mixins/c2000: Make mypy safe 2020-09-24 12:14:13 -07:00
Dylan Baker b7db3660a0 compilers/mixins/arm: make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker 79d1ecd5bc compilers/compilers: Fully type annotate 2020-09-24 12:14:13 -07:00
Dylan Baker d326c87fe2 compilers: Use a distinct type for compile/link results
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-24 12:14:13 -07:00
Sebastian Meyer 35a5a69355 Some fixes for CompCert
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-18 08:59:39 -07:00
Martin Storsjö deb1d7caba Canonicalize target architectures aarch64/armv* into arm64/arm for MSVC tools
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-17 11:23:36 +00:00
Dylan Baker 4401668c9a linkers/compilers: Move an emscripten method to the compiler
This needed an attribute the linker doesn't have.
2020-09-16 20:28:56 -07:00
Sebastian Meyer a24fde6fde
Add support for the CompCert C Compiler
* 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-15 21:51:21 +03:00
Xavier Claessens 9d338200da external-project: New module to build configure/make projects
This adds an experimental meson module to build projects with other
build systems.

Closes: #4316
2020-09-13 13:54:47 -04:00
Daniel Mensinger 47373a2438
typing: get rid of most T.cast 2020-09-08 20:15:58 +02:00
Daniel Mensinger 3dbfe8f75a
typing: fully annotate arglist 2020-09-08 20:15:57 +02:00
James Hilliard 646ae846be backends: check external rpaths for all languages using ldflags
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-09-06 21:07:14 +03:00
Pierrick Bouvier 1900720353 D: fix include order
Commit 93c3ec7e introduced a new way to handle deduplication with
compiler args. This resulted in D includes to be reversed.
2020-08-30 18:56:24 +03:00
Nirbheek Chauhan 6f74692ae0 Fix typo when fetching buildtype option for compiler checks
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-27 00:13:58 +00:00
Jussi Pakkanen 3a25efc056
Merge pull request #7581 from peterh/aix
Add AIX support
2020-08-25 23:58:17 +03:00
Jussi Pakkanen fc13c90de3
Merge pull request #7600 from alexrp/master
Add C2x option support.
2020-08-23 00:26:44 +03:00
Jussi Pakkanen a9f33d96c6
Merge pull request #7609 from dcbaker/submit/2020-08/cmake-fix-apple-clang
Fix mapping of apple compilers in cmake
2020-08-22 22:40:44 +03:00
Dylan Baker b6c28d282c compilers: Add Apple subclasses for ObjC and ObjC++
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-22 10:49:35 -07:00
Alex Rønne Petersen 450155110c Add C2x option support. 2020-08-22 18:57:05 +02:00
Jussi Pakkanen e9a71ebf60
Merge pull request #7607 from bonzini/speedup
Various speedups from profiling QEMU's meson.build
2020-08-22 18:40:03 +03:00
Jussi Pakkanen c42298e146
Merge pull request #7447 from scivision/nvc
Add support for NVidia HPC SDK compilers
2020-08-22 18:31:56 +03:00
makise-homura 1f2150fe49 Correctly determine C++ stds for Elbrus compiler 2020-08-20 23:49:18 +03:00
Paolo Bonzini 847bb43470 clike: optimize to_native
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-18 08:11:25 +02:00
Peter Harris 7b0c1e2349 find_library: include get_linker_always_args in link args
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-17 21:21:33 -04:00
Michael Hirsch f2890cbf97 msvc: enable /std:c11 flag 2020-08-09 11:48:41 -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
Nirbheek Chauhan 6e7d548b11 compilers: Cache gnu-mixins has_arguments() checks
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-23 07:39:59 +00:00
Xavier Claessens 6bf61b2a38 visualstudio: warning_level 0 should not map to /W1
In every other compilers level 0 maps to no argument at all.
2020-07-22 15:54:13 -04:00
Elliot Haisley 063b74ebba fix msvc not recognising b_ndebug
fixes #7404
2020-07-19 15:26:30 +03:00
Nirbheek Chauhan 21da2c9040 Fix native builds on Windows ARM64 machines
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-13 15:28:38 +00:00
Michael Hirsch, Ph.D f985bb7383
add Nvidia HPC SDK compilers 2020-07-13 00:16:52 -04:00
Dylan Baker 4f6bd29ac9 arglist: Split the C/C++ specifics parts into a subclass for CLike
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-22 12:06:10 -07:00
Dylan Baker 93c3ec7e2d compilers: Return CompilerArgs from compiler instance
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-22 12:06:10 -07:00
Dylan Baker 9d0ad66c29 compilers: Split CompilerArgs into a separate module
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-22 12:06:10 -07:00
Dylan Baker 386721f7fd compilers: Add missing annotations to CompilerArgs class 2020-06-22 12:06:10 -07:00
Dylan Baker b887212bee compilers: Use enum for for deupdlication returns in CompilerArgs 2020-06-22 12:06:10 -07:00
Tim-Philipp Müller 246e5437aa compiler: add 'force_align_arg_pointer' function attribute 2020-06-21 23:34:11 +03:00
Nirbheek Chauhan 47c477711b apple: -headerpad args are ignored when bitcode is enabled
Causes spammy warnings from the linker:

ld: warning: -headerpad_max_install_names is ignored when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
2020-06-11 07:10:43 +00:00
Marcel Hollerbach 18b99b3bc3 compilers: corretify deduplication direction
so: when building compile args, meson is deduplicating flags. When a
compiler argument is appended, a later appearance of a dedup'ed is going
to remove a earlier one. If the argument is prepended, the element
*before* the new one is going to be removed. And that is where the
problem reported in https://github.com/mesonbuild/meson/pull/7119 is
coming in. In the revision linked there, the order of replacement in the
prepend case was revesered.

With this patch, we restore this behaviour again.
2020-06-11 01:42:59 +03:00
Seungha Yang 8edbb2859c compilers: Add UNIX large file support for MinGW
MinGW gcc supports _FILE_OFFSET_BITS=64 and we need to set it for
MinGW as well
2020-06-09 12:49:11 +00:00
Jussi Pakkanen 7e1bef6959
Merge pull request #7119 from marcelhollerbach/master
Performance optimize ninja backend
2020-06-07 22:33:04 +03:00
Jussi Pakkanen 508a0d6073
Merge pull request #7256 from peterh/openmp
Fix OpenMP on Visual Studio
2020-06-07 22:24:40 +03:00
Jussi Pakkanen 86df85d511 Remove warnings from sample code. Closes #7248. 2020-06-07 20:27:18 +03:00
Jussi Pakkanen fd0ad977a6 End test code with a newline. Closes #7247. 2020-06-07 20:20:31 +03:00
Peter Harris 9462f0c7bc msvc: Avoid spurious openmp link warnings
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.
2020-06-06 12:04:28 -04:00
Marcel Hollerbach 032ab3606d CompilerArgs: refactor __iadd__
the previous optimizations from 4524088d38
were not relaly good, and not really scaleable, since only the lookup
was improved. However, the really heavy calls to remove have not been
improved.

With this commit we are refactoring CompilerArgs into a data structure
which does not use remove at all. This works that we are building a pre
and post list, which gets flushed into __container at some point.
However, we build pre and post by deduplicating forward. Later on, when
we are flushing pre and post into __container, we are deduplicating
backwards the list, so we are not changing behaviour here.

This overall cuts off 10s of the efl configuration time. Further more
this improves configure times on arm devices a lot more, since remove
does seem to be a lot slower there. In general this results in the fact
that __iadd__ is not within the top 5 of costly functions in
generate_single_complie.
2020-06-05 09:21:23 +02:00
Marcel Hollerbach ba8e838dcf Revert "CompilerArgs: make lookup faster"
This was a not so nice solution, and should be replaced with something
better.

This reverts commit 4524088d38.
2020-06-05 09:04:04 +02:00
Marcel Hollerbach 256e910dee cache up regex mathings
the names passed in here are often the same. We should ensure that we
cache the regex match, as this will speed up our runtime a lot.
2020-06-05 09:02:23 +02:00
Mike Gilbert 5b3bed525d Ignore file access errors when scanning .so files in system libdirs
Bug: https://bugs.gentoo.org/726524
2020-06-02 20:50:36 +03:00
Michael Hirsch, Ph.D e2c475939e add type anno: compilers/clike 2020-05-27 20:24:21 +03:00
Phillip Johnston bdfd46e579 Recognize Arduino .ino files as C++
Renaming .ino files is not an option when working with the IDE. Meson should recognize it as C++ however.
2020-05-27 20:17:26 +03:00
Drew Reed 9a94ffe061 Modifed buildtypes and armclang compiler flags to match documented results 2020-05-22 18:28:09 +03: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
Dylan Baker 29ef4478df compilers/d: Add b_ndebug support
D lang compilers have an option -release (or similar) which turns off
asserts, contracts, and other runtime type checking. This patch wires
that up to the b_ndebug flag.

Fixes #7082
2020-05-20 14:20:26 -07:00
Dylan Baker d04e2c2f1f compilers: Move b_ndebug into the compiler classes
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.
2020-05-20 14:20:26 -07:00
Jussi Pakkanen 751ea3df72
Merge pull request #7103 from dankegel/bug4027-rpath-remember
Let .pc files and LDFLAGS provide rpaths.
2020-05-18 23:17:34 +03:00
Dylan Baker 6fe68edbf8 compilers/d: Enable pgo for GDC 2020-05-18 19:29:18 +03:00
Dan Kegel d7235c5905 Let .pc files specify rpath.
Fixes #4027
2020-05-16 20:25:58 +00:00
Drew Reed 3d41fa9b1e Add flags to support generation of dependency files with armclang 2020-05-16 16:37:09 +03:00
Drew Reed cce5f860b9 Modifed buildtypes and armcc compiler flags to match documented results 2020-05-16 16:36:47 +03:00
Drew Reed 697bb28084 Call to CPPCompilers initilisation function was missing the info parameter during ArmClangCPPCompiler initialisation 2020-05-16 16:35:32 +03:00
Nirbheek Chauhan 37bade6f87 gfortran: Fix has_header implementation with GCC 10
__has_include is not accepted as a pre-processor directive in Fortran
code since GCC 10.

Closes https://github.com/mesonbuild/meson/issues/7017
2020-05-14 09:31:16 +00:00
Eric Lemanissier ab6a410426 macos: Remove framwork linkerlike args
fixes-up 33fbc548ab
2020-05-13 15:55:07 +00:00
Ole André Vadla Ravnås 859dc4255a Fix outdated cross-compilation checks 2020-05-13 15:51:54 +00:00
Christoph Reiter c4fa0fac3d Fix has_function() for clang on 64bit Windows
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.
2020-05-13 08:16:54 +00:00
Christoph Reiter d7e20b1543 Fix builtin check in has_function() with GCC 10 on Windows
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
2020-05-11 14:53:25 -07:00
Andrew Udvare 39ca178d21 compilers: fix type issue
mesonlib.darwin_get_object_archs() only accepts a string argument so convert
it.
2020-04-23 10:00:27 -07:00
John Ericson 278c294aa4 Compiler options per lang
A current rather untyped storage of options is one of the things that
contributes to the options code being so complex. This takes a small
step in synching down by storing the compiler options in dicts per
language.

Future work might be replacing the langauge strings with an enum, and
defaultdict with a custom struct, just like `PerMachine` and
`MachineChoice`.
2020-04-20 23:23:15 +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
Ole André Vadla Ravnås c0a8abc580 compilers: Honor <lang>_ld when linking C-like outputs 2020-04-17 18:23:40 +03:00
Dylan Baker 66bc485646 compilers: Update gnu_inline test to work correctly with Clang >= 10
Which has changed the way it handles gnu_inline in C++.
2020-04-17 18:18:20 +03:00
Dylan Baker fe3f7676e9 compilers/d: Add missing method for dmd and ldc
This allows coverage to be generated, although we can't yet do anything
useful with it.
2020-04-10 12:46:55 -07:00
Dylan Baker 0f8d73848a compilers/d: Implement coverage for GDC
Since GDC a GNU compiler, we just need to pass the normal GNU options
and coverage is generated.

Related: ##5669
2020-04-10 12:35:25 -07:00
Dylan Baker b5e077fce8 compilers: Move things out of clike
One method belongs in the base Compiler class, the other belongs in
the GnuLikeCompiler class.
2020-04-10 12:33:34 -07:00
Pino Toscano a33f20b9a4 compilers: disable b_sanitize on hurd
ASAN is not supported on the Hurd yet.
2020-04-10 11:29:35 -07:00
Michael Hirsch, Ph.D 5b4ebb5641 quality / test: Fortran type hinting
enhance fortran args tests
2020-04-05 13:43:53 +03:00
Andrei Alexeyev 96ed64caa1 Make cc.has_function work on GCC/Clang __builtins 2020-04-04 20:51:35 +03:00
Loïc Yhuel b9b118b267 compilers: disable ccache when using temporary source files
When doing a compile test with a testfile.c, ccache fails since the path is random.
So it's better to disable it, to avoid reporting this as a cache miss.
2020-03-29 21:15:08 +03:00
Ole André Vadla Ravnås 7195c0ee9c compilers: Fix accidental coredata mutations 2020-03-29 20:55:35 +03:00
Ole André Vadla Ravnås d8094d26f3 compilers: Fix C++ stdlib flags used for Apple's Clang
Should target libc++, not libstdc++.
2020-03-29 20:53:15 +03:00
Jussi Pakkanen 4bfc143c5e Only split linker args with D compilers. Closes: #6845 2020-03-28 18:37:42 +02: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
John Ericson 3a4388e51d Fix legacy env var support with cross
Fix #3969
2020-03-23 17:51:36 +02:00
John Ericson f6b0425576 Fix linker evn var tests
Just because we are on windows doesn't mean we can use `link`.

This ought to be done better, but this will do for now.
2020-03-23 17:14:00 +02:00
Szabi Tolnai e2b4e99d71 Fix ARMCC dependency generation.
Change-Id: I661684ee8adf5a998641369cf5f13641699742d5
2020-03-23 17:13:10 +02:00
alanNz 7460292810 -Add xc16 and c2000 C,Cpp toolchain support 2020-03-21 00:47:24 +02:00
Jussi Pakkanen 321774d715
Merge pull request #6789 from dcbaker/deprecated-c-ld
Make linker selection environment variables match docs
2020-03-19 19:19:29 +02:00
Richard Weinberger 12fa8d06e2 Fix exe_wrapper usage in EmptyExternalProgram case
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>
2020-03-19 19:09:18 +02:00
Dylan Baker e1060f5772 compilers: Link D runtime/libphobs dynamically on !Windows
Fixes: #6786
2020-03-19 19:04:43 +02:00
Dylan Baker b8294b4436 compilers: Error if invalid linker selected 2020-03-17 10:40:39 -07:00
Jussi Pakkanen c557205695
Merge pull request #6779 from dcbaker/gdc-linker-args
Allow setting linker for GDC as well as LDC
2020-03-15 22:33:12 +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
Dylan Baker 9c9dcbb1a8 compilers/d: Support linker selection with gdc
This should have worked before, but the inheritance order was backwards,
so we got the DCompiler before the GnuCompiler, and the base Compiler
methods overrode the Gnu methods.
2020-03-12 13:21:04 -07:00
Jussi Pakkanen 88e40c7081
Merge pull request #6356 from dcbaker/fix-d-compiler-abstractions
Fix d compiler abstractions
2020-03-12 00:57:52 +02:00
Dylan Baker d0172432a7 compilers: Don't put split soname args in start groups
Some compilers that act as linker drivers (dmd and ldc) need to split
arguments that GCC combines with , (ie, -Wl,-foo,bar -> -L=-foo -L=bar).
As such we need to detect that the previous argument contained -soname,
and not wrap that in a --start-group/--end-group

This modifies the shared library test to demonstrate the problem, with a
test case.

Fixes #6359
2020-03-11 09:27:10 -07:00
Dylan Baker 92e80d54e5 compilers/d: Properly pass -soname args 2020-03-11 09:27:10 -07:00
Dylan Baker f136084609 compilers/d: Fix rpath generation with LDC and DMD 2020-03-11 09:26:20 -07:00
Dylan Baker 06bbf6cf93 linkers: Move import_library_args to from VS compiler to linker
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.
2020-03-09 16:55:08 -07:00
Dylan Baker fe86c594c6 Allow invoking the linker directly through dmd
DMD is awful in a lot of ways. To change the linker you set an
environment variable, which is pretty much impossible for us.
2020-03-09 16:55:08 -07:00
Dylan Baker 1fe153a3a5 Allow invoking link.exe and lld-link.exe through ldc2
Like it wants
2020-03-09 13:19:03 -07:00
Jussi Pakkanen 5c51d4521a
Merge pull request #6532 from jon-turney/languages-native-kwarg
Add add_languages(native:)
2020-03-09 01:20:57 +02:00
Jussi Pakkanen 44ff3e6c7d
Merge pull request #6736 from dcbaker/mesonlib-type-annotations
Mesonlib type annotations
2020-03-08 14:49:23 +02:00
Jussi Pakkanen 7234316dc7
Merge pull request #6688 from dcbaker/emcc-linker-bugs
Emcc linker bugs and improvments
2020-03-08 14:04:48 +02:00
Dylan Baker ef1c6cdd54 compilers: Don't deduplicate -L= arguments
This breaks LDC and DMD, so just don't do it.
2020-03-06 12:11:26 -08:00
Dylan Baker f404c679cf compilers/d: Fix get_allow_undefined_link_args on macOS
DMD and LDC are a real pain to use as linkers. On Unices they invoke the C
compiler as the linker, just like meson does. This means we have to figure out
what C compiler they're using and try to pass valid arguments to that compiler
if the D compiler doesn't understand the linker arguments we want to pass. In
this case that means gcc or clang. We can use-the -Xcc to pass arguments
directly to the C compiler without dmd/ldc getting involved, so we'll use that.
2020-03-06 12:11:26 -08:00
Dylan Baker c0fd20f164 compilers/d: Remove CompilerIsLInkerMixin
This was never really true of the D compilers, it made them more
complicated than necessary and was incorrect in many cases. Removing it
causes no regressions on Linux, at least in our rather limited test
cases).
2020-03-06 12:11:26 -08:00
Dylan Baker a8293dd59c mesonlib: Replace unholder argument to listify
listify shouldn't be unholdering, it's a function to turn scalar values
into lists, or flatten lists. Having a separate function is clearer,
easier to understand, and can be run recursively if necessary.
2020-03-05 09:31:29 -08:00
Martin Storsjö 58db8d5e11 Set c_winlibs/cpp_winlibs for Clang in the same way as for GCC
clang-cl is handled as a separate case (ClangClCCompiler), which already
gets c_winlibs from VisualStudioLikeCCompilerMixin.
2020-03-03 21:49:42 +02:00
Marcel Hollerbach 9e40a0125c meson: cache the results of can_compile
the check for which files can be compiled are called again and again on
the same files over and over again. Caching this here shaves off 11s of
the build time of efl (which has grown in the last 3 versions to over 40
sec. again)
2020-03-01 19:27:49 +02:00
Marcel Hollerbach 4524088d38 CompilerArgs: make lookup faster
in order to deduplicate arguments as much as possible, we need to check
if a argument is already part of the list. Which is quite slow because
we are checking 3 lists for that.

In smaller projects this might be not of interested. However, in efl
things are quite "heavy", alone generating the ninja file took 40 sec..
16 sec. are spent in __iadd__ of CompilerArgs.

What this patch does to speed this all up is:
1. We only check if a element is in post when we know that it must be in
   post same for pre.
2. the checks for if we already do contain a specific value are now done
   via a dict, and not via the list.

This overall brings the time from 16 sec. spent in __iadd__ to 9 sec. in
__iadd__.

Another possible solution for all this is to have a internal structure
of CompileArgs of trees, so you have the "basic" layer of arguments
where the position does not matter. Additionally, you have two stacks of
lists, the pre stack and the post stack, duplicates can then be checked
when itereting, which would safe another ~4s in terms of efl. However, i
do not have time for this undertaking right now.
2020-03-01 19:27:49 +02:00
Dylan Baker 654f427759 compilers/linkers: Add a representation for wasm-ld
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.
2020-02-27 16:35:02 -08:00
Dylan Baker 771b0d3ffb compilers/mixins/emscripten: Implement thread support
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
2020-02-27 16:35:02 -08:00
Dylan Baker b2f86c461b compilers/mixins/islinker: Add stubs for thread_*_flags 2020-02-27 16:35:02 -08:00
Dylan Baker 64f3174daa compilers/emcc: Fix inheritance order
Sot hat the BasicLinkerIsCompilerMixin comes before ClangCCompiler,
which hides its "call the linker" methods, as emcc doesn't have a
separate linker.
2020-02-27 16:35:02 -08:00
Dylan Baker fa3c25d279 compilers/mixins/islinker: Add missing method
In particular emcc needs this
2020-02-27 16:35:02 -08:00
Jussi Pakkanen 9c604320a0
Merge pull request #6637 from mesonbuild/nirbheek/implement-symbolextractor-windows
Implement symbolextractor on windows + some cleanups/fixes
2020-02-23 20:23:03 +02:00
Nirbheek Chauhan be486a2ec8 ninjabackend: List PDBs in output list for targets
This is more correct, and forces the target(s) to be rebuilt if the
PDB files are missing. Increases the minimum required Ninja to 1.7,
which is available in Ubuntu 16.04 under backports.

We can't do the same for import libraries, because it is impossible
for us to know at configure time whether or not an import library will
be generated for a given DLL.
2020-02-22 06:49:34 +05:30
Jussi Pakkanen 33fbc548ab
Merge pull request #6668 from mesonbuild/nirbheek/strip-more-unused-linkerlike-args
macOS: Remove more unused linkerlike args
2020-02-21 17:03:08 +02:00
Nirbheek Chauhan 36b4dec262 macOS: Remove more unused linkerlike args
`-L` and `-headerpad_max_install_names` are both linker arguments that
are commonly passed in CFLAGS too.

Closes https://github.com/mesonbuild/meson/issues/6294
2020-02-21 05:45:34 +05:30
Dylan Baker cd30216ce4 compilers/compilers: Fix get_linker_id
Which could raise an AttributeError when used on languages like Java and
C# that don't have separate compilers and linkers.
2020-02-21 05:15:25 +05:30
Jon Turney 1464ac6ed5
Improve error reported when language has no compiler
This gives consistent reporting of this error for all platforms.

Also, reporting this error when constructing the BuildTarget, rather
than discovering the problem during backend generation means that the
error is reported against with a location.
2020-02-12 13:33:07 +00:00
alanNz 1682058dec -Fixed Renesas RX Family compiler to work with latest meson, updated cross-file, fixed assembly file use 2020-01-30 22:11:26 +02:00
Dylan Baker 3f8d6af9c2 compilers: Use /Zi instead of /ZI with clang-cl
Clang-cl doesn't support /ZI, so we need to use either /Zi or /Z7, which
both do the same thing for clang-cl (though not for msvc)

Fixes #6414
2020-01-28 10:52:00 -08:00
Dylan Baker 0f47ca95c1 compilers: Split ClangCL and MSVC mixins
Instead of checking the compiler id inside the VisualStudioLikeCompiler
class, this creates two subclasses that each represent the divergent
behavior of the two compilers
2020-01-28 10:52:00 -08:00
makise-homura ee6c2c87fc Bringing back defines in Elbrus C compiler to simplify environment.py 2020-01-27 22:37:21 +03:00
makise-homura c910ad4b8f Fix Sider errors 2020-01-27 22:37:21 +03:00
makise-homura ca1f7726d5 Remove RTTI option from get_option_compile_args() for Elbrus compiler 2020-01-27 22:35:26 +03:00
makise-homura 7870cc0d91 Add missing functions to Elbrus compiler class 2020-01-27 22:35:26 +03:00
makise-homura 7321cc776a Fix missing 'defines' argumet for Elbrus compiler
...But somehow it still remains in C++ compiler.
2020-01-27 22:35:26 +03:00
Nirbheek Chauhan 7672cd99c2 compilers: Derive CompilerArgs from collections instead of typing
Deriving from typing.MutableSequence does not give us a usable
sequence type on Python 3.5.2.
2020-01-24 02:53:34 +05:30
Nirbheek Chauhan d8e738f04f typing: Fix compatibility with Python 3.5.2
Explicitly use the type instead of the string 'NotImplemented' which
still works with Python 3.5.2

Fixes https://github.com/mesonbuild/meson/issues/6427
2020-01-24 02:53:34 +05:30
Daniel Mensinger cb262ab481 types: Fix/ignore flake8 B014/F811 2020-01-08 15:28:17 +01:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Jussi Pakkanen 7ec3af95e5
Updated linker MR (#6407)
* environment: Fix passing always args to a number of less common linkers

These are mostly (oops xilink) proprietary linkers I can't use for
various reasons.

Fixes: #6332

* Add intelfix from scivision.

* Ifort fix from scivision.

* PGI fix from scivision.

* Cuda fix from scivision.

* Fix linker passing for armclang.
2020-01-06 16:49:34 +02:00
Michael Hirsch, Ph.D 5695dc0f16 add compiler.get_linker_id() method
this can be useful for if/elif where linker behaviors must be
considered.

For example, clang with "link" vs gcc with "ld.bfd" etc.

ci for compiler.get_linker_id() method

doc

add @FeatureNew check

Co-Authored-By: Daniel Mensinger <daniel@mensinger-ka.de>
2019-12-19 12:03:55 -05:00
Jussi Pakkanen a2a9611e1d
Merge pull request #6065 from dcbaker/pass-options-to-linker-detection
Pass options to linker detection
2019-12-17 21:09:26 +02:00
Daniel Mensinger eb67fb1d97 default inc dirs: Fix warning on MSYS (fixes #6336) 2019-12-15 13:25:16 +02:00
Michael Hirsch, Ph.D 0b7fe3f78a intel/intel-cl: handle arguments in intel-specific way
intel compiler's defaults are different enough from MSVC and GNU
that it's necessary to set specific defaults for Intel compilers.

This corrects/improves behaviors initially addressed in  b1c8f765fa
2019-12-14 23:35:07 +02:00
Dylan Baker 7f0224fb88 compilers: make use of mlog.log_once
I'm sure there are other places that could use this, but I didn't see
any right off that bat.
2019-12-13 09:57:05 -05:00
Dylan Baker 47dfe34c85 Consider compiler arguments in linker detection logic
If a user passes -fuse-ld=gold to gcc or clang, they expect that they'll
get ld.gold, not whatever the default is. Meson currently doesn't do
that, because it doesn't pass these arguments to the linker detection
logic. This patch fixes that. Another case that this is needed is with
clang's --target option

This is a bad solution, honestly, and it would be better to use $LD or a
cross/native file but this is needed for backwards compatability.

Fixes #6057
2019-12-12 10:57:27 -08:00
Dylan Baker 87766b3727 Allow setting <lang>_args before the compiler is detected
This is required to be able to pass compiler and linker arguments to the
methods that try to guess what linker to use.
2019-12-12 10:52:07 -08:00
Dylan Baker 7460e4ccda compilers: Make get_display_language a class or static method
Currently this is done at the instance level, but we need it at the
class level to allow compiler "lang" args to be gotten early enough.
This patch also removes a couple of instance of branch/leaf classes
providing their own implementation that is identical to the Compiler
version.
2019-12-12 09:35:32 -08:00
Dylan Baker ee6e249f65 compilers: move language attribute to the class level
We know that if a compiler class inherits CCompiler it's language will
be C, so doing this at the class level makes more sense.
2019-12-12 09:35:30 -08:00
Jussi Pakkanen 17dd9e5bff
Merge pull request #6207 from dcbaker/linker-option
Add a way to select the dynamic linker meson uses
2019-12-11 23:29:33 +02:00
Dylan Baker 875ef354d0 compilers: Rework the CompilerArgs to be less awful
There are two awful things about CompilerArgs, one is that it directly
inherits from list, and there are a lot of subtle gotcahs with
inheriting from builtin types. The second is that the class allows
arguments to be passed in whatever order. That's bad. This also fully
annotates the CompilerArgs class, so mypy can type check it for us.
2019-12-05 22:15:40 +02:00
Dylan Baker 5b97767ea8 compilers: use import typing instead of from typing import
`from foo import` should be used sparingly because of namespace
pollution, especially since those names will be exported
unconditionally. For typing this is extra annoying because anytime
someone wants to use another symbol from the typing module they have to
add it to the import line. Use `import typing` to avoid all of this.
2019-12-05 22:15:40 +02:00
Daniel Mensinger 62efc37da1 lgtm: fix __eq__ not overridden when adding attributes 2019-12-05 11:08:12 -05:00
Daniel Mensinger 0cf31e2340 lgtm: fix Multiple calls to __init__
Some slight refactoring for the dependency classes and
I switched the elbrus compiler to the GnuLikeCompiler.
This is also the correct use according to the documentation
of GnuLikeCompiler.
2019-12-05 11:08:12 -05:00
Daniel Mensinger f1971fed90 lgtm: Actually supress the Non-standard exception warning 2019-12-05 11:08:12 -05:00
Daniel Mensinger e4a0ee205d lgtm: Fix redundant code 2019-12-05 00:22:10 +02:00
Daniel Mensinger fe853ee516 lgtm: fix Missing call to __init__ during object initialization
Either mark the missing calls as intentional, or explicetly call
the right __init__ method and avoid mixing super() and explicit
base calss calls.
2019-12-05 00:22:10 +02:00
Daniel Mensinger ed9d125b9c lgtm: fix missing raise 2019-12-05 00:22:10 +02:00
Daniel Mensinger 454e323d3d lgtm: ignore Non-standard exception raised in special method 2019-12-05 00:22:10 +02:00
Daniel Mensinger 286b9f0921 lgtm: Fix Module imported with `import` and `import from` 2019-12-05 00:22:10 +02:00
Michael Hirsch, Ph.D b1c8f765fa intel/intel-cl: use appropriate buildtype options
This puts appropriate default options across buildtype for Intel and
Intel-Cl compilers, for C, C++ and Fortran. Prior to this PR, the
behavior of Intel compilers vs. GNUlike was not the same, in
particular, debug traceback available by default for GNUlike compilers
was not present with Intel compilers.
2019-12-04 21:48:34 +02:00
Dylan Baker ef9aeb188e Allow selecting the dynamic linker
This uses the normal meson mechanisms, an LD environment variable or via
cross/native files.

Fixes: #6057
2019-12-02 16:39:06 -08:00
Michael Hirsch, Ph.D 07a2fe2f00 complete gfortran/intel/intel-cl fortran_std test 2019-11-25 13:08:56 +02:00
Antoine Jacoutot 0241948d8f openbsd: execinfo is not a compiler lib 2019-11-25 12:54:07 +02:00
Xavier Claessens e4e5f981eb Fix compute_int() when the value is -1 2019-11-21 01:32:11 +02:00
Eric Le Bihan 815563841a Fix cross-compilation of D programs
Since version 9.1, GCC provides support for the D programming language. Thus it
is easy to build a cross-compiler for D, such as aarch64-unknown-linux-gnu-gdc.

However to cross-compile a Meson project using D, using a cross build definition
such as the following is not enough:

```
[binaries]
d = '/path/to/aarch64-unknown-linux-gnu-gdc'
exe_wrapper = '/path/to/qemu-aarch64-static'

[properties]
needs_exe_wrapper = true

[host_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'cortex-a53'
endian = 'little'
```

Indeed, "exe_wrapper" is not be taken into account. Build will fail with:

```
Executables created by D compiler /path/to/aarch64-uknown-linux-gnu-gdc are not runnable.
```

This patch fixes this by reworking:

- detect_d_compiler() to properly get exe_wrapper and D compilers and detect the
one available.
- Dcompiler to properly handle exe_wrapper.
2019-11-19 16:32:12 +02:00
Michael Hirsch, Ph.D 1f751dacba fortran: sync implicit-none args for intel,pgi,gfortran
also, find intel-cl submodule .smod name pattern. this would fix
intermittent failures of ninja to resolve submodule file dependencies.
2019-11-18 23:45:24 +02:00
Michael Hirsch, Ph.D 050dcf80af fortran: note there is no has_function for Fortran
It would be very challenging if not futile to make has_function work for Fortran.
The meson.get_compiler('fortran').links() works very well instead.
As a reference, CMake's check_fortran_function_exists is completely broken in general.

This change raises a useful MesonException instead of giving bizarre errors.
2019-11-18 22:22:54 +02:00
Michael Hirsch, Ph.D 83b4e981c4 Use strict function prototypes 2019-11-18 22:21:36 +02:00
Jussi Pakkanen 4c96aa34cb Add -L= to soname linker argument, too. 2019-11-06 22:12:41 +02:00
Wolfgang Stöggl f037e7ef45 Fix typos found by codespell
- Typos were found by codespell v1.16.0
2019-11-06 09:55:30 -05:00
Aleksey Gurtovoy f56ef583d3 dependency('cuda') 2019-11-05 22:17:44 +02:00
Jussi Pakkanen f5c8893281
Merge pull request #6123 from scivision/bugfix-fortran
bugfix: fortran compiler assertionerror from 0c22798
2019-11-02 23:35:38 +02:00
Jussi Pakkanen b3fe4a0a18 Add option for controlling RTTI. 2019-11-02 19:49:14 +02:00
Jussi Pakkanen 760b8633bc Pass explicit command line argument to disable exceptions with MSVC. 2019-11-02 19:49:14 +02:00
Michael Hirsch, Ph.D 9c1bab67af
bugfix: fortran compiler assertionerror from 0c22798 2019-10-31 23:22:37 -04:00
Aleksey Gurtovoy 6eee9e48bb MSVC: support -LIBPATH
Fixes #6101 (with a test), following up #5881
2019-10-29 22:40:13 +02:00
GoaLitiuM 31d397187d d: Fix various linking issues on Windows 2019-10-21 16:24:39 +03:00
Daniel Mensinger 80ec5e9d28 Fix all flake8 warnings 2019-10-20 17:44:43 +03:00
makise-homura 9382884872 Fix according to deprecation of usage of non-standard escape sequences 2019-10-19 14:27:41 +03:00
makise-homura 79f52e2488 Add a proper way to get include dirs for elbrus compiler 2019-10-19 14:27:41 +03:00
makise-homura dd8c1d0595 Make search of library dirs correct 2019-10-19 14:27:41 +03:00
Daniel Mensinger 8b8f14c4dd default inc dirs: fix warning for unsupporte lang (fixes #6050) 2019-10-18 00:45:03 +03:00
Andrei Alexeyev 0841d1710e emscripten: fix false positives in linking tests 2019-10-18 00:31:57 +03:00
Andrei Alexeyev 50646a8723 Refactor duplicate Emscripten code into a mixin 2019-10-18 00:31:57 +03:00
Andrei Alexeyev bd42cb965a Fix emscripten C compiler initialization 2019-10-15 21:52:35 +03:00
Andrei Alexeyev 5dfd054c32 Workaround broken get_allow_undefined_link_args in DmdLikeCompilerMixin
Previously it worked by accident because BasicLinkerIsCompilerMixin had
that method misspelled.
2019-10-14 13:04:34 -07:00
Andrei Alexeyev af2c1e4eb7 Revert "Remove BasicLinkerIsCompilerMixin from LDC and DMD"
This reverts commit 04d6a439457d76b9cf4c4f98fce238219366e241.
2019-10-14 13:04:34 -07:00
Andrei Alexeyev 5e3eff9d72 Remove BasicLinkerIsCompilerMixin from LDC and DMD
These compilers invoke external linkers and have the appropriate .linker
property set. Therefore, BasicLinkerIsCompilerMixin appears to be
misplaced.

It used to work by chance, because BasicLinkerIsCompilerMixin failed to
override the get_allow_undefined_link_args method. The D compilers do
not provide their own get_allow_undefined_link_args, because they expect
to inherit it from Compiler, which simply delegates it to the linker.

Now that BasicLinkerIsCompilerMixin correctly overrides that method with
a stub, it broke compilers that relied on the buggy behavior.
2019-10-14 13:04:34 -07:00
Andrei Alexeyev dd162dccaa Implement get_linker_output_args in Emscripten compilers 2019-10-14 13:04:34 -07:00
Andrei Alexeyev c20d40789b Implement get_buildtype_linker_args in BasicLinkerIsCompilerMixin 2019-10-14 13:04:34 -07:00
Andrei Alexeyev 062a510a30 Implement get_asneeded_args in BasicLinkerIsCompilerMixin 2019-10-14 13:04:34 -07:00
Andrei Alexeyev f347a980fe Implement get_allow_undefined_link_args in EmscriptenCPPCompiler 2019-10-14 13:04:34 -07:00
Andrei Alexeyev 31b8ddab51 Implement get_allow_undefined_link_args in EmscriptenCCompiler 2019-10-14 13:04:34 -07:00
Andrei Alexeyev 0845b7dd3d Implement get_linker_debug_crt_args in BasicLinkerIsCompilerMixin 2019-10-14 13:04:34 -07:00
Andrei Alexeyev 9488e4acfe Fix misnamed method in BasicLinkerIsCompilerMixin
get_allow_undefined_link_args is the compiler method
get_allow_undefined_args is the linker method
2019-10-14 13:04:34 -07:00
Ting-Wei Lan 9f0f595b35 compilers: Fix version requirements for ClangC and AppleClangC
Commit ff4a17dbef modified the version
requirements wrongly. AppleClangC should be the one with higher version
numbers. Exchange them to fix the check.
2019-10-11 10:03:35 -07:00
Michael Hirsch, Ph.D 17f766105f intel-cl: correct argument order 2019-10-10 10:00:28 -07:00
Michael Lenczewski 763c1e3280 Fix for issue 5355
compiler.get_supported_arguments reports success for certain unsupported
   flags when using the gnu C/ObjC, C++/ObjC++ compilers.  This fix reads
   the stderr on the has_arguments check to ensure the arguments really are
   supported and not valid for the language selection
2019-10-09 14:24:37 -07:00
Dylan Baker afbed79baa compilers: replace uses of mesonlib.is_<os>() with self.info.is_<os>()
Since these are cross compilation safe, while the former is not.
2019-10-07 12:08:20 -07: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 ff4a17dbef compilers: Add a specific type for AppleClangC
This allows us to detect use classes rather than methods to determine
what C standards are available.
2019-10-07 10:44:56 -07:00
Jussi Pakkanen 51fef880b6
Merge pull request #5953 from mensinda/isystem
Add is_system to dependency
2019-10-06 17:33:12 +03:00
Daniel Mensinger 8103af1d76
cmake: fix detection of libraries with .so version 2019-10-03 17:56:47 +02:00
Daniel Mensinger 66c129c52f
cache all gnulike_default_include_dirs invocations 2019-10-03 17:04:44 +02:00
Daniel Mensinger b1b8a7a7e3
Use -isystem instead of -idirafter 2019-10-03 10:06:04 +02:00
Daniel Mensinger c6938bd579
Handle -idirafter in unix_args_to_native 2019-10-03 10:06:03 +02:00
Aleksey Gurtovoy 7dbabdc7b6 Correctly handle platform-specific LDFLAGS options 2019-09-27 00:57:21 +03:00
Aleksey Gurtovoy 6ac5db50c9 CUDA support on Windows 2019-09-24 14:22:20 -07:00
Jehan 179861ccd1 mesonbuild: fix exception name.
CrossNoRunException is in compilers module, not mesonlib.
2019-09-23 13:25:53 -04:00
Dylan Baker 4030ee4b6f the solaris linker also needs start/end-group for circular linking 2019-09-09 21:22:26 -07:00
Nguyen, Giang (G. Yakiro) 333f77ad3d fix objc freestanding sanitycheck 2019-09-08 16:27:52 +03:00
Jussi Pakkanen d67d5411bb
Merge pull request #5823 from scivision/linker-pgi-linux
PGI compiler fixes
2019-09-05 23:45:54 +03:00
Aleksey Gurtovoy 75daed27bc mesonlib.split_args/quote_arg/join_args 2019-09-05 23:42:47 +03:00
Michael Hirsch, Ph.D b9af8f8b6b
PGI cannot accept -pthread 2019-09-05 11:58:10 -04:00
Michael Hirsch, Ph.D c8d380e4ef
PGI: use ar link wrapper on Windows 2019-09-05 11:50:17 -04:00
Kramer Peace caec875fe1 Create CUDA linker with CUDA compiler
Since they are laways paired there is no need to "search" for the cuda
linker.
2019-09-05 08:38:56 -07:00
Kramer Peace fb9a5ce867 Add a CUDA linker object
Fixes issue #5870
2019-09-05 08:38:56 -07:00
Dylan Baker 0efab591da compilers: Move the compiler argument to proxy linker flags to the compiler class
Instead of the DynamicLinker returning a hardcoded value like
`-Wl,-foo`, it now is passed a value that could be '-Wl,', or could be
something '-Xlinker='

This makes a few things cleaner, and will make it possible to fix using
clang (not clang-cl) on windows, where it invokes either link.exe or
lld-link.exe instead of a gnu-ld compatible linker.
2019-08-30 00:01:32 +03:00
Dylan Baker ba4324ab9d Fix gcc include dot 2019-08-28 22:20:00 +03:00
Jussi Pakkanen 1ea3ddc6ad
Merge pull request #5681 from dcbaker/dynamic-linker-split
split dynamic linker representations from compilers
2019-08-20 23:14:05 +03:00
Phillip Cao 0384487fc5 Fix CCRX linking external dependencies 2019-08-20 21:10:37 +03:00
Jussi Pakkanen 80ef6fd69f Pass optimization flags to rustc properly. Closes: #5788. 2019-08-17 21:14:16 +03:00
Dylan Baker 06dcbd50ee compilers: Dispatch to dynamic linker class
Most of the cuda code is from Olexa Bilaniuk.
Most of the PGI code is from Michael Hirsc
2019-08-14 13:13:23 -07:00
Dylan Baker 38d588bc6e compilers/mixins: Add a module for mixins for compilers that are linkers
This is currently meant to solve problems for D's DMD compiler, however
it may be useful in other cases.
2019-08-14 13:13:23 -07:00
Dylan Baker b0f4ee2f94 compilers/rust: Proxy extra kwargs to Compiler.__init__ 2019-08-14 13:13:23 -07:00
Dylan Baker 18b1bf9292 compilers: Make MSVClike compilers proxy extra keyword arguments 2019-08-14 13:13:23 -07:00
Dylan Baker 16e04a9bde compilers/fortran: Make ifort (windows) proxy extra args to Compiler 2019-08-14 13:13:23 -07:00
Dylan Baker 61255eca16 compilers/cuda: pass through extra kwargs 2019-08-14 13:13:23 -07:00
Dylan Baker 1f66e6708b compilers/swift: Pass extra args to the Compiler constructor 2019-08-14 13:13:23 -07:00
Dylan Baker b5c76a6c02 compilers/fortran: fix ifort (linux, mac) dependency generation
Ifort can generate dependency information (.d files), it just does it
differently than GNU compilers do. This also fixes a bug caused by
adding the dependency generation commands to the GNULike class later in
this series.
2019-08-14 13:13:23 -07:00
Dylan Baker e7db288e19 compilers/objc[pp]: Pass extra keyword arguments to Compiler constructor 2019-08-14 13:13:23 -07:00
Dylan Baker 499c44dc77 compilers/cuda: don't use re for replacement
Even with the check (for extra safety) string.replace is more than twice
as fast.
2019-08-14 13:13:23 -07:00
Michael Hirsch, Ph.D f5f7a7bbb3 compilers/mixins/pgi: simplify pic logic 2019-08-14 13:13:22 -07:00
Dylan Baker 90e43dbdfe re-architect the D compiler abstractions
We support 3 D compilers, DMD, LDC, and GDC. DMD is the reference
compiler, and LDC attempts to largely mirror it's command line usage.
GDC does not, it instead acts like GCC (which makes sense). The current
abstraction puts DMD behavior in the base D compiler and then overrides
then in the GnuDCompiler class.

This is messy, but it becomes more problematic when splitting the linker
and compiler abstractions apart.

I've opted to instead split the DCompiler class into two separate
classes. The DCompiler implements core D functinoality, and
DmdLikeCompilerMixin, which implements the DMD and LDC command line
arguments. I've then mxed that into the DmdDCompiler and LLVMDCompiler
classes, and mixed the GnuCompiler into the GnuDCompiler class to get
Gnu command line behavior.
2019-08-14 13:13:22 -07:00
Jussi Pakkanen f41bdae368 Add basic Webassembly support via Emscripten. 2019-08-05 19:31:32 +03:00
Xavier Claessens 32bd8a3847 Fix cross compilation on OSX
Do not set -Wl,-headerpad_max_install_names when compiling on OSX for
another platform. It causes linker issues.
2019-08-04 21:45:40 +03:00
Jussi Pakkanen 9a62d6932b Make ARM compilers work on Linux. 2019-08-02 19:27:00 +03:00
Michael Hirsch, Ph.D d0e78a2534
default libtype to static to allow windows compilers to not skip
To make Fortran tests useful on Windows, the library_type should default to static,
unless needed to specifically test shared. Shared Fortran libs on Windows for
non-Gfortran compilers is fragile requiring proprietary code syntax.
2019-07-30 15:31:00 -04:00
Michael Hirsch, Ph.D 7eebb6749a
no special shared lib args for PGI 2019-07-30 15:29:51 -04:00
Michael Hirsch, Ph.D 1e08d81476
PGI -shared is for Linux only 2019-07-30 15:29:50 -04:00
Jussi Pakkanen 3e54719ab8
Merge pull request #5740 from scivision/intel-ci_fix
tests: Intel-cl fixes for Fortran
2019-07-30 18:21:30 +03:00
Michael Hirsch, Ph.D 1e53f67187 PGI: cpp_pch precompiled headers functionality
* PGI C++ PCH enable

PGI compilers support precompiled headers for C++ only.
The common/13 pch test passes if run manually with no spaces in the build path.
However, since Meson run_project_tests.py makes temporary build directories
with spaces in each tests, PGI --pch_dir can't handle this and fails.
So we skip the test for PGI despite it working for usual case with no-spaces
in build dir.
Note: it's fine to have spaces in full path for sourcedir, just no spaces in
relative path to builddir.

* doc
2019-07-30 18:07:20 +03:00
Michael Hirsch, Ph.D a7c8a69afb
intel-cl: readd missing import 2019-07-30 00:27:13 -04:00
Michael Hirsch, Ph.D bc08ace84e
Flang: add links for non-flang main program 2019-07-29 01:18:54 -04:00
Dylan Baker c8a6a44850 compilers: pull sanitzier args into compiler classes
This simplifies and cleans things up.
2019-07-23 09:58:24 +00:00
Dylan Baker 5d7395673d compilers: return as-needed args as a list 2019-07-23 09:58:24 +00:00
Dylan Baker 7eb1d89095 compilers: Move lto args into compiler class
There are two problems, one is that it assumes -flto is the argument
to do LTO/WPO, which isn't true of ICC and MSVC (and presumably)
others. It's also incorrect because it assumes that the compiler and
linker will always be the same, which isn't necessarily true. You
could combine GCC with Apple's linker, or clang with link.exe, which
use different arguments.
2019-07-23 09:58:24 +00:00
Nirbheek Chauhan 9c2724bce5 Add optional progress bar when generating build.ninja 2019-07-20 17:02:15 +03:00
Jeremy Philippe c206f3cb1d ValaCompiler: only emit '--debug' in debug build. 2019-07-20 05:48:53 +00:00
Daniel Mensinger bc0f510ef1 fix all flake8 issues 2019-07-18 23:43:29 +03:00
Martin Liska c1870889b1 Fix missing return statements that are seen with -Werror=return-type.
Error example:

Code:

        #include <locale.h>
        int main () {
            /* If it's not defined as a macro, try to use as a symbol */
            #ifndef LC_MESSAGES
                LC_MESSAGES;
            #endif
        }
Compiler stdout:

Compiler stderr:
 In file included from /usr/include/locale.h:25,
                 from /tmp/tmpep_i4iwg/testfile.c:2:
/usr/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  382 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
/tmp/tmpep_i4iwg/testfile.c: In function 'main':
/tmp/tmpep_i4iwg/testfile.c:8:9: error: control reaches end of non-void function [-Werror=return-type]
    8 |         }
      |         ^
cc1: some warnings being treated as errors
2019-07-16 09:49:03 +02:00
Dylan Baker 42d34095b4 compilers/mixins/pgi: Finish type annoations 2019-07-15 10:59:22 -07:00
Dylan Baker fab47c5680 compilers: split pgi compiler out of compilers module 2019-07-15 10:59:22 -07:00
Dylan Baker f574beffb4 compilers/mixins/elbrus: add type annotations and fix types
There is a pretty big error in here, trying to return a tuple
comperhension: (a for a in []) is not a tuple, it's a generator. This
has profound type annotations: generators don't support most tuple or
list methods, and they can only be iterated once. Beyond that tuples are
meant for heterogenous types, ie, position matters for types. I've
converted the output to a list in all cases.
2019-07-15 10:59:22 -07:00
Dylan Baker 5d685e7a5c compilers: put elbrus in mixins 2019-07-15 10:59:22 -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
Dylan Baker 51b04204c9 compilers/mixins/arm: Add type annotations to armclang 2019-07-15 10:59:22 -07:00
Dylan Baker e879992114 compilers: move ArmClang into mixins/arm.py 2019-07-15 10:59:22 -07:00
Dylan Baker 521e057d97 compilers/mixins/intel: add type annotations 2019-07-15 10:59:22 -07:00
Dylan Baker b8368c1617 compilers: Put Intel compiler classes into the mixins folder 2019-07-15 10:59:22 -07:00
Dylan Baker 488e852e70 compilers/mixins/gnu: Add type annotations 2019-07-15 10:59:22 -07:00