Skip to content

Commit

Permalink
fix: libwasmtime.so not available under centos arm (#129)
Browse files Browse the repository at this point in the history
Co-authored-by: soulbird <zhaothree@gmail.com>
  • Loading branch information
soulbird and soulbird authored Sep 1, 2022
1 parent 5bb50d1 commit a98248c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions install-wasmtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ if [ -d wasmtime-c-api ]; then
rm -rf wasmtime-c-api
fi
mv wasmtime-${VER}-${ARCH}-${os}-c-api wasmtime-c-api
if echo "int main(void) {}" | gcc -o /dev/null -v -x c - &> /dev/stdout| grep collect | tr -s " " "\012" | grep musl; then
# build from source code if the libc is musl
if { echo "int main(void) {}" | gcc -o /dev/null -v -x c - &> /dev/stdout| grep collect | tr -s " " "\012" | grep musl; } \
|| ( [[ -f /etc/redhat-release ]] && [[ "$arch" = "aarch64" ]] ); then
# build from source code if the libc is musl or under centos aarch64
if ! command -v cargo > /dev/null; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
fi

git clone https://github.com/bytecodealliance/wasmtime -b ${VER} --depth 1 \
&& cd wasmtime \
&& git submodule update --init \
Expand Down

0 comments on commit a98248c

Please sign in to comment.