File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,22 @@ ARCH=$(uname -m)
40
40
41
41
case " ${OS} _${ARCH} " in
42
42
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
44
59
;;
45
60
Darwin_x86_64)
46
61
TARGET=" x86_64-apple-darwin"
You can’t perform that action at this time.
0 commit comments