From 133692477c7d6d8f48a81fb6cceb300fa5c9cf65 Mon Sep 17 00:00:00 2001 From: Richard Townsend Date: Fri, 22 May 2020 11:37:39 +0100 Subject: [PATCH 1/2] tools: fix GetCurrentThreadStackLimits error on Windows on Arm GetCurrentThreadStackLimits is a fairly new API, so it requires a _WIN32_WINNT value of at least 0x0602 to compile successfully. Change-Id: Ib3bc24513453aa37bee68f4a6999cefc26947cb1 --- tools/v8_gypfiles/v8.gyp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index af2ff9c602e432..67f21729677b6f 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1073,8 +1073,10 @@ '<(V8_ROOT)/src/base/platform/platform-win32.cc', '<(V8_ROOT)/src/base/win32-headers.h', ], - - 'defines': ['_CRT_RAND_S'], # for rand_s() + 'conditions': [['target_arch == "arm64"', { + 'defines': ['_WIN32_WINNT=0x0602'], # For GetCurrentThreadStackLimits on Windows on Arm + }]], + 'defines': ['_CRT_RAND_S'], # for rand_s() 'direct_dependent_settings': { 'msvs_settings': { 'VCLinkerTool': { From 7725262c107d99db615343f5747dd089d00fbcf3 Mon Sep 17 00:00:00 2001 From: Richard Townsend Date: Fri, 22 May 2020 11:40:13 +0100 Subject: [PATCH 2/2] fix: zlib build error on Windows on Arm Zlib's SIMD optimizations are not supported in MSVC, so fall back to the C versions for now. Change-Id: I011134f5680719e8fc246b8c660ececf0c596fd8 --- tools/v8_gypfiles/v8.gyp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 67f21729677b6f..347847b63cf61f 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1642,7 +1642,13 @@ 'toolsets': ['host', 'target'], }], ['OS=="win"', { - 'defines': ['X86_WINDOWS'], + 'conditions': [ + ['"<(target_arch)"=="arm64" and _toolset=="target"', { + 'defines': ['CPU_NO_SIMD'] + }, { + 'defines': ['X86_WINDOWS'] + }] + ] }], ], 'direct_dependent_settings': {