Skip to content

Commit 2875a78

Browse files
authored
Revert "bpo-42405: fix C extensions build on Windows ARM64 (GH-23399)"
This reverts commit cb7bc76.
1 parent cb7bc76 commit 2875a78

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

Lib/distutils/msvc9compiler.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
PLAT_TO_VCVARS = {
5555
'win32' : 'x86',
5656
'win-amd64' : 'amd64',
57-
'win-arm64' : 'arm64',
5857
}
5958

6059
class Reg:
@@ -343,7 +342,7 @@ def initialize(self, plat_name=None):
343342
if plat_name is None:
344343
plat_name = get_platform()
345344
# sanity check for platforms to prevent obscure errors later.
346-
ok_plats = 'win32', 'win-amd64', 'win-arm64'
345+
ok_plats = 'win32', 'win-amd64'
347346
if plat_name not in ok_plats:
348347
raise DistutilsPlatformError("--plat-name must be one of %s" %
349348
(ok_plats,))
@@ -372,9 +371,6 @@ def initialize(self, plat_name=None):
372371
vc_env = query_vcvarsall(VERSION, plat_spec)
373372

374373
self.__paths = vc_env['path'].split(os.pathsep)
375-
if plat_name == 'win-arm64':
376-
self.__paths = (
377-
vc_env['path'].replace('HostX64', 'HostX86').split(os.pathsep))
378374
os.environ['lib'] = vc_env['lib']
379375
os.environ['include'] = vc_env['include']
380376

@@ -389,12 +385,6 @@ def initialize(self, plat_name=None):
389385
self.lib = self.find_exe("lib.exe")
390386
self.rc = self.find_exe("rc.exe") # resource compiler
391387
self.mc = self.find_exe("mc.exe") # message compiler
392-
if plat_name == 'win-arm64':
393-
self.cc = self.cc.replace('HostX64', 'Hostx86')
394-
self.linker = self.linker.replace('HostX64', 'Hostx86')
395-
self.lib = self.lib.replace('HostX64', 'Hostx86')
396-
self.rc = self.rc.replace('x64', 'arm64')
397-
self.mc = self.mc.replace('x64', 'arm64')
398388
#self.set_path_env_var('lib')
399389
#self.set_path_env_var('include')
400390

@@ -644,17 +634,6 @@ def link(self,
644634
if extra_postargs:
645635
ld_args.extend(extra_postargs)
646636

647-
if get_platform() == 'win-arm64':
648-
ld_args_arm = []
649-
for ld_arg in ld_args:
650-
# VS tries to use the x86 linker
651-
ld_arg_arm = ld_arg.replace(r'\um\x86', r'\um\arm64')
652-
# A larger memory address is required on ARM64
653-
ld_arg_arm = ld_arg_arm.replace("0x1", "0x10")
654-
ld_args_arm += [ld_arg_arm]
655-
656-
ld_args = list(ld_args_arm)
657-
658637
self.mkpath(os.path.dirname(output_filename))
659638
try:
660639
self.spawn([self.linker] + ld_args)

Misc/NEWS.d/next/Windows/2020-11-23-10-14-03.bpo-42405.4vQUja.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)