Skip to content

Commit fd04e37

Browse files
committed
Apply _blake2 musl fixes when doing non-static builds
1 parent 567768d commit fd04e37

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cpython-unix/build-cpython.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,8 @@ CONFIGURE_FLAGS="
381381
--without-ensurepip
382382
${EXTRA_CONFIGURE_FLAGS}"
383383

384-
if [ -n "${CPYTHON_STATIC}" ]; then
385-
CFLAGS="${CFLAGS} -static"
386-
CPPFLAGS="${CPPFLAGS} -static"
387-
LDFLAGS="${LDFLAGS} -static"
388-
PYBUILD_SHARED=0
389384

385+
if [ "${CC}" = "musl-clang" ]; then
390386
# In order to build the _blake2 extension module with SSE3+ instructions, we need
391387
# musl-clang to find headers that provide access to the intrinsics, as they are not
392388
# provided by musl. These are part of the include files that are part of clang.
@@ -400,6 +396,13 @@ if [ -n "${CPYTHON_STATIC}" ]; then
400396
fi
401397
cp "$h" /tools/host/include/
402398
done
399+
fi
400+
401+
if [ -n "${CPYTHON_STATIC}" ]; then
402+
CFLAGS="${CFLAGS} -static"
403+
CPPFLAGS="${CPPFLAGS} -static"
404+
LDFLAGS="${LDFLAGS} -static"
405+
PYBUILD_SHARED=0
403406
else
404407
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --enable-shared"
405408
PYBUILD_SHARED=1

0 commit comments

Comments
 (0)