| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
This reinstates 2256e6314b610b8f6645d0c5384536001ddeccf9, which was
lost in refactoring in 9f9cfd21396db5cd5eb1711916c8b0c6e433c702.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This allows each implementation (gnu-like) and msvc to be implemented in
their respective classes rather than through an if tree in the CCompiler
class. This is cleaner abstraction and allows us to clean up the Fortran
compiler, which was calling CCompiler bound methods without an instance.
|
| |
|
|
|
|
|
|
|
|
| |
ICC doesn't use the same -fprofile-generate/-fprofile-use that GCC and
Clang use, instead it has -prof-gen and -prof-use. I've gone ahead and
added the threadsafe option to -prof-gen, as meson currently doesn't
have a way to specify that level of granularity and GCC and Clang's
profiles are threadsafe.
|
|
|
|
|
| |
has_arguments is the wrong thing to fix, since all checks that require
compiler options are based on compiles, it's the right thing to modify.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because we need to inherit them in some cases, and python's
keyword-or-positional arguments make this really painful, especially
with inheritance. They do this in two ways:
1) If you want to intercept the arguments you need to check for both a
keyword and a positional argument, because you could get either. Then
you need to make sure that you only pass one of those down to the
next layer.
2) After you do that, if the layer below you decides to do the same
thing, but uses the other form (you used keyword by the lower level
uses positional or vice versa), then you'll get a TypeError since two
layers down got the argument as both a positional and a keyword.
All of this is bad. Fortunately python 3.x provides a mechanism to solve
this, keyword only arguments. These arguments cannot be based
positionally, the interpreter will give us an error in that case.
I have made a best effort to do this correctly, and I've verified it
with GCC, Clang, ICC, and MSVC, but there are other compilers like Arm
and Elbrus that I don't have access to.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Some compilers try very had to pretend they're another compiler (ICC
pretends to be GCC and Linux and MacOS, and MSVC on windows), Clang
behaves much like GCC, but now also has clang-cl, which behaves like MSVC.
This method provides an easy way to determine whether testing for MSVC
like arguments `/w1234` or gcc like arguments `-Wfoo` are likely to
succeed, without having to check for dozens of compilers and the host
operating system, (as you would otherwise have to do with ICC).
|
|
|
|
|
|
| |
Support vs_module_defs when cross-compiling to Windows with clang.
Fixes #4434.
|
|
|
|
|
|
|
|
|
| |
Replace several checks against GCC_MINGW or (GCC_MINGW, GCC_CYGWIN) with
is_windows_compiler instead, so that clang and other gcc-like compilers
using MinGW work appropriately with vs_module_defs, c_winlibs, and
cpp_winlibs.
Fixes #4434.
|
|
|
|
|
|
|
|
|
| |
This allows using the imperfect profiles generated by multithreaded
programs. Without the argument, GCC fails to load them.
Clang just ignores the argument AFAICT.
Fixes https://github.com/mesonbuild/meson/issues/2159
|
| |
|
| |
|
| |
|
|
|
|
|
| |
On Android executables must be position independent, many
distributions enable it by default too for security reasons.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* This helps with reproducibility on macOS in the same way
`$ORIGIN` improves reproducibility on Linux-like systems.
* This makes the build-tree more resilient to users injecting
rpaths via `LDFLAGS`. Currently Meson on macOS crashes when
a build-tree rpath and a user-provided `-Wl,-rpath` in
LDFLAGS collide, leading to `install_name_tool` failures.
While this still does not solve the root cause, it makes
the occurrence much less likely, as users will generally
pass absolute `-Wl,-rpath` arguments into Meson.
|
| |
|
|
|
|
|
| |
MSVC doesn't support that option, and warns about ignoring an unknown
option.
|
|
|
|
|
|
|
|
|
|
|
| |
--as-needed controls ELF-specific functionality (the emission of DT_NEEDED
tags)
--no-undefined is effectively always on for PE/COFF, as the linkage model
always requires symbols to be defined
binutils ld silently ignores these flags for PE targets, but lld warns that
it's ignoring them, so just don't bother emitting them for PE targets.
|
|
|
|
| |
get_debug_args in ARMCC and ARMCLANG classes.
|
|
|
|
| |
Closes #4206
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* `common/40 has function` still fails due
to alloca being a GCC builtin.
|
|
|
|
|
|
|
|
| |
* Enums are strongly typed and make the whole
`gcc_type`/`clang_type`/`icc_type` distinction
redundant.
* Enums also allow extending via member functions,
which makes the code more generalisable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This improves the backend generation time for gst-build from 7.4s to
6.6s. This is probably all the low-hanging fruit we can get, further
improvements will probably require refactoring, moving to pathlib.Path
or reimplementing CompilerArgs:
222045 0.551 0.000 1.324 0.000 compilers.py:666(__iadd__)
3691 0.230 0.000 0.885 0.000 ninjabackend.py:99(write)
233560 0.441 0.000 0.701 0.000 posixpath.py:75(join)
882 0.141 0.000 0.636 0.001 backends.py:509(generate_basic_compiler_args)
256301 0.248 0.000 0.576 0.000 compilers.py:562(_can_dedup)
37369 0.035 0.000 0.466 0.000 compilers.py:652(extend_direct)
74650 0.067 0.000 0.431 0.000 compilers.py:641(append_direct)
158153 0.089 0.000 0.405 0.000 ninjabackend.py:129(<lambda>)
845 0.064 0.000 0.391 0.000 ninjabackend.py:279(get_target_generated_sources)
58161 0.070 0.000 0.317 0.000 backends.py:217(get_target_generated_dir)
216825 0.175 0.000 0.275 0.000 ninjabackend.py:48(ninja_quote)
845 0.058 0.000 0.255 0.000 ninjabackend.py:2289(guess_external_link_dependencies)
845 0.068 0.000 0.239 0.000 backends.py:793(get_custom_target_provided_libraries)
52101 0.030 0.000 0.237 0.000 compilers.py:716(append)
1319326 0.231 0.000 0.231 0.000 {built-in method builtins.isinstance}
1189117 0.229 0.000 0.229 0.000 {method 'startswith' of 'str' objects}
3235 0.102 0.000 0.228 0.000 compilers.py:614(to_native)
Note: there are 845 build targets.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's fairly common on Linux and *BSD platforms to check for these
attributes existence, so it makes sense to me to have this checking
build into meson itself. Autotools also has a builtin for handling
these, and by building them in we can short circuit cases that we know
that these don't exist (MSVC).
Additionally this adds support for two common MSVC __declspec
attributes, dllimport and dllexport. This implements the declspec
version (even though GCC has an __attribute__ version that both it and
clang support), since GCC and Clang support the MSVC version as well.
Thus it seems reasonable to assume that most projects will use the
__declspec version over teh __attribute__ version.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now use the soversion to set compatibility_version and
current_version by default. This is the only sane thing we can do by
default because of the restrictions on the values that can be used for
compatibility and current version.
Users can override this value with the `darwin_versions:` kwarg, which
can be a single value or a two-element list of values. The first one
is the compatibility version and the second is the current version.
Fixes https://github.com/mesonbuild/meson/issues/3555
Fixes https://github.com/mesonbuild/meson/issues/1451
|
|
|
|
|
|
|
|
|
|
| |
* Currently, RPATHs coming from dependencies and
`build_rpath` provided by the user might contain
the same path. Apple's `install_name` tool is
allergic to providing the same argument twice
when removing RPATHs:
error: install_name_tool: "-delete_rpath /usr/lib" specified more than once
|
|
|
|
|
|
|
|
|
| |
Treat it the same as -lfoo by deduping and adding to --start/end-group
Reported at https://gitlab.gnome.org/GNOME/glib/issues/1496
We don't do any advanced transformation for MSVC or de-dup because
this is a very rare syntax.
|
|\
| |
| | |
Fix D support on Windows
|
| |
| |
| |
| | |
DMD expects mscrtlib arguments while compiling, whereas LDC2 expects these while linking.
|
| |
| |
| |
| | |
Dub enables inlining by default for release builds, so meson should do it as well.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a keyword argument to to_native() to operate on a copy so that we
can call it multiple times instead of modifying the original compiler
args while iterating.
This is used in the unit test, and might be used in Meson at some
point too.
|
| |
| |
| |
| |
| | |
The index calculated through `self.index()` may find the same flag
earlier in the list and end up putting `--end-group` in the wrong spot.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- For optimization=s add /O1: Use Maximum Optimization (Favor Size),
and remove /Os as it's implied by /O1.
- Because we add /O1, this implies /Gy, i.e. Function-Level Linking, so
unused code can be omitted.
- Add /Gw: Optimize Global Data, so unused data can be omitted.
With buildtype=minsize on x86 this reduces the size of a statically
linked Vala compiler binary from 5 MB down to just 1.87 MB.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This means that we will take into account all the flags set in the
cross file when fetching the list of library dirs, which means we
won't incorrectly look for 64-bit libraries when building for 32-bit.
Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com>
Closes https://github.com/mesonbuild/meson/issues/3881
|
|/
|
|
| |
Closes: #4021.
|
| |
|
|
|
|
|
| |
Add get_gui_app_args() to the Compiler class so it can be unconditionally
used
|
| |
|
|\
| |
| | |
Add gnu_symbol_visibility keyword argument
|
| | |
|
| | |
|
|/
|
|
|
|
|
| |
-lc -lm -ldl -lrt -lpthread are special linker arguments that should
never be resolved to on-disk libraries.
Closes https://github.com/mesonbuild/meson/issues/3879
|