diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2026-03-06 17:33:08 +0100 |
|---|---|---|
| committer | Nicolas Schier <nsc@kernel.org> | 2026-03-20 21:43:56 +0100 |
| commit | 9940ec38f12ed8ffe8edc1944f9bbdf9b9a4689e (patch) | |
| tree | 56ba374f3c6722cd468d1d6398bda5db971993cd | |
| parent | a261f6dff3c1653c19c065c3b3650c625447b8a7 (diff) | |
check-uapi: honor ${CROSS_COMPILE} setting
When ${CROSS_COMPILE} is set, but ${CC} is not set, the logic in
check-uapi.sh is different from the top-level Makefile, which defaults
to using the cross gcc. This leads to using the native gcc instead of the
cross version, resulting in unexpected false-positive and false-negative
output.
Use the same logic here that we use in Kbuild for consistency.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20260306163309.2015837-3-arnd@kernel.org
Signed-off-by: Nicolas Schier <nsc@kernel.org>
| -rwxr-xr-x | scripts/check-uapi.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/check-uapi.sh b/scripts/check-uapi.sh index 9fa45cbdecc2..e4d120eb09e3 100755 --- a/scripts/check-uapi.sh +++ b/scripts/check-uapi.sh @@ -33,9 +33,10 @@ Options: -v Verbose operation (print more information about each header being checked). Environmental args: - ABIDIFF Custom path to abidiff binary - CC C compiler (default is "gcc") - ARCH Target architecture for the UAPI check (default is host arch) + ABIDIFF Custom path to abidiff binary + CROSS_COMPILE Toolchain prefix for compiler + CC C compiler (default is "\${CROSS_COMPILE}gcc") + ARCH Target architecture for the UAPI check (default is host arch) Exit codes: $SUCCESS) Success @@ -198,7 +199,7 @@ do_compile() { run_make_headers_install() { local -r ref="$1" local -r install_dir="$(get_header_tree "$ref")" - make -j "$MAX_THREADS" ARCH="$ARCH" INSTALL_HDR_PATH="$install_dir" \ + make -j "$MAX_THREADS" CROSS_COMPILE="${CROSS_COMPILE}" ARCH="$ARCH" INSTALL_HDR_PATH="$install_dir" \ headers_install > /dev/null } @@ -407,7 +408,7 @@ min_version_is_satisfied() { # Make sure we have the tools we need and the arguments make sense check_deps() { ABIDIFF="${ABIDIFF:-abidiff}" - CC="${CC:-gcc}" + CC="${CC:-${CROSS_COMPILE}gcc}" ARCH="${ARCH:-$(uname -m)}" if [ "$ARCH" = "x86_64" ]; then ARCH="x86" |
