Add zig cc support for LLVM flag --no-undefined-version #17326
Conversation
|
Thanks for working on this. What does this do? The ld --help menu isn't particularly helpful: |
You will need to add a case in
Looking at the man pages of gcc and clang, I think this is the only valid way to call it (via After you've built zig, you can poke at it: ... and then observe that the flag is present in the line that starts with
from gcc man page: Also a relevant lld commit: https://reviews.llvm.org/D135402 |
Co-authored-by: Motiejus Jakštys <motiejus@jakstys.lt>
…hS/zig into add-no-undefined-version-linker-arg
|
Thanks for the pointer to that commit @motiejus i've done as requested |
…hS/zig into add-no-undefined-version-linker-arg
motiejus
left a comment
There was a problem hiding this comment.
I am leaving the suggestion "strange" with double-negatives (i.e. no_undefined_version instead of undefined_version), because that's the exact flag that man ld offers.
Co-authored-by: Motiejus Jakštys <motiejus@jakstys.lt>
Co-authored-by: Motiejus Jakštys <motiejus@jakstys.lt>
Co-authored-by: Motiejus Jakštys <motiejus@jakstys.lt>
Co-authored-by: Motiejus Jakštys <motiejus@jakstys.lt>
|
makes sense, yeah i can't imagine a case where you're specifying both of them and it's correct. |
|
Cool, now that i know what you're looking for, i'll give this PR a once over in the morning to make sure it's decent given the back and forth. |
|
I am also thinking that I might start requiring folks enabling new linker features to come up with linker tests and them here. This will help me in the long run as I will be able to simply change the test case from |
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
|
In my understanding, things that y'all would like
|
You are very close. What's missing:
@kubkon I totally see why this would make sense, but I think it's unfair to ask to write such test for newcomers: @DhashS already is shaving the n'th yak by coming from from hermetic_cc_toolchain, because his builds stopped working after Rust upgrade (when it started using this new flag). Even though I feel like I know something in Zig by now (both the language and how it's wired up), I would certainly spend more than a day writing such test. So it would be nice to have, but perhaps too early or much to ask. |
…hS/zig into add-no-undefined-version-linker-arg
|
sorry, took me a second to figure out what y'all meant. |
|
Looks good to me, but I am not the one deciding what goes to master and when. :) Anyhow, looks like it is failing CI checks due to compile errors. |
|
yeah I think I've spotted why CI is failing cc @DhashS |
Co-authored-by: Samuel Cantero <scanterog@gmail.com>
Co-authored-by: Samuel Cantero <scanterog@gmail.com>
|
👋 @kubkon it looks like there are some updates in the PR which might solve the CI issues. |
|
would really like to get this merged so that we can bump our rust version :) |
|
All linux tests are failing, it is easier to get attention with a working CI. |
|
@DhashS looks like a formatting error I think this is what's picked up in CI. You can run |
|
@DhashS since only some formatting seems to be blocking this PR and it's been pending for a while now, if you don't have time to update it I can create another fork from your branch and reopen it after running |
I'm pretty sure this is not all I need to do, so would appreciate some guidance from the broader zig community.
This issue is what i'm trying to tackle #16855 by punching that flag through to LLVM.
I've also seen it invoked as
-Wl,--no-undefined-version, so i'm wondering if to parse it in the .Wl section as well. I didn't initially since it seems like there's a catch-all append call that gets parsed where I specified.