Re: [PATCH] selftests/nolibc: don't download GCC toolchain for clang-only architectures

From: Willy Tarreau

Date: Mon Nov 02 2026 - 03:05:53 EST


Hi Thomas!

On Mon, Nov 02, 2026 at 03:19:59AM +0000, Thomas Weißschuh wrote:
> If no GCC toolchain exists the download will fail.
>
> Fixes: 4b4f56583850 ("selftests/nolibc: prepare for clang-only architectures")
> Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
> ---
> tools/testing/selftests/nolibc/run-tests.sh | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/testing/selftests/nolibc/run-tests.sh b/tools/testing/selftests/nolibc/run-tests.sh
> index 2844fed26df1..cc91b8656b20 100755
> --- a/tools/testing/selftests/nolibc/run-tests.sh
> +++ b/tools/testing/selftests/nolibc/run-tests.sh
> @@ -144,6 +144,9 @@ need_gcc() {
> download_crosstool() {
> arch="$(crosstool_arch "$1")"
> abi="$(crosstool_abi "$1")"
> + gcc="$(need_gcc "$1")"
> +
> + [ -z "$gcc" ] && return

I know I'm picky, but this expression leaves in error in "$?" on success
(i.e. if we'd ever want to use set -e it would detect a failure when gcc
is set). A cleaner approach is to write it as an assert using "||":

[ -n "$gcc" ] || return

This one either fails '-n "$gcc"' and triggers the return or suceeds
and leaves a successful return code.

> archive_name="${hostarch}-gcc-${crosstool_version}-nolibc-${arch}-${abi}.tar.gz"
> url="https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${hostarch}/${crosstool_version}/${archive_name}";
>
> ---
> base-commit: 228a318052869ab08f01f53b5cedfae0e930f6dd
> change-id: 20261102-nolibc-gcc-download-7c72df57961a

I'm fine with the change whatever its form anyway.

Reviewed-by: Willy Tarreau <w@xxxxxx>

thanks!
Willy