-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc: filter out empty linker args #10749
Conversation
Can you add a test for this? |
Added a test, but can't test it unfortunately, as |
@@ -0,0 +1,6 @@ | |||
-include ../tools.mk | |||
# Notice the space in the end, this emulates the output of pkg-config | |||
RUSTC_FLAGS = --link-args "-lc " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also just be a normal run-pass test, using the compile-flags
directive (docs), i.e.
<license block>
// Notice the space at the end, this emulates the output of pkg-config
// compile-flags:--linkargs "-lc "
fn main() {}
I'd guess that that is nicer than adding a Makefile etc, but I don't really know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that's much easier. Thanks, I'll update!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I tried that. Guess who has a problem with quoted comand line parameters: the test runner. I'm not sure if it's worth it to fix that or if the current makefile test suffices.
Could you squash these two commits together? Otherwise looks good to me! |
Squashed and force-pushed. |
This is inspired by a mystifying linker failure when using `pkg-config` to generate the linker args: `pkg-config` produces output that ends in a space, thus resulting in an empty linker argument. Also added some updates to the concerning error messages that helped spotting this bug.
This is inspired by a mystifying linker failure when using `pkg-config` to generate the linker args: `pkg-config` produces output that ends in a space, thus resulting in an empty linker argument. Also added some updates to the concerning error messages that helped spotting this bug.
Rustup r? `@ghost` changelog: none
This is inspired by a mystifying linker failure when using
pkg-config
togenerate the linker args:
pkg-config
produces output that ends in aspace, thus resulting in an empty linker argument.
Also added some updates to the concerning error messages that helped
spotting this bug.