This commit is contained in:
@@ -163,6 +163,43 @@ function install_packages() {
|
||||
# fi
|
||||
# }
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------
|
||||
# unwind for musl cross toolchains
|
||||
#----------------------------------------------------------------------------------------------------------
|
||||
|
||||
function install_unwind_musl() {
|
||||
local FULLARCH="$1"
|
||||
local ARCH="${FULLARCH%%-*}"
|
||||
local ARCH_SHORT_PREFIX="${FULLARCH%-*}"
|
||||
local MUSL_PATH="${INSTALL_DIR}/${FULLARCH}"
|
||||
[ -d "$MUSL_PATH" ] || _die "MUSL_PATH does not exist: $MUSL_PATH"
|
||||
|
||||
local BUILD_DIR="${SCRIPT_DIR}/build.$ARCH"
|
||||
PREVDIR="$PWD"
|
||||
rm -rf "$BUILD_DIR"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
cd "$BUILD_DIR"
|
||||
|
||||
local SYSROOT="$MUSL_PATH/${ARCH_SHORT_PREFIX}/sysroot"
|
||||
|
||||
LIBPATH="$MUSL_PATH/${ARCH_SHORT_PREFIX}/sysroot/usr/lib"
|
||||
[ -d "$LIBPATH" ] || LIBPATH="$MUSL_PATH/${ARCH_SHORT_PREFIX}/sysroot/usr/lib64"
|
||||
if [ -f "$LIBPATH/libunwind.a" ]; then
|
||||
echo "Unwind $ARCH is already installed"
|
||||
return
|
||||
fi
|
||||
|
||||
# download and install unwind
|
||||
git clone https://github.com/libunwind/libunwind.git
|
||||
cd libunwind
|
||||
autoreconf -i
|
||||
./configure --enable-static --disable-minidebuginfo --disable-zlibdebuginfo
|
||||
make -j
|
||||
${SUDOCMD:-} make install
|
||||
|
||||
cd "$PREVDIR"
|
||||
rm -rf "$BUILD_DIR"
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------
|
||||
# OpenSSL for musl cross toolchains
|
||||
@@ -251,6 +288,8 @@ function install_openssl_musl() {
|
||||
echo
|
||||
fi
|
||||
|
||||
rm -rf "$BUILD_DIR"
|
||||
|
||||
cd "$PREVDIR"
|
||||
|
||||
echo "OpenSSL built and installed for $FULLARCH"
|
||||
@@ -310,6 +349,7 @@ function install_musl() {
|
||||
check_path "$TOOLCHAIN"
|
||||
|
||||
install_openssl_musl "$TOOLCHAIN"
|
||||
install_unwind_musl "$TOOLCHAIN"
|
||||
done
|
||||
|
||||
# Clean up
|
||||
|
Reference in New Issue
Block a user