-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support x64-only symbols on ARM64EC #3732
Conversation
* Adds support for building the STL for the ARM64EC platform. (No testing yet, just build.) * Enable the `__std_init_once_meow` `ALTERNATENAME`s in `src/xonce2.cpp` on ARM64EC. Note that we continue not to use the `<mutex>` `ALTERNATENAME`s when compiling for ARM64EC - the linkage model is complicated - we only include the `ALTERNATENAME`s to support linking with object files built targeting x64. For example, linking x64 static libraries into an ARM64EC binary needs to work. * Isolate x86/x64-specific code in `src/vector_algorithms.cpp` so we can enable the non-vectorized fallback implementations for ARM64EC. Again, these aren't used when compiling for ARM64EC, but we need the symbols in the import lib to support linking with x64 object files. Fixes microsoft#3382
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for figuring out how to fix this major bug that was affecting several customers! 🛠️ 💡 😻 |
Will this be backported to 17.6/17.7? |
At this time, we have no plans to backport the fix. There's an escape hatch of disabling the vectorized algorithms when compiling the x64 object files. |
Thanks @StephanTLavavej. Unfortunately, in our case, we're not in a position to recompile the x64 static libraries we're attempting to consume in our ARM64EC build. If we were, we'd probably just rebuild them as ARM64 and wouldn't have opted for EC. Additionally, we're hitting the |
__std_init_once_meow
ALTERNATENAME
s insrc/xonce2.cpp
on ARM64EC. Note that we continue not to use the<mutex>
ALTERNATENAME
s when compiling for ARM64EC - the linkage model is complicated - we only include theALTERNATENAME
s to support linking with object files built targeting x64. For example, linking x64 static libraries into an ARM64EC binary needs to work.src/vector_algorithms.cpp
so we can enable the non-vectorized fallback implementations for ARM64EC. Again, these aren't used when compiling for ARM64EC, but we need the symbols in the import lib to support linking with x64 object files.Fixes #3382
Note that there's no test coverage here. We're close-but-not-ready to support testing of the STL on ARM64, but a ways away from being able to compile an object file for one platform and link it into a binary built for another. I did validate the fix on an ARM64 VM using files
test.cpp
:and
repro.cpp
:compiling
repro.cpp
for x64, and linking the resulting object withtest.cpp
(EDIT: built with/arm64EC
, of course). I performed this process once for each of/MT
,/MTd
,/MD
, and/MDd
and verified the resulting program linked and ran successfully. (Debug should make no difference, but paranoia never hurts.)