| Age | Commit message (Collapse) | Author |
|
I've done the compile and link flags in one commit since they're so
closely related
|
|
Compiler.get_language_stdlib_only_link_flags
|
|
|
|
|
|
|
|
|
|
|
|
Which, ironically, is passed down three levels and never used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For the same reason that the StaticLinker needs this, we need it in the
DynamicLinker as well.
|
|
There are a number of places where we treat StaticLinker and Compiler as
polymorphic, as such the StaticLinker cannot need extra parameters.
|
|
This is calculated by `Environment().is_cross_build(for_machine)`. Since
we have that in the Compiler class, just calculate it in the Compiler
initializer
|
|
We end up needing it everywhere, so just store it. This patch is huge
already, so it's just the conversion to passing Environment, more
cleanups to come.
|
|
This does not work correctly with clang-cl/lld-link
|
|
Adding support for linker option broke -Db_coverage because the
`--coverage` option is added to the command line without the
`-Clink-arg=` part. Fix it by overriding get_coverage_link_args;
since we have to add the get_coverage_* functions to RustCompiler,
teach it to generate `-Cinstrument-coverage` as well.
Note that `-Clink-arg==--coverage` is actually useful only for
mixed C/Rust programs.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This is a new attribute released in GCC 15 and clang 18. It isn't
supported in C++ compilers at the moment.
|
|
1. Generate OMF objs with `-Zomf' compiler flags
2. Generate OMF libs with `.lib' suffix using `emxomfar' as a librarian
|
|
|
|
|
|
|
|
|
|
Fixes: #15222
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The Rust compiler will need these to check the rust_nightly option.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The rustc invocation performs both compilation and linking, so it should include
link-phase arguments for LTO or sanitizers. RustCompiler has been taught how
to include these arguments, so now add them.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This is often needed for mixed Rust/C programs, and in particular always
needed with sanitizers. Add it always.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Follow the suggestion in https://github.com/rust-lang/rust/issues/39016#issuecomment-2391095973
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Produce -Cembed-bitcode for Rust, and also disable bitcode
generation when LTO is not enabled.
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
No other linker warns for duplicate libraries, and (especially with
rustc) specifying --fatal-warnings may cause the warnings to trigger
and a wrong result from has_multi_link_arguments.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Clang supports prelinking using the same `-r` flag as GCC. There has been prior
art in [1], which stalled at the time due to Clang inappropriately trying (and
failing) to link libgcc_s. This issue does not occur any more with versions 14
and higher.
[1] https://github.com/mesonbuild/meson/pull/8883
|
|
bfd supports the 'gold' plugin API too, just the LLVM plugin is called
'LLVMgold'.
Closes: https://github.com/mesonbuild/meson/issues/10798
|
|
clang++ seems to require the resolver function to have external linkage,
so the test code that was used was failing even though clang does
support the attribute.
Closes #12413.
|
|
The IntelCPPCompiler was incorrectly adding -fno-rtti when RTTI was
enabled (rtti=True) instead of when it was disabled. This change
corrects the logic to match the behavior of GCC and Clang compilers,
which properly add -fno-rtti when rtti=False.
Fixes #15220
|
|
GCC 15 supports incremental LTO (caching). It's the same feature as
Clang's ThinLTO caching.
Unfortunately, for the Clang ThinLTO cache support, we chose a pretty
vendor-specific option name, and I don't want to worry about deprecating
that (-Db_thinlto_cache and -Db_thinlto_cache_dir) at this time, so...
Wire -Db_thinlto_cache and -Db_thinlto_cache_dir for GCC in the obvious
and natural way.
Other notes:
* GCC, unlike Clang, requires the cache dir to exist. If the
user passes an invalid directory, that's on them, but for our default
in meson-private, we should os.mkdir() it, so we do that now too.
* I did wonder about adding -flto-partition=cache, but when I asked about
this last year [0], the response was that it has too many caveats. Though
Honza did recently [1] suggest it has some utility, so I don't know. I'll
ask about it.
[0] https://inbox.sourceware.org/gcc-patches/vjeanwm7b2jnedzmbwww4cy6jf4prty6ypxvz7x5d463xw2mys@bxzxuvgfaplf/
[1] https://inbox.sourceware.org/gcc-patches/aLnAGpln6SXbjV7e@kam.mff.cuni.cz/
Closes: https://github.com/mesonbuild/meson/issues/14428
|
|
Stop early-returning as we're going to do more work in this function
shortly for incremental LTO.
Bug: https://github.com/mesonbuild/meson/issues/14428
|
|
... by calling self.get_lto_compile_args, as we expect the same arguments
to be passed at both compile-time and link-time, and we're doing the exact
same procedure to determine -flto=XXX.
Bug: https://github.com/mesonbuild/meson/issues/9536
|
|
Without this, we pass (say) `-flto=auto` at compile-time, but just `-flto`
at link-time.
See also https://gcc.gnu.org/PR114655 and the linked r12-824-g3cbcb5d0cfcd17,
i.e. before GCC 12, we'd end up linking with 1 job.
The clang mixin looks correct already.
Closes: https://github.com/mesonbuild/meson/issues/9536
|
|
|
|
libc++ uses the same macro name, just with different values, for debugstl.
If the distro or similar predefines a hardening mode lower than the mode
debugstl wants (or in any other way not equal), we get an annoying redefinition
warning.
Closes: https://github.com/mesonbuild/meson/issues/13812
|
|
Bug: https://github.com/mesonbuild/meson/issues/13978
|
|
This has two problems:
1) it keeps breaking with Apple Clang (bug #14440, bug #14856)
2) it gets confused when using GCC with libc++ (a rare configuration)
because compiler version != libc++ version
There's no reason to keep catering for old libc++ here. The feature
was somewhat immature in older libc++ anyway.
Just rip it out and then we can go back and restore it for the niche
case later.
Bug: https://github.com/mesonbuild/meson/issues/14440
Bug: https://github.com/mesonbuild/meson/issues/14856
Closes: https://github.com/mesonbuild/meson/issues/13978
|
|
It's not obvious so add a comment, lest someone think handling the case
is a bug.
|