Skip to content

[1.12 regression] add_arguments not processed correctly for non-cross builds#16004

Open
bonzini wants to merge 8 commits into
mesonbuild:masterfrom
bonzini:qemu-machine-map
Open

[1.12 regression] add_arguments not processed correctly for non-cross builds#16004
bonzini wants to merge 8 commits into
mesonbuild:masterfrom
bonzini:qemu-machine-map

Conversation

@bonzini

@bonzini bonzini commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Reduced from QEMU.

The root cause of the issue is that native: true and native: false global_arguments and project_arguments are separate even when not cross-compiling. I didn't take that into account when writing the special case machine map code for add_*_arguments.

A separate problem (which I think was also present in @dcbaker's version) is that global arguments are resolved always with the toplevel Build object, because they are handled by the backend. This is fixed as well.

@bonzini bonzini added this to the 1.12 milestone Jul 13, 2026
@bonzini
bonzini force-pushed the qemu-machine-map branch 5 times, most recently from 84ee3c8 to 663e0d5 Compare July 14, 2026 09:45
@bonzini
bonzini marked this pull request as ready for review July 14, 2026 09:45
@bonzini
bonzini force-pushed the qemu-machine-map branch from 663e0d5 to c088d60 Compare July 14, 2026 10:21
bonzini added 3 commits July 14, 2026 13:17
Continue the job started by commit 687cb97 ("backends:
use Build.get_project_args", 2026-01-16).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Make this more consistent with get_project_*args.  Either way the arguments
are only used together with a build target.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Per-machine compiler arguments (whether global or project) are separated
for "native: true" and "native: false" targets.  This means that it is
incorrect to simply drop them for "native: true" targets when not cross
compiling.

Instead, the BuildTarget needs to know the *original* value of native and
use it to apply the correct set of arguments.

Start by adding all the infrastructure and handling project arguments.
Global arguments need more care; they are not yet fully fixed.
@bonzini
bonzini force-pushed the qemu-machine-map branch from c088d60 to c1f7325 Compare July 14, 2026 11:18

@dblsaiko dblsaiko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm this fixes the original compilation failure. 🎉

Thank you for this and the original native subprojects patch set!

bonzini added 4 commits July 15, 2026 08:58
Reduced from QEMU.

Reported-by: Katalin Rebhan <me@dblsaiko.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Per-machine compiler arguments (whether global or project) are separated
for "native: true" and "native: false" targets.  This means that it is
incorrect to simply drop them for "native: true" targets when not cross
compiling.

For global arguments, the BuildTarget needs to whether "native: true"
appeared in the *original* value of native as well as in any subproject
call.
@bonzini
bonzini force-pushed the qemu-machine-map branch from c1f7325 to 0bc675d Compare July 15, 2026 07:44
Only apply machine map in the leaf functions, which are _dependency_method_impl
and Interpreter.build_target.  dependency_method was not applying it while
extension_module_method was doing it too early (resulting in double application
later in build_target).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
@bonzini
bonzini force-pushed the qemu-machine-map branch from 0bc675d to 2b99628 Compare July 15, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants