Skip to content

Commit 6b6f103

Browse files
committed
Properly toggle --enable-shared when building the musl toolchain
1 parent 88b335b commit 6b6f103

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

cpython-unix/build-musl.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,16 @@ index 4a6ebe4..0000000
8989
EOF
9090
fi
9191

92+
SHARED=
93+
if [ -n "${STATIC}" ]; then
94+
SHARED="--disable-shared"
95+
else
96+
SHARED="--enable-shared"
97+
fi
9298

9399
CFLAGS="${CFLAGS} -fPIC" CPPFLAGS="${CPPFLAGS} -fPIC" ./configure \
94100
--prefix=/tools/host \
95-
--enable-shared
101+
"${SHARED}"
96102

97103
make -j `nproc`
98104
make -j `nproc` install DESTDIR=/build/out

cpython-unix/build.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ def materialize_clang(host_platform: str, target_triple: str):
322322

323323

324324
def build_musl(client, image, host_platform: str, target_triple: str, build_options):
325-
musl = "musl-static" if "static" in build_options else "msul"
325+
static = "static" in build_options
326+
musl = "musl-static" if static else "msul"
326327
musl_archive = download_entry(musl, DOWNLOADS_PATH)
327328

328329
with build_environment(client, image) as build_env:
@@ -337,6 +338,9 @@ def build_musl(client, image, host_platform: str, target_triple: str, build_opti
337338
"TOOLCHAIN": "llvm",
338339
}
339340

341+
if static:
342+
env["STATIC"] = 1
343+
340344
build_env.run("build-musl.sh", environment=env)
341345

342346
build_env.get_tools_archive(

0 commit comments

Comments
 (0)