Skip to content

Commit 27e458b

Browse files
committed
selftests/nolibc: run-tests.sh: avoid overwriting CFLAGS_EXTRA
If the user specified their own CFLAGS_EXTRA these should not be overwritten by `-e`. Reviewed-by: Shuah Khan <[email protected]> Acked-by: Willy Tarreau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent 1bd75ae commit 27e458b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/testing/selftests/nolibc/run-tests.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ download_location="${cache_dir}/crosstools/"
1515
build_location="$(realpath "${cache_dir}"/nolibc-tests/)"
1616
perform_download=0
1717
test_mode=system
18-
CFLAGS_EXTRA="-Werror"
18+
werror=1
1919
archs="i386 x86_64 arm64 arm mips32le mips32be ppc ppc64 ppc64le riscv s390 loongarch"
2020

2121
TEMP=$(getopt -o 'j:d:c:b:a:m:peh' -n "$0" -- "$@")
@@ -69,7 +69,7 @@ while true; do
6969
test_mode="$2"
7070
shift 2; continue ;;
7171
'-e')
72-
CFLAGS_EXTRA=""
72+
werror=0
7373
shift; continue ;;
7474
'-h')
7575
print_usage
@@ -140,6 +140,9 @@ test_arch() {
140140
ct_abi=$(crosstool_abi "$1")
141141
cross_compile=$(realpath "${download_location}gcc-${crosstool_version}-nolibc/${ct_arch}-${ct_abi}/bin/${ct_arch}-${ct_abi}-")
142142
build_dir="${build_location}/${arch}"
143+
if [ "$werror" -ne 0 ]; then
144+
CFLAGS_EXTRA="$CFLAGS_EXTRA -Werror"
145+
fi
143146
MAKE=(make -j"${nproc}" XARCH="${arch}" CROSS_COMPILE="${cross_compile}" O="${build_dir}")
144147

145148
mkdir -p "$build_dir"

0 commit comments

Comments
 (0)