Uh oh!
There was an error while loading. Please reload this page.
Fix linking for symbols starting with ? on i686-pc-windows-msvc - #130808
Fix linking for symbols starting with ? on i686-pc-windows-msvc#130808checkraisefold wants to merge 7 commits into
Conversation
rustbot
commented
Sep 25, 2024
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 (
|
checkraisefold
commented
Sep 25, 2024
Just tested this patch with |
jieyouxu
commented
Sep 25, 2024
cc @bjorn3, @petrochenkov and @ChrisDenton, in case anyone has any clues about this 😅 |
Uh oh!
There was an error while loading. Please reload this page.
jieyouxu
commented
Nov 16, 2024
Rerolling a reviewer. r? compiler |
alex-semenyuk
commented
Dec 28, 2024
@checkraisefold |
This comment has been minimized.
This comment has been minimized.
a79b6c2 to
2ec1dceCompare2ec1dce to
6994ee3Comparerustbot
commented
Dec 31, 2024
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
a4c628cCompareSeeing as the test no longer sucks- Additionally, run-make label can be removed |
matthiaskrgr
commented
Jan 25, 2025
jieyouxu
commented
Jan 31, 2025
Oh I guess this wasn't actually r+'d @bors r=davidtwco |
bors
commented
Jan 31, 2025
…ing, r=davidtwco Fix linking for symbols starting with ? on i686-pc-windows-msvc When using the `export_name` attribute to specifically export a symbol beginning with a question mark on the `i686-pc-windows-msvc` target, that symbol will fail to link and throw a linker error 100% of the time. [Issue writeup.](rust-lang#44282 (comment)) Closesrust-lang#44282 I'm not sure if this is a proper solution, but [LLVM does the same check](https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/Mangler.cpp#L48-L49) which causes this issue, and is applied to [all 32- and 64-bit Windows COFF objects](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/DataLayout.h#L255-L257) (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. try-job: i686-mingw
bors
commented
Jan 31, 2025
This comment has been minimized.
This comment has been minimized.
bors
commented
Jan 31, 2025
💔 Test failed - checks-actions |
…nking, r=davidtwco Fix linking for symbols starting with ? on i686-pc-windows-msvc When using the `export_name` attribute to specifically export a symbol beginning with a question mark on the `i686-pc-windows-msvc` target, that symbol will fail to link and throw a linker error 100% of the time. [Issue writeup.](rust-lang#44282 (comment)) Closesrust-lang#44282 I'm not sure if this is a proper solution, but [LLVM does the same check](https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/Mangler.cpp#L48-L49) which causes this issue, and is applied to [all 32- and 64-bit Windows COFF objects](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/DataLayout.h#L255-L257) (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. try-job: i686-mingw
…nking, r=davidtwco Fix linking for symbols starting with ? on i686-pc-windows-msvc When using the `export_name` attribute to specifically export a symbol beginning with a question mark on the `i686-pc-windows-msvc` target, that symbol will fail to link and throw a linker error 100% of the time. [Issue writeup.](rust-lang#44282 (comment)) Closesrust-lang#44282 I'm not sure if this is a proper solution, but [LLVM does the same check](https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/Mangler.cpp#L48-L49) which causes this issue, and is applied to [all 32- and 64-bit Windows COFF objects](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/DataLayout.h#L255-L257) (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. try-job: i686-mingw
jieyouxu
commented
May 9, 2025
@bors r- |
checkraisefold
commented
May 9, 2025
Haven't gotten around to looking into this yet - my test fails with and without the actual compiler changes on that target. Will have to take a closer look at what the linker is doing |
rustbot
commented
May 11, 2025
Some changes occurred in compiler/rustc_codegen_ssa |
rustbot
commented
May 11, 2025
|
alex-semenyuk
commented
Oct 2, 2025
@checkraisefold |
bors
commented
Nov 5, 2025
☔ The latest upstream changes (presumably #147645) made this pull request unmergeable. Please resolve the merge conflicts. |
alex-semenyuk
commented
Nov 23, 2025
@checkraisefold |
When using the
export_nameattribute to specifically export a symbol beginning with a question mark on thei686-pc-windows-msvctarget, 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.