rust: hide away libz and friends for all arches

Seems that libz is pulled in when building host tools.
This commit is contained in:
Henrik Grimler 2021-10-26 07:59:53 +02:00
parent 38a9375fb3
commit 7077e1d8a7

View File

@ -47,14 +47,12 @@ termux_step_configure() {
# we can't use -L$PREFIX/lib since it breaks things but we need to link against libLLVM-9.so
ln -sf $PREFIX/lib/libLLVM-$LLVM_VERSION.so $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/
# rust checks libs in PREFIX/lib because both host and target are x86_64. It then can't find libc.so and libdl.so because rust program doesn't
# rust checks libs in PREFIX/lib. It then can't find libc.so and libdl.so because rust program doesn't
# know where those are. Putting them temporarly in $PREFIX/lib prevents that failure
if [ $TERMUX_ARCH = "x86_64" ]; then
mv $TERMUX_PREFIX/lib/libtinfo.so.6 $TERMUX_PREFIX/lib/libtinfo.so.6.tmp
mv $TERMUX_PREFIX/lib/libz.so.1 $TERMUX_PREFIX/lib/libz.so.1.tmp
mv $TERMUX_PREFIX/lib/libz.so $TERMUX_PREFIX/lib/libz.so.tmp
fi
}
termux_step_make() {
@ -77,11 +75,9 @@ termux_step_make_install() {
cd "$TERMUX_PREFIX/lib"
rm -f libc.so libdl.so
if [ $TERMUX_ARCH = "x86_64" ]; then
mv $TERMUX_PREFIX/lib/libtinfo.so.6.tmp $TERMUX_PREFIX/lib/libtinfo.so.6
mv $TERMUX_PREFIX/lib/libz.so.1.tmp $TERMUX_PREFIX/lib/libz.so.1
mv $TERMUX_PREFIX/lib/libz.so.tmp $TERMUX_PREFIX/lib/libz.so
fi
ln -sf rustlib/$CARGO_TARGET_NAME/lib/*.so .
ln -sf $TERMUX_PREFIX/bin/lld $TERMUX_PREFIX/bin/rust-lld
@ -97,10 +93,8 @@ termux_step_make_install() {
}
termux_step_post_massage() {
if [ $TERMUX_ARCH = "x86_64" ]; then
rm -f lib/libtinfo.so.6
rm -f lib/libz.so
rm -f lib/libz.so.1
fi
}