Skip to content

Commit 7b2a0a0

Browse files
committed
Debug bzip2 on static musl
1 parent bc3b60f commit 7b2a0a0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cpython-unix/build-bzip2.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ else
1515
AR=ar
1616
fi
1717

18+
# Copy compiler-rt builtins library for static aarch64-musl builds
19+
if [ "${TARGET_TRIPLE}" = "aarch64-unknown-linux-musl" ] && [ "${CC}" = "musl-clang" ] && [ -n "${STATIC}" ]; then
20+
# musl-clang eliminates default library search paths, so copy compiler-rt builtins to accessible location
21+
for lib in ${TOOLS_PATH}/${TOOLCHAIN}/lib/clang/*/lib/linux/libclang_rt.builtins-aarch64.a; do
22+
if [ -e "$lib" ]; then
23+
filename=$(basename "$lib")
24+
if [ -e "${TOOLS_PATH}/host/lib/${filename}" ]; then
25+
echo "warning: ${filename} already exists"
26+
fi
27+
cp "$lib" ${TOOLS_PATH}/host/lib/
28+
fi
29+
done
30+
fi
31+
1832
tar -xf bzip2-${BZIP2_VERSION}.tar.gz
1933

2034
pushd bzip2-${BZIP2_VERSION}

0 commit comments

Comments
 (0)