Commit 22ba81c5 authored by Thomas Weißschuh's avatar Thomas Weißschuh

selftests/nolibc: run-tests.sh: allow building through LLVM

The nolibc tests can now be properly built with LLVM.
Expose this through run-tests.sh.
Reviewed-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Acked-by: default avatarWilly Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20240807-nolibc-llvm-v2-15-c20f2f5fc7c2@weissschuh.netSigned-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
parent 8404af7e
...@@ -16,9 +16,10 @@ build_location="$(realpath "${cache_dir}"/nolibc-tests/)" ...@@ -16,9 +16,10 @@ build_location="$(realpath "${cache_dir}"/nolibc-tests/)"
perform_download=0 perform_download=0
test_mode=system test_mode=system
werror=1 werror=1
llvm=
archs="i386 x86_64 arm64 arm mips32le mips32be ppc ppc64 ppc64le riscv s390 loongarch" archs="i386 x86_64 arm64 arm mips32le mips32be ppc ppc64 ppc64le riscv s390 loongarch"
TEMP=$(getopt -o 'j:d:c:b:a:m:peh' -n "$0" -- "$@") TEMP=$(getopt -o 'j:d:c:b:a:m:pelh' -n "$0" -- "$@")
eval set -- "$TEMP" eval set -- "$TEMP"
unset TEMP unset TEMP
...@@ -42,6 +43,7 @@ Options: ...@@ -42,6 +43,7 @@ Options:
-b [DIR] Build location (default: ${build_location}) -b [DIR] Build location (default: ${build_location})
-m [MODE] Test mode user/system (default: ${test_mode}) -m [MODE] Test mode user/system (default: ${test_mode})
-e Disable -Werror -e Disable -Werror
-l Build with LLVM/clang
EOF EOF
} }
...@@ -71,6 +73,9 @@ while true; do ...@@ -71,6 +73,9 @@ while true; do
'-e') '-e')
werror=0 werror=0
shift; continue ;; shift; continue ;;
'-l')
llvm=1
shift; continue ;;
'-h') '-h')
print_usage print_usage
exit 0 exit 0
...@@ -143,7 +148,7 @@ test_arch() { ...@@ -143,7 +148,7 @@ test_arch() {
if [ "$werror" -ne 0 ]; then if [ "$werror" -ne 0 ]; then
CFLAGS_EXTRA="$CFLAGS_EXTRA -Werror" CFLAGS_EXTRA="$CFLAGS_EXTRA -Werror"
fi fi
MAKE=(make -j"${nproc}" XARCH="${arch}" CROSS_COMPILE="${cross_compile}" O="${build_dir}") MAKE=(make -j"${nproc}" XARCH="${arch}" CROSS_COMPILE="${cross_compile}" LLVM="${llvm}" O="${build_dir}")
mkdir -p "$build_dir" mkdir -p "$build_dir"
if [ "$test_mode" = "system" ] && [ ! -f "${build_dir}/.config" ]; then if [ "$test_mode" = "system" ] && [ ! -f "${build_dir}/.config" ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment