Do not put RUSTFLAGS into rust_link_args#15627
Open
bonzini wants to merge 3 commits intomesonbuild:masterfrom
Open
Do not put RUSTFLAGS into rust_link_args#15627bonzini wants to merge 3 commits intomesonbuild:masterfrom
bonzini wants to merge 3 commits intomesonbuild:masterfrom
Conversation
Instead of monkeypatching the compiler, just check that the compiler (whichever it is) does the right thing for its INVOKES_LINKER setting. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Use a name that can be applied to rustc as well (because RUSTFLAGS need not be added to rust_link_args and in fact it breaks). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Also add a test which is a copy of basic with RUSTFLAGS set. Test case by tytan652 <tytan652@tytanium.xyz>. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Environment.add_lang_argsaddsRUSTFLAGStorust_link_argsjust like it does so forCFLAGS. However, this breaks compilation because RustCompiler treats linker arguments specially by prepending-Clink-arg=to them.For Rust specifically, the compiler and linker invocations are one and the same and there's no separate
-cphase; therefore, havingRUSTFLAGSin bothrust_argsandrust_link_argsis pointless.This is handled just fine by the existing
INVOKES_LINKERattribute ofCompiler, but the name does not really apply to rustc so rename it as a preparatory step.This has the same purpose as #15621, which however has a broader impact—the contents of the
rust_link_argsoption lose the-Clink-arg=prefix altogether, which I think is unwanted because it makesadd_project_link_argumentsbehave differently fromrust_link_args.