Skip to content

Commit b7b4945

Browse files
committed
udpate yek
1 parent 86a699a commit b7b4945

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

public/yek.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,22 @@ ARCH=$(uname -m)
4040

4141
case "${OS}_${ARCH}" in
4242
Linux_x86_64)
43-
TARGET="x86_64-unknown-linux-gnu"
43+
# Check glibc version
44+
GLIBC_VERSION=$(ldd --version 2>&1 | head -n1 | grep -oP 'GLIBC \K[\d.]+' || echo "")
45+
if [ -z "$GLIBC_VERSION" ] || [ "$(printf '%s\n' "2.31" "$GLIBC_VERSION" | sort -V | head -n1)" = "$GLIBC_VERSION" ]; then
46+
TARGET="x86_64-unknown-linux-musl"
47+
else
48+
TARGET="x86_64-unknown-linux-gnu"
49+
fi
50+
;;
51+
Linux_aarch64)
52+
# Check glibc version for ARM64
53+
GLIBC_VERSION=$(ldd --version 2>&1 | head -n1 | grep -oP 'GLIBC \K[\d.]+' || echo "")
54+
if [ -z "$GLIBC_VERSION" ] || [ "$(printf '%s\n' "2.31" "$GLIBC_VERSION" | sort -V | head -n1)" = "$GLIBC_VERSION" ]; then
55+
TARGET="aarch64-unknown-linux-musl"
56+
else
57+
TARGET="aarch64-unknown-linux-gnu"
58+
fi
4459
;;
4560
Darwin_x86_64)
4661
TARGET="x86_64-apple-darwin"

0 commit comments

Comments
 (0)