Skip to content

Commit c3694ba

Browse files
committed
exclude tcl strtoul substitute function
1 parent a2f176c commit c3694ba

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cpython-unix/build-tcl.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ export PKG_CONFIG_PATH=${TOOLS_PATH}/deps/share/pkgconfig:${TOOLS_PATH}/deps/lib
1919
tar -xf tcl${TCL_VERSION}-src.tar.gz
2020
pushd tcl${TCL_VERSION}
2121

22+
EXTRA_CONFIGURE=
2223

2324
if [ -n "${STATIC}" ]; then
2425
if echo "${TARGET_TRIPLE}" | grep -q -- "-unknown-linux-musl"; then
25-
# tcl misbehaves when performing static musl builds
26-
# `checking whether musl-clang accepts -g...` fails with a duplicate definition error
27-
TARGET_TRIPLE="$(echo "${TARGET_TRIPLE}" | sed -e 's/-unknown-linux-musl/-unknown-linux-gnu/g')"
26+
# tcl will use an internal implementation of certain POSIX function when
27+
# cross-compiling. The implementation of strtoul create multiple definitions
28+
# when linked against the static musl libc. Exclude the internal implementation.
29+
EXTRA_CONFIGURE="${EXTRA_CONFIGURE} tcl_cv_strtoul_unbroken=ok"
2830
fi
2931

3032
patch -p1 << 'EOF'
@@ -59,7 +61,8 @@ CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \
5961
--host=${TARGET_TRIPLE} \
6062
--prefix=/tools/deps \
6163
--enable-shared"${STATIC:+=no}" \
62-
--enable-threads
64+
--enable-threads \
65+
${EXTRA_CONFIGURE}
6366

6467
make -j ${NUM_CPUS} DYLIB_INSTALL_DIR=@rpath
6568
make -j ${NUM_CPUS} install DESTDIR=${ROOT}/out DYLIB_INSTALL_DIR=@rpath

0 commit comments

Comments
 (0)