Skip to content

Commit

Permalink
feat: support compiling under arm64 architecture (#102)
Browse files Browse the repository at this point in the history
Co-authored-by: soulbird <[email protected]>
  • Loading branch information
soulbird and soulbird authored Apr 12, 2022
1 parent d5291f2 commit 08f1424
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions install-wasmtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
# limitations under the License.
#
set -euo pipefail -x
arch=$(uname -m | tr '[:upper:]' '[:lower:]')

ARCH=$arch
VER=v0.35.1
wget https://github.com/bytecodealliance/wasmtime/releases/download/${VER}/wasmtime-${VER}-x86_64-linux-c-api.tar.xz
tar -xvf ./wasmtime-${VER}-x86_64-linux-c-api.tar.xz > /dev/null
wget https://github.com/bytecodealliance/wasmtime/releases/download/${VER}/wasmtime-${VER}-${ARCH}-linux-c-api.tar.xz
tar -xvf ./wasmtime-${VER}-${ARCH}-linux-c-api.tar.xz > /dev/null
if [ -d wasmtime-c-api ]; then
rm -rf wasmtime-c-api
fi
mv wasmtime-${VER}-x86_64-linux-c-api wasmtime-c-api
mv wasmtime-${VER}-${ARCH}-linux-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
git clone https://github.com/bytecodealliance/wasmtime -b ${VER} --depth 1 \
Expand Down

0 comments on commit 08f1424

Please sign in to comment.