weidai11 / cryptopp

free C++ class library of cryptographic schemes
https://cryptopp.com
Other
4.66k stars 1.47k forks source link

Fix build for Windows ARM64EC #1257

Open kobykahane opened 6 months ago

kobykahane commented 6 months ago

In MSVC, ARM64EC is a variant of the Windows ARM64 ABI that allows mixing native ARM64 code and emulated x64 code in the same process. It is useful, e.g., for programs that need to be able to load legacy x64 plugin DLLs. When building for ARM64EC, _M_X64 is defined and many x64 intrinsics are available for compatibility. All ARM64 intrinsics are still available and while _M_ARM64 is not defined, _M_ARM64EC is.

Changes include:

For the actual build, I've used cryptopp-cmake with some tweaks for ARM64EC detection. Verified by running the resulting ARM64EC build of cryptest.exe v on a Windows ARM64 device.