public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: "Arnd Bergmann" <arnd@arndb.de>,
	"Dodji Seketeli" <dodji@seketeli.org>,
	"John Moon" <john@jmoon.dev>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nsc@kernel.org>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	libabigail@sourceware.org
Subject: [PATCH 2/3] check-uapi: honor ${CROSS_COMPILE} setting
Date: Fri,  6 Mar 2026 17:33:08 +0100	[thread overview]
Message-ID: <20260306163309.2015837-3-arnd@kernel.org> (raw)
In-Reply-To: <20260306163309.2015837-1-arnd@kernel.org>

From: Arnd Bergmann <arnd@arndb.de>

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>
---
 scripts/check-uapi.sh | 11 ++++++-----
 1 file 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"
-- 
2.39.5


  parent reply	other threads:[~2026-03-06 16:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06 16:33 [PATCH 0/3] check-uapi: improve portability for testing headers Arnd Bergmann
2026-03-06 16:33 ` [PATCH 1/3] check-uapi: link into shared objects Arnd Bergmann
2026-03-06 16:33 ` Arnd Bergmann [this message]
2026-03-06 16:33 ` [PATCH 3/3] check-uapi: use dummy libc includes Arnd Bergmann
2026-03-06 16:39   ` Thomas Weißschuh
2026-03-06 16:45     ` Arnd Bergmann
2026-03-07  8:51       ` Thomas Weißschuh
2026-03-20 20:12         ` Nicolas Schier
2026-03-20 20:31           ` Thomas Weißschuh
2026-03-20 20:39             ` Nicolas Schier
2026-03-10  1:12 ` [PATCH 0/3] check-uapi: improve portability for testing headers Nathan Chancellor
2026-03-20 20:51 ` Nicolas Schier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260306163309.2015837-3-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=dodji@seketeli.org \
    --cc=john@jmoon.dev \
    --cc=libabigail@sourceware.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox