From 1ec5687d36f35b5baad048843aa444df68b250cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Fri, 22 Apr 2022 11:08:19 +0300 Subject: [PATCH] mdbx: fix build for ARM/ARM64 by MSVC. --- CMakeLists.txt | 2 +- src/lck-windows.c | 4 ++-- test/utils.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 58ad38ce..1cc50da2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -611,7 +611,7 @@ endmacro() macro(libmdbx_setup_libs TARGET MODE) target_link_libraries(${TARGET} ${MODE} Threads::Threads) if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - target_link_libraries(${TARGET} ${MODE} ntdll) + target_link_libraries(${TARGET} ${MODE} ntdll advapi32) if(MDBX_NTDLL_EXTRA_IMPLIB AND MDBX_WITHOUT_MSVC_CRT) target_link_libraries(${TARGET} ${MODE} ntdll_extra) endif() diff --git a/src/lck-windows.c b/src/lck-windows.c index 62500709..6ba3f3a9 100644 --- a/src/lck-windows.c +++ b/src/lck-windows.c @@ -72,7 +72,7 @@ static # pragma const_seg(push) # pragma data_seg(push) -# ifdef _WIN64 +# ifndef _M_IX86 /* kick a linker to create the TLS directory if not already done */ # pragma comment(linker, "/INCLUDE:_tls_used") /* Force some symbol references. */ @@ -94,7 +94,7 @@ static # pragma const_seg(pop) #elif defined(__GNUC__) -# ifdef _WIN64 +# ifndef _M_IX86 const # endif PIMAGE_TLS_CALLBACK mdbx_tls_anchor __attribute__((__section__(".CRT$XLB"), used)) = mdbx_module_handler; diff --git a/test/utils.h b/test/utils.h index 57e79dcc..dd52dc00 100644 --- a/test/utils.h +++ b/test/utils.h @@ -50,7 +50,7 @@ #define rot64(v, s) _rotr64(v, s) #define rot32(v, s) _rotr(v, s) -#if defined(_M_ARM64) || defined(_M_X64) || defined(_M_IA64) +#if defined(_M_X64) || defined(_M_IA64) #pragma intrinsic(_umul128) #define mul_64x64_128(a, b, ph) _umul128(a, b, ph) #pragma intrinsic(__umulh)