mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Revert "bpo-42405: fix C extensions build on Windows ARM64 (GH-23399)" (#24753)
This reverts commit cb7bc76409
.
This commit is contained in:
parent
b225d91f0a
commit
fbf75b9997
2 changed files with 1 additions and 23 deletions
|
@ -54,7 +54,6 @@ else:
|
||||||
PLAT_TO_VCVARS = {
|
PLAT_TO_VCVARS = {
|
||||||
'win32' : 'x86',
|
'win32' : 'x86',
|
||||||
'win-amd64' : 'amd64',
|
'win-amd64' : 'amd64',
|
||||||
'win-arm64' : 'arm64',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Reg:
|
class Reg:
|
||||||
|
@ -343,7 +342,7 @@ class MSVCCompiler(CCompiler) :
|
||||||
if plat_name is None:
|
if plat_name is None:
|
||||||
plat_name = get_platform()
|
plat_name = get_platform()
|
||||||
# sanity check for platforms to prevent obscure errors later.
|
# sanity check for platforms to prevent obscure errors later.
|
||||||
ok_plats = 'win32', 'win-amd64', 'win-arm64'
|
ok_plats = 'win32', 'win-amd64'
|
||||||
if plat_name not in ok_plats:
|
if plat_name not in ok_plats:
|
||||||
raise DistutilsPlatformError("--plat-name must be one of %s" %
|
raise DistutilsPlatformError("--plat-name must be one of %s" %
|
||||||
(ok_plats,))
|
(ok_plats,))
|
||||||
|
@ -372,9 +371,6 @@ class MSVCCompiler(CCompiler) :
|
||||||
vc_env = query_vcvarsall(VERSION, plat_spec)
|
vc_env = query_vcvarsall(VERSION, plat_spec)
|
||||||
|
|
||||||
self.__paths = vc_env['path'].split(os.pathsep)
|
self.__paths = vc_env['path'].split(os.pathsep)
|
||||||
if plat_name == 'win-arm64':
|
|
||||||
self.__paths = (
|
|
||||||
vc_env['path'].replace('HostX64', 'HostX86').split(os.pathsep))
|
|
||||||
os.environ['lib'] = vc_env['lib']
|
os.environ['lib'] = vc_env['lib']
|
||||||
os.environ['include'] = vc_env['include']
|
os.environ['include'] = vc_env['include']
|
||||||
|
|
||||||
|
@ -389,12 +385,6 @@ class MSVCCompiler(CCompiler) :
|
||||||
self.lib = self.find_exe("lib.exe")
|
self.lib = self.find_exe("lib.exe")
|
||||||
self.rc = self.find_exe("rc.exe") # resource compiler
|
self.rc = self.find_exe("rc.exe") # resource compiler
|
||||||
self.mc = self.find_exe("mc.exe") # message compiler
|
self.mc = self.find_exe("mc.exe") # message compiler
|
||||||
if plat_name == 'win-arm64':
|
|
||||||
self.cc = self.cc.replace('HostX64', 'Hostx86')
|
|
||||||
self.linker = self.linker.replace('HostX64', 'Hostx86')
|
|
||||||
self.lib = self.lib.replace('HostX64', 'Hostx86')
|
|
||||||
self.rc = self.rc.replace('x64', 'arm64')
|
|
||||||
self.mc = self.mc.replace('x64', 'arm64')
|
|
||||||
#self.set_path_env_var('lib')
|
#self.set_path_env_var('lib')
|
||||||
#self.set_path_env_var('include')
|
#self.set_path_env_var('include')
|
||||||
|
|
||||||
|
@ -644,17 +634,6 @@ class MSVCCompiler(CCompiler) :
|
||||||
if extra_postargs:
|
if extra_postargs:
|
||||||
ld_args.extend(extra_postargs)
|
ld_args.extend(extra_postargs)
|
||||||
|
|
||||||
if get_platform() == 'win-arm64':
|
|
||||||
ld_args_arm = []
|
|
||||||
for ld_arg in ld_args:
|
|
||||||
# VS tries to use the x86 linker
|
|
||||||
ld_arg_arm = ld_arg.replace(r'\um\x86', r'\um\arm64')
|
|
||||||
# A larger memory address is required on ARM64
|
|
||||||
ld_arg_arm = ld_arg_arm.replace("0x1", "0x10")
|
|
||||||
ld_args_arm += [ld_arg_arm]
|
|
||||||
|
|
||||||
ld_args = list(ld_args_arm)
|
|
||||||
|
|
||||||
self.mkpath(os.path.dirname(output_filename))
|
self.mkpath(os.path.dirname(output_filename))
|
||||||
try:
|
try:
|
||||||
self.spawn([self.linker] + ld_args)
|
self.spawn([self.linker] + ld_args)
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
In distutils, add support for building C extensions on Windows ARM64.
|
|
Loading…
Add table
Add a link
Reference in a new issue