we want to collect information which most recent hwcap is supported by a machine. The result should be a string like "x86-64-v2", "x86-64-v3", "x86-64-v4", "z13", "z14", "p9", "p10" depending on "ld-linux --help" output. The string should be empty for architectures without glibc hwcaps (currently armhf, arm64, i386, riscv64). The string should be empty if no specific hwcaps is supported (e.g. on a power8 machine). The string should be "N/A" (not available), when trying to run ld-linux on a release with glibc (<< 2.33).
Note that lexical sorting won't work for "p9", "p10".
if test -x /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2; then
lddynload=/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
elif test -x /lib/powerpc64le-linux-gnu/ld64.so.2; then
lddynload=/lib/powerpc64le-linux-gnu/ld64.so.2
elif test -x /lib/s390x-linux-gnu/ld64.so.1; then
lddynload=/lib/s390x-linux-gnu/ld64.so.1
fi
supported=
if [ -n "$lddynload" ]; then
$lddynload --help 2>&1 | awk '/^Subdirectories/,/^$/'
supported=$($lddynload --help 2>&1 | awk '/^Subdirectories/,/^$/' | awk '/supported/ {print $1}')
fi
Here, $supported has listed all supported hwcaps, not just the best supported one.
we want to collect information which most recent hwcap is supported by a machine. The result should be a string like "x86-64-v2", "x86-64-v3", "x86-64-v4", "z13", "z14", "p9", "p10" depending on "ld-linux --help" output. The string should be empty for architectures without glibc hwcaps (currently armhf, arm64, i386, riscv64). The string should be empty if no specific hwcaps is supported (e.g. on a power8 machine). The string should be "N/A" (not available), when trying to run ld-linux on a release with glibc (<< 2.33).
Note that lexical sorting won't work for "p9", "p10".
if test -x /lib/x86_ 64-linux- gnu/ld- linux-x86- 64.so.2; then /lib/x86_ 64-linux- gnu/ld- linux-x86- 64.so.2 e-linux- gnu/ld64. so.2; then /lib/powerpc64l e-linux- gnu/ld64. so.2 linux-gnu/ ld64.so. 1; then /lib/s390x- linux-gnu/ ld64.so. 1
lddynload=
elif test -x /lib/powerpc64l
lddynload=
elif test -x /lib/s390x-
lddynload=
fi
supported= es/,/^$ /' $($lddynload --help 2>&1 | awk '/^Subdirectori es/,/^$ /' | awk '/supported/ {print $1}')
if [ -n "$lddynload" ]; then
$lddynload --help 2>&1 | awk '/^Subdirectori
supported=
fi
Here, $supported has listed all supported hwcaps, not just the best supported one.