-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 linking for symbols starting with ? on i686-pc-windows-msvc #130808
base: master
Are you sure you want to change the base?
Fix linking for symbols starting with ? on i686-pc-windows-msvc #130808
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @TaKO8Ki (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Just tested this patch with |
cc @bjorn3, @petrochenkov and @ChrisDenton, in case anyone has any clues about this 😅 |
Rerolling a reviewer. r? compiler |
@checkraisefold |
This comment has been minimized.
This comment has been minimized.
a79b6c2
to
2ec1dce
Compare
2ec1dce
to
6994ee3
Compare
This PR modifies cc @jieyouxu |
Apologies for the time it took to get to this - aside from being busy, for a relative Rust newbie (and contributing to the compiler, lol) especially the testing harness is very intimidating and it takes a while to iterate on my beautiful Ryzen 5 3600. I was hoping to be able to fit this into a |
This comment has been minimized.
This comment has been minimized.
c84f1b7
to
a4c628c
Compare
Seeing as the test no longer sucks- Additionally, run-make label can be removed |
r? compiler (assigned reviewer is on holiday) |
When using the
export_name
attribute to specifically export a symbol beginning with a question mark on thei686-pc-windows-msvc
target, that symbol will fail to link and throw a linker error 100% of the time.Issue writeup.
Closes #44282
I'm not sure if this is a proper solution, but LLVM does the same check which causes this issue, and is applied to all 32- and 64-bit Windows COFF objects (maybe the same patch should be applied for 64 bit windows as well then?). I am more unsure of whether this is the proper place for such a solution (and if the exact conditions of is_like_windows are proper for this usecase), or if the underscore should be stripped elsewhere, but it seems like the most correct place.
I'm also unsure if there are any backwards compatibility ramifications here. There shouldn't be, because binaries with exported symbols starting with
?
for this target failed to link because of this issue anyway, but still.