@@ -88,18 +88,20 @@ def add_target_env(env, build_platform, target_triple, build_env):
88
88
extra_host_cflags = []
89
89
extra_host_ldflags = []
90
90
91
- if build_platform == "linux_x86_64" :
91
+ if build_platform . startswith ( "linux_" ) :
92
92
machine = platform .machine ()
93
93
94
94
if machine == "aarch64" :
95
95
env ["BUILD_TRIPLE" ] = "aarch64-unknown-linux-gnu"
96
- else :
96
+ elif machine == "x86_64" :
97
97
env ["BUILD_TRIPLE" ] = "x86_64-unknown-linux-gnu"
98
98
env ["TARGET_TRIPLE" ] = (
99
99
target_triple .replace ("x86_64_v2-" , "x86_64-" )
100
100
.replace ("x86_64_v3-" , "x86_64-" )
101
101
.replace ("x86_64_v4-" , "x86_64-" )
102
102
)
103
+ else :
104
+ raise Exception ("unhandled Linux machine value: %s" % machine )
103
105
104
106
# This will make x86_64_v2, etc count as cross-compiling. This is
105
107
# semantically correct, since the current machine may not support
@@ -109,10 +111,6 @@ def add_target_env(env, build_platform, target_triple, build_env):
109
111
):
110
112
env ["CROSS_COMPILING" ] = "1"
111
113
112
- elif build_platform == "linux_aarch64" :
113
- env ["BUILD_TRIPLE" ] = "aarch64-unknown-linux-gnu"
114
- env ["TARGET_TRIPLE" ] = "aarch64-unknown-linux-gnu"
115
-
116
114
elif build_platform .startswith ("macos_" ):
117
115
machine = platform .machine ()
118
116
@@ -196,6 +194,8 @@ def add_target_env(env, build_platform, target_triple, build_env):
196
194
197
195
extra_host_cflags .extend (["-isysroot" , host_sdk_path ])
198
196
extra_host_ldflags .extend (["-isysroot" , host_sdk_path ])
197
+ else :
198
+ raise Exception ("unhandled build platform: %s" % build_platform )
199
199
200
200
env ["EXTRA_HOST_CFLAGS" ] = " " .join (extra_host_cflags )
201
201
env ["EXTRA_HOST_LDFLAGS" ] = " " .join (extra_host_ldflags )
@@ -505,7 +505,7 @@ def python_build_info(
505
505
binary_suffix = ""
506
506
507
507
if platform in ("linux_x86_64" , "linux_aarch64" ):
508
- arch = "aarch64" if platform == "linux_aarch64" else "x86_64"
508
+ arch = platform . removeprefix ( "linux_" )
509
509
510
510
bi ["core" ]["static_lib" ] = (
511
511
"install/lib/python{version}/config-{version}{binary_suffix}-{arch}-linux-gnu/libpython{version}{binary_suffix}.a" .format (
0 commit comments