Age | Commit message (Collapse) | Author | Files | Lines |
|
If static_library is used as a convenience library (e.g. for link_whole)
it should in principle not need position independent code.
However, if the executables that the libraries is linked to are PIE,
the non-PIC objects in the static library will cause linker errors.
To avoid this, obey b_pie for static libraries if either b_staticpic=false
or they use "pic: false".
Without this patch, QEMU cannot use b_staticpic, which causes a slowdown
on some QEMU benchmarks up to 20%.
|
|
|
|
|
|
|
|
Fixes bug #589. When generating string from file object, it didn't take subdir
into account.
|
|
|
|
|
|
Improve the output for meson wrapped commands
|
|
- 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.
|
|
|
|
Make 'meson --internal exe --unpickle' report the actual command
executed when it fails, which is otherwise invisible.
|
|
I've always found ninja reporting 'a meson_exe.py custom command'
unclear and confusing. Instead say we are invoking a custom command,
wrapped by meson, and why.
|
|
container`
Unfortunately this doesn't catch other abuses of len(continauer) like,
`len(container) <comparator> 0`, see: https://github.com/PyCQA/pylint/issues/3751
|
|
|
|
Otherwise it might be an argument to a script that just inspects the
binary itself.
|
|
|
|
- Implicit include dirs was checked twice in a row
- Add define only if it does not yet exist rather than remove.
|
|
- "Go To Document" action previously only worked
on c/cpp files which had the include directories
set but it was not possible to move from header to another header.
|
|
This reverts commit 8ee1c9a07a3a35e3ed262fbc358fd86c257a966e.
No rationale was given for this change prior to merging. After the fact
it was described as desired by distro packagers, however as a distro
packager I believe this commit hurts me.
From a distro packaging perspective, we primarily care about one thing:
previously building code should still build. Hence, -Werror is bad for
our use case. meson handles this via -D werror which is different from
-D warning_level and as long as the former is disabled, warnings in the
build do not cause harm (but may attract review attention for upstream
to fix).
buildtype is a completely unrelated concern, and the intention for
=plain is to disable debug or optimization settings that result in
codegen differences and thus different built artifacts. This must not
happen in distro builds because the *distributed programs* should
conform to policy settings.
Unfortunately, completely disabling warnings happens silently, and
cannot be overridden even if you really, really believe you know what
you're doing. It is thematically broken, since use of
add_project_arguments() to add more -W flags is not likewise ignored.
But if you try to add -Wall in that manner, meson will lecture you to
use warning_level which you cannot do. And if you have custom warning
flags which depend on options enabled by judicious use of -Wall via
default_options: 'warning_level=1', then you end up with generated
warnings complaining about your command line rather than your code, such
as:
cc1: warning: ‘-Wformat-y2k’ ignored without ‘-Wformat’ [-Wformat-y2k]
cc1: warning: ‘-Wformat-extra-args’ ignored without ‘-Wformat’ [-Wformat-extra-args]
cc1: warning: ‘-Wformat-zero-length’ ignored without ‘-Wformat’ [-Wformat-zero-length]
cc1: warning: ‘-Wformat-contains-nul’ ignored without ‘-Wformat’ [-Wformat-contains-nul]
cc1: warning: ‘-Wformat-security’ ignored without ‘-Wformat’ [-Wformat-security]
which then break the build with -Werror.
Throughout all this, a buildtype of "plain" does *not* disable -D
werror=true, which is the part where distro builds actually break down!
Users who both wish to disable debug/optimization codegen, *and* disable
warning commentary, are encouraged to do so by doing both, not by doing
one and having the other be assumed.
Fixes #7399
|
|
And check the install data in the same way that mtest checks
serialisation data.
Fixes https://github.com/mesonbuild/meson/issues/2354
|
|
Same as coredata.dat and build.dat loading. Also, do not assert if
things change. Raise the appropriate exception.
Fixes https://github.com/mesonbuild/meson/issues/7613
|
|
Don't stop generating STATIC_LINKER rules at the first MachineChoice
which isn't available (i.e. generate a STATIC_LINKER rule, even if
STATIC_LINKER_FOR_BUILD isn't needed)
Also warn about internal errors which lead to non-existent rule
references, rather than exploding with a KeyError.
|
|
|
|
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
|
|
correct Fortran include algorithm
|
|
This allows the NINJA environment variable to support all the Windows special
cases, especially allowing an absolute path without extension.
Based on a patch by Yonggang Luo.
Fixes: #7659
Suggested-by: Nirbheek Chauhan <nirbheek@centricular.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Add the ids of any target that needs to be rebuilt before running the
tests as computed by the backend, to the introspection data for tests and benchmarks.
This also includes anything that appears on the test's command line.
Without this information, IDEs must update the entire build before running
any test. They can now instead selectively build the test executable
itself and anything that is needed to run it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
also fixed PEP8
I originally implemented the "include" scanning,
but hadn't made a test for this case
|
|
extra_paths only matter for the host machine if using an exe_wrapper.
However, because CustomTarget.for_machine is always MachineChoice.HOST,
they were computed unnecessarily in as_meson_exe_cmdline.
Defer computation of extra_paths until after we have found out if the
custom target executable is really for the host or the build machine,
so that we can use exe_for_machine; for_machine then becomes unused
and can be removed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Various speedups from profiling QEMU's meson.build
|
|
- Exceptions raised during subproject setup were ignored.
- Allow c_stdlib in native file, was already half supported.
- Eliminate usage of subproject variable name by overriding
'<lang>_stdlib' dependency name.
|
|
The lambda in NinjaBuildElement.write is quite expensive, totalling 0.3s
just to do a couple function calls. Since it is used just once, simply
inline it.
On a QEMU build, the total time spent in write from this series goes from
5.321s to 3.238s, though part of it can be attributed to previous patches.
|
|
Optimize the regular expression so that the variable expansion part
always ends up in group 1, and the trailer after the variable is discarded
in the same match. Do not use re.sub to remove braces, and do not bother
building the expanded command, just adjust the estimated length on the fly.
functools.reduce is extremely slow, so I am keeping ' '.join(chunk).
On a QEMU build the time spend in the function goes from 1.072s to 0.757s.
|
|
Use regular expressions to quickly weed out strings that require quoting
On a QEMU build the time spent in ninja_quote goes from 1.978s to 1.281s,
with str.replace being kicked completely out of the profile.
|
|
Without the parenthesis, the command evaluates to `[]` if
`use_llvm_cov` is `False`.
Also fix tests to actually check whether or not coverage reports are
generated.
Fixes https://github.com/mesonbuild/meson/issues/7553
|
|
Fix two warnings
|
|
Since -Wl,-rpath= is not the only valid rpath ldflags syntax we
need to try and match all valid rpath ldflags.
In addition we should prevent -Wl,--just-symbols from being used to
set rpath due to inconsistent compiler support.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
|
|
Fixup for b4b1a2c5a145c1459fc4563a289e164e23bd6a02.
A warning would be printed for any rule with multiple outputs, for
example:
WARNING: custom_target 'coredump.conf.5' has more than one output! Using the first one.
WARNING: custom_target 'dnssec-trust-anchors.d.5' has more than one output! Using the first one.
WARNING: custom_target 'halt.8' has more than one output! Using the first one.
Fixes https://github.com/systemd/systemd/issues/16461.
|
|
otherwise we are getting errors like:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/mesonmain.py", line 131, in run
return options.run_func(options)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 245, in run
app.generate()
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 159, in generate
self._generate(env)
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/msetup.py", line 215, in _generate
intr.backend.generate()
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/backend/ninjabackend.py", line 518, in generate
self.generate_coverage_rules()
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/backend/ninjabackend.py", line 991, in generate_coverage_rules
self.generate_coverage_command(e, [])
File "/usr/local/lib/python3.6/dist-packages/mesonbuild/backend/ninjabackend.py", line 975, in generate_coverage_command
for compiler in target.compilers.values():
AttributeError: 'RunTarget' object has no attribute 'compilers'
This extends the 109 generatecode test case to also define a test, so
coverage can really detect something.
|
|
Put it in the log file if necessary. Users don't need to know this.
It's very spammy.
|
|
This comment was added in 0fbd09609f4, where the case of a forward
slash was added for the case when cross compiling.
|
|
This was missed somehow when the feature was added a few years ago.
|
|
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.
|
|
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
|
|
|
|
When changing meson option cpp_eh, it was passed to cl with AdditionalOptions and resulted in unsuppressable warning "cl : command line warning D9025: overriding '/EHs' with '/EHa'"
|
|
Fixes https://github.com/mesonbuild/meson/issues/7265
|
|
This is needed in the case where a custom_target directly depends on a
shared library, and somehow loads it.
(Specifically this can be the case with gtkdoc, when it invokes
gtkdoc-scangobj, which will build and run it's own code to load a shared
library, to introspect it)
|
|
Handle command arguments which contain multiple substitutions correctly
in Backend.eval_custom_target_command()
In particular, gnome.gtkdoc() makes arguments of the form '--cflags
-I@SOURCE_ROOT@ -I@BUILD_ROOT' (where these arguments are then passed
down to a compiler invocation)
Normally, these are subsequently made right by
NinjaBackend.replace_paths(), but if Backend.as_meson_exe_cmdline()
decides that the command needs to be pickled, that doesn't happen.
(Although having two places where this substitution might happen smells
really bad)
|
|
Make ninja backend only use response files when needed, on linux too
|