History

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.

Arnd Bergmann committed 8 months ago

Commit 9940ec31 parent a261f6d1 file · +6 −5Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/check-uapi.sh+6−5
@@ -33,9 +33,10 @@ Options: · 32 unmodified lines
33 -v Verbose operation (print more information about each header being checked).33 -v Verbose operation (print more information about each header being checked).
34 34
35Environmental args:35Environmental args:
36 ABIDIFF Custom path to abidiff binary36 ABIDIFF Custom path to abidiff binary
37 CC C compiler (default is "gcc")37 CROSS_COMPILE Toolchain prefix for compiler
38 ARCH Target architecture for the UAPI check (default is host arch)38 CC C compiler (default is "\${CROSS_COMPILE}gcc")
39 ARCH Target architecture for the UAPI check (default is host arch)
39 40
40Exit codes:41Exit codes:
41 $SUCCESS) Success42 $SUCCESS) Success
@@ -198,7 +199,7 @@ do_compile() { · 156 unmodified lines
198run_make_headers_install() {199run_make_headers_install() {
199 local -r ref="$1"200 local -r ref="$1"
200 local -r install_dir="$(get_header_tree "$ref")"201 local -r install_dir="$(get_header_tree "$ref")"
201 make -j "$MAX_THREADS" ARCH="$ARCH" INSTALL_HDR_PATH="$install_dir" \202 make -j "$MAX_THREADS" CROSS_COMPILE="${CROSS_COMPILE}" ARCH="$ARCH" INSTALL_HDR_PATH="$install_dir" \
202 headers_install > /dev/null203 headers_install > /dev/null
203}204}
204 205
@@ -407,7 +408,7 @@ min_version_is_satisfied() { · 202 unmodified lines
407# Make sure we have the tools we need and the arguments make sense408# Make sure we have the tools we need and the arguments make sense
408check_deps() {409check_deps() {
409 ABIDIFF="${ABIDIFF:-abidiff}"410 ABIDIFF="${ABIDIFF:-abidiff}"
410 CC="${CC:-gcc}"411 CC="${CC:-${CROSS_COMPILE}gcc}"
411 ARCH="${ARCH:-$(uname -m)}"412 ARCH="${ARCH:-$(uname -m)}"
412 if [ "$ARCH" = "x86_64" ]; then413 if [ "$ARCH" = "x86_64" ]; then
413 ARCH="x86"414 ARCH="x86"