-
Notifications
You must be signed in to change notification settings - Fork 413
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
fix: lld-link (MSVC) fix flags including -l
prefix
#1958
Conversation
Just to make sure this isn't a discrepancy between
|
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.
Thanks so much for working on this!
Do you know if this correct for both msvc
and gnu
windows platforms?
d5e6cec
to
b78f216
Compare
Good catch @UebelAndre. You're right this is wrong for the While I was working on this, I noticed that a similar incompatible flag is being passed to GCC: if lib.alwayslink:
ret.extend(["-C", "link-arg=/WHOLEARCHIVE:%s" % get_preferred_artifact(lib, use_pic).path]) Just a thought, but it might be easier to eventually structure the code around "linker flavor" than "Windows"/"Darwin"/"Default". |
rust/private/rustc.bzl
Outdated
@@ -1748,7 +1748,7 @@ def _portable_link_flags(lib, use_pic, ambiguous_libs, get_lib_name, for_windows | |||
return [] if for_darwin else ["-lstatic=%s" % get_lib_name(artifact)] | |||
return [ | |||
"-lstatic=%s" % get_lib_name(artifact), | |||
"-Clink-arg=-l%s" % (get_lib_name(artifact) if not for_windows else artifact.basename), | |||
"-Clink-arg={}{}".format("-l" if not flavor_msvc else "", get_lib_name(artifact)) if not for_windows else "-Clink-arg={}".format(artifact.basename), |
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.
Style nit: Could you make a list that you conditionally append the right thing into? This conditional seems kinda long.
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.
Will do. Is the msvc_flavor
change okay or would it be better to curry in a reference to toolchain
and get rid of for_windows
and for_darwin
in favor of target_triple
checks?
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.
Hi! Would you be willing to do a rebase of these changes? 🙏
@UebelAndre of course 🙂 I'm just looking for guidance on:
|
|
e0b5eee
to
1e538e4
Compare
@UebelAndre in theory I've updated this as discussed. |
Do you have a way to test cross compiling from, say As for the build failure, looks like some infra failure? I'm not sure, if you make any new commit then it'll trigger new builds. If it doesn't pass then then I can ping some folks. |
Doesn't seem like an infra thing given that it fails for me locally. I'm not sure why Buildkite isn't showing any useful logs. This is the error I get locally (running on
The expanded command is:
And none of those files exist. There is a directory under Regarding testing I don't suppose any of this is ringing any bells? I can try to debug further if necessary. |
The error you're getting looks different. I filed #1965 to try and get CI fixed and seems like that might be the case? Wanna push one more commit and find out? |
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.
Awesome work! Thank you so much!
Fixes
rustc
passing a verbatim-l<library name>
tolld-link
(orlink.exe
) instead of just passing the library name.