-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Update to ar_archive_writer 0.5.0 #145721
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
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred in compiler/rustc_codegen_ssa These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
How would that actually work? If you just do |
Let's take the example from the LLVM bug I posted above: For most arches this is mangled as So, with There are cases where 0.4.2 got the Arm64EC mangling correct, and those will now raise an error. |
If you do |
But if you use a simpler name where the old 0.4.2 algorithm happened to be correct, then it compiles correctly: https://rust.godbolt.org/z/dnhn64sqM but with 0.5.0 this will now raise an error. |
So basically before this PR there were cases where the name mangling was wrong for C++ on arm64ec when using raw-dylib and in those cases there was no workaround. And with this PR you simply can't correctly use C++ symbols with raw-dylib at all. |
Actually, the example that you provided works fine if you use I did some experiments with 0.4.2, and it did work correctly even with the incorrect Arm64EC mangling: turns out that we don't need the mangled name since the |
Ok, workaround in |
This updates
ar_archive_writer
to 0.5.0, which in turn was updated to match LLVM 20.1.8: rust-lang/ar_archive_writer#24As part of this, I refactored part of
SymbolWrapper.cpp
to pull common code that I was about to duplicate again into a new function.NOTE:
ar_archive_writer
does include a breaking change where it no longer supports mangling C++ mangled names for Arm64EC. For the Rust project, this means that anyone using theraw-dylib
feature will need to provide the Arm64EC mangled name for any C++ function when targeting Arm64EC (0.4.2 supported doing this, but the algorithm was wrong).r? @bjorn3