@@ -141,12 +141,17 @@ def exit_with_error(msg):
141
141
elif machine .endswith ('86' ):
142
142
ARCH = 'x86'
143
143
elif machine .startswith ('aarch64' ) or machine .lower ().startswith ('arm64' ):
144
- ARCH = 'aarch64'
144
+ if WINDOWS :
145
+ errlog ('No support for Windows on Arm, fallback to x64' )
146
+ ARCH = 'x86_64'
147
+ else :
148
+ ARCH = 'arm64'
145
149
elif machine .startswith ('arm' ):
146
150
ARCH = 'arm'
147
151
else :
148
152
exit_with_error ('unknown machine architecture: ' + machine )
149
153
154
+
150
155
# Don't saturate all cores to not steal the whole system, but be aggressive.
151
156
CPU_CORES = int (os .getenv ('EMSDK_NUM_CORES' , max (multiprocessing .cpu_count () - 1 , 1 )))
152
157
@@ -254,7 +259,7 @@ def vswhere(version):
254
259
program_files = os .environ ['ProgramFiles' ]
255
260
vswhere_path = os .path .join (program_files , 'Microsoft Visual Studio' , 'Installer' , 'vswhere.exe' )
256
261
# Source: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022
257
- tools_arch = 'ARM64' if ARCH == 'aarch64 ' else 'x86.x64'
262
+ tools_arch = 'ARM64' if ARCH == 'arm64 ' else 'x86.x64'
258
263
# The "-products *" allows detection of Build Tools, the "-prerelease" allows detection of Preview version
259
264
# of Visual Studio and Build Tools.
260
265
output = json .loads (subprocess .check_output ([vswhere_path , '-latest' , '-products' , '*' , '-prerelease' , '-version' , '[%s.0,%s.0)' % (version , version + 1 ), '-requires' , 'Microsoft.VisualStudio.Component.VC.Tools.' + tools_arch , '-property' , 'installationPath' , '-format' , 'json' ]))
@@ -1018,13 +1023,13 @@ def xcode_sdk_version():
1018
1023
def cmake_target_platform (tool ):
1019
1024
# Source: https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html#platform-selection
1020
1025
if hasattr (tool , 'arch' ):
1021
- if tool .arch == 'aarch64 ' :
1026
+ if tool .arch == 'arm64 ' :
1022
1027
return 'ARM64'
1023
1028
elif tool .arch == 'x86_64' :
1024
1029
return 'x64'
1025
1030
elif tool .arch == 'x86' :
1026
1031
return 'Win32'
1027
- if ARCH == 'aarch64 ' :
1032
+ if ARCH == 'arm64 ' :
1028
1033
return 'ARM64'
1029
1034
else :
1030
1035
return 'x64' if tool .bitness == 64 else 'Win32'
@@ -1033,7 +1038,7 @@ def cmake_target_platform(tool):
1033
1038
def cmake_host_platform ():
1034
1039
# Source: https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html#toolset-selection
1035
1040
arch_to_cmake_host_platform = {
1036
- 'aarch64 ' : 'ARM64' ,
1041
+ 'arm64 ' : 'ARM64' ,
1037
1042
'arm' : 'ARM' ,
1038
1043
'x86_64' : 'x64' ,
1039
1044
'x86' : 'x86'
@@ -1078,7 +1083,7 @@ def build_llvm(tool):
1078
1083
targets_to_build = 'WebAssembly;X86'
1079
1084
elif ARCH == 'arm' :
1080
1085
targets_to_build = 'WebAssembly;ARM'
1081
- elif ARCH == 'aarch64 ' :
1086
+ elif ARCH == 'arm64 ' :
1082
1087
targets_to_build = 'WebAssembly;AArch64'
1083
1088
else :
1084
1089
targets_to_build = 'WebAssembly'
@@ -1860,10 +1865,6 @@ def install_tool(self):
1860
1865
elif hasattr (self , 'git_branch' ):
1861
1866
success = git_clone_checkout_and_pull (url , self .installation_path (), self .git_branch )
1862
1867
elif url .endswith (ARCHIVE_SUFFIXES ):
1863
- global ARCH
1864
- if WINDOWS and ARCH == 'aarch64' :
1865
- errlog ('No support for Windows on Arm, fallback to x64' )
1866
- ARCH = 'x86_64'
1867
1868
success = download_and_unzip (url , self .installation_path (), filename_prefix = getattr (self , 'zipfile_prefix' , '' ))
1868
1869
else :
1869
1870
assert False , 'unhandled url type: ' + url
@@ -2010,7 +2011,7 @@ def find_latest_hash():
2010
2011
2011
2012
def resolve_sdk_aliases (name , verbose = False ):
2012
2013
releases_info = load_releases_info ()
2013
- if name == 'latest' and LINUX and ARCH == 'aarch64 ' :
2014
+ if name == 'latest' and LINUX and ARCH == 'arm64 ' :
2014
2015
print ("warning: 'latest' on arm64-linux may be slightly behind other architectures" )
2015
2016
name = 'latest-arm64-linux'
2016
2017
while name in releases_info ['aliases' ]:
@@ -2058,7 +2059,7 @@ def get_emscripten_releases_tot():
2058
2059
# may not be a build for the most recent ones yet; find the last
2059
2060
# that does.
2060
2061
arch = ''
2061
- if ARCH == 'aarch64 ' :
2062
+ if ARCH == 'arm64 ' :
2062
2063
arch = '-arm64'
2063
2064
for release in recent_releases :
2064
2065
url = emscripten_releases_download_url_template % (
0 commit comments