Skip to content

Commit

Permalink
Update wrapper script
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Anh Duong <anh.duong@kyber.network>
  • Loading branch information
vietanhduong committed Dec 27, 2023
1 parent 8a07798 commit 683e524
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions docker/llvm/wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ llvm-objcopy)
;;
esac

ARCH=$(uname -m)

case $ARCH in
i386 | x86_64)
BINARY="$BINARY-amd64"
;;
aarch64)
BINARY="$BINARY-arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
if [[ -z "$TARGETARCH" ]]; then
TARGETARCH=$(uname -m)
case $TARGETARCH in
i386 | x86_64)
BINARY="$BINARY-amd64"
;;
aarch64)
BINARY="$BINARY-arm64"
;;
*)
echo "Unsupported architecture: $TARGETARCH"
exit 1
;;
esac
else
# For CI or docker build while we can select the architecture
BINARY="$BINARY-$TARGETARCH"
fi

exec "$BINARY" "$@"

0 comments on commit 683e524

Please sign in to comment.