]> git.baikalelectronics.ru Git - kernel.git/commit
tools: Ignore errors from `which' when searching a GCC toolchain
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Tue, 1 Feb 2022 09:31:20 +0000 (09:31 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 1 Feb 2022 22:04:12 +0000 (23:04 +0100)
commitbbce9137e7a183a4275db8c83d34a057d3282b01
tree4fc170e24f566a4c27d1c38c2090dee22d2268c6
parent8278d8ecba1756359f8d7700200f13c54097f9fa
tools: Ignore errors from `which' when searching a GCC toolchain

When cross-building tools with clang, we run `which $(CROSS_COMPILE)gcc`
to detect whether a GCC toolchain provides the standard libraries. It is
only a helper because some distros put libraries where LLVM does not
automatically find them. On other systems, LLVM detects the libc
automatically and does not need this. There, it is completely fine not
to have a GCC at all, but some versions of `which' display an error when
the command is not found:

  which: no aarch64-linux-gnu-gcc in ($PATH)

Since the error can safely be ignored, throw it to /dev/null.

Fixes: 7857bd51054c ("tools: Help cross-building with clang")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/bpf/20220201093119.1713207-1-jean-philippe@linaro.org
tools/scripts/Makefile.include