-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Enable function sections with windows-gnu #75604
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
With MinGW and specific flags symbol may end up in multiple sections in some cases like: 0000000000000000 p .pdata$_ZN20stable_symbol_names113mono_function17hd4880e88dec8766dE 0000000000000000 t .text$_ZN20stable_symbol_names113mono_function17hd4880e88dec8766dE 0000000000000000 r .xdata$_ZN20stable_symbol_names113mono_function17hd4880e88dec8766dE 0000000000000000 T _ZN20stable_symbol_names113mono_function17hd4880e88dec8766dE This will cause an error when comparing that output directly with other library that only imports the symbol since it will appear only once. To avoid the issue pass "-g" to nm so only the global symbol (the one with "T" letter) will be listed.
14ee44a
to
b655027
Compare
IIRC the reason it was disabled until now was because on Windows there's an egregiously small limit on sections in object files, which then leads to compilation failures. Is |
Apparently it was disabled because of the LLVM assertions: #13846 I have tried enabling it some time ago but got ui tests crashes. |
FWIW, the limit on sections in an object file is higher if compiling in "big object" mode. IIRC GCC and/or MSVC require you to pass specific flags for enabling this, while LLVM enables this format automatically as needed. |
r? @nagisa |
@bors r+ |
📌 Commit b655027 has been approved by |
⌛ Testing commit b655027 with merge 18dd0795f6aecafa408c6b35e9b28d2798a6ea8a... |
💔 Test failed - checks-actions |
Appears to be bug fixed in binutils 2.32 I'll look for a workaround. |
I can reproduce it locally with the same Binutils version as on CI, Binutils 2.34 are not affected. @mstorsjo do you remember if this is easily workaroundable in LLVM? |
What issue in particular are you referring to here? |
@mstorsjo I apologize I thought I had included the link. Here is ld.bfd bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=23872
|
Ah, that one. I have one potential fix in mind - appending a final object file that contains .rdata contents that is aligned to 4 bytes, included as the last object file in the link command. The object file can be assembled from e.g. this:
That should take care to make sure the end of the .rdata section is aligned to 4 bytes, avoiding that particular ld bug. |
Unfortunately that didn't work. I'll just close it for now. |
Passed tests locally on x86_64 with LLVM assertions enabled.