[botan] Add arm64-windows support (#26156)

* Fix botan:arm64-windows

* Add version

* Add no support for arm-uwp

* Fix SHA for botan

Co-authored-by: Nursultan Zarlyk <nzarlyk@microsoft.com>
This commit is contained in:
Nursultan Zarlyk 2022-08-06 08:35:40 +02:00 committed by GitHub
parent 3cd26e8f4e
commit 5843d817ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,23 @@
diff --git a/src/lib/utils/mul128.h b/src/lib/utils/mul128.h
index 8cdaae2..54bb670 100644
--- a/src/lib/utils/mul128.h
+++ b/src/lib/utils/mul128.h
@@ -39,10 +39,15 @@ namespace Botan {
#elif defined(BOTAN_BUILD_COMPILER_IS_MSVC) && defined(BOTAN_TARGET_CPU_HAS_NATIVE_64BIT)
#include <intrin.h>
-#pragma intrinsic(_umul128)
-
-#define BOTAN_FAST_64X64_MUL(a,b,lo,hi) \
+#if defined(_M_ARM64)
+ #pragma intrinsic(__umulh)
+ #define BOTAN_FAST_64X64_MUL(a,b,lo,hi) \
+ do { *lo = a * b; *hi = __umulh(a, b); } while(0)
+#else
+ #pragma intrinsic(_umul128)
+ #define BOTAN_FAST_64X64_MUL(a,b,lo,hi) \
do { *lo = _umul128(a, b, hi); } while(0)
+#endif
#elif defined(BOTAN_USE_GCC_INLINE_ASM)

View File

@ -7,6 +7,7 @@ vcpkg_from_github(
PATCHES
fix-generate-build-path.patch
embed-debug-info.patch
arm64-windows.patch
)
if(CMAKE_HOST_WIN32)

View File

@ -1,10 +1,11 @@
{
"name": "botan",
"version": "2.19.1",
"port-version": 1,
"description": "A cryptography library written in C++11",
"homepage": "https://botan.randombit.net",
"license": "BSD-2-Clause",
"supports": "!(windows & arm)",
"supports": "!(arm & uwp)",
"features": {
"amalgamation": {
"description": "Do an amalgamation build of the library"

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "46addf1e5297d40d351cf84d2a62d831592df1d1",
"version": "2.19.1",
"port-version": 1
},
{
"git-tree": "3fb61b05e32ed52193542dd9d5b86b7e2021dd99",
"version": "2.19.1",

View File

@ -1146,7 +1146,7 @@
},
"botan": {
"baseline": "2.19.1",
"port-version": 0
"port-version": 1
},
"box2d": {
"baseline": "2.4.1",