Skip to content

Commit 1990014

Browse files
committed
Change the triple during static musl tcl builds to get past duplicate definition error
1 parent 4385eb8 commit 1990014

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

cpython-unix/build-tcl.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ export PKG_CONFIG_PATH=${TOOLS_PATH}/deps/share/pkgconfig:${TOOLS_PATH}/deps/lib
1313
tar -xf tcl${TCL_VERSION}-src.tar.gz
1414
pushd tcl${TCL_VERSION}
1515

16+
17+
if [ -n "${STATIC}" ]; then
18+
if echo "${TARGET_TRIPLE}" | grep -q -- "-unknown-linux-musl"; then
19+
# tcl misbehaves when performing static musl builds
20+
# `checking whether musl-clang accepts -g...` fails with a duplicate definition error
21+
TARGET_TRIPLE="$(echo "${TARGET_TRIPLE}" | sed -e 's/-unknown-linux-musl/-unknown-linux-gnu/g')"
22+
fi
23+
fi
24+
1625
patch -p1 << 'EOF'
1726
diff --git a/unix/Makefile.in b/unix/Makefile.in
1827
--- a/unix/Makefile.in

cpython-unix/build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ def build_tix(
417417
"TK_VERSION": DOWNLOADS["tk"]["version"],
418418
}
419419

420+
if "static" in build_options:
421+
env["STATIC"] = 1
422+
420423
add_target_env(env, host_platform, target_triple, build_env)
421424

422425
build_env.run("build-tix.sh", environment=env)

0 commit comments

Comments
 (0)