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
3333 -v Verbose operation (print more information about each header being checked).
3434
3535 Environmental args:
36− ABIDIFF Custom path to abidiff binary
37− CC C compiler (default is "gcc")
38− ARCH Target architecture for the UAPI check (default is host arch)
36+ ABIDIFF Custom path to abidiff binary
37+ CROSS_COMPILE Toolchain prefix for compiler
38+ CC C compiler (default is "\${CROSS_COMPILE}gcc")
39+ ARCH Target architecture for the UAPI check (default is host arch)
3940
4041 Exit codes:
4142 $SUCCESS) Success
@@ -198,7 +199,7 @@ do_compile() { · 156 unmodified lines
198199 run_make_headers_install() {
199200 local -r ref="$1"
200201 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" \
202203 headers_install > /dev/null
203204 }
204205
@@ -407,7 +408,7 @@ min_version_is_satisfied() { · 202 unmodified lines
407408 # Make sure we have the tools we need and the arguments make sense
408409 check_deps() {
409410 ABIDIFF="${ABIDIFF:-abidiff}"
410− CC="${CC:-gcc}"
411+ CC="${CC:-${CROSS_COMPILE}gcc}"
411412 ARCH="${ARCH:-$(uname -m)}"
412413 if [ "$ARCH" = "x86_64" ]; then
413414 ARCH="x86"