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.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -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 | ||
| 35 | Environmental args: | 35 | Environmental args: |
| 36 | ABIDIFF Custom path to abidiff binary | 36 | 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 | ||
| 40 | Exit codes: | 41 | Exit codes: |
| 41 | $SUCCESS) Success | 42 | $SUCCESS) Success |
| @@ -198,7 +199,7 @@ do_compile() { · 156 unmodified lines | |||
| 198 | run_make_headers_install() { | 199 | run_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/null | 203 | 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 sense | 408 | # Make sure we have the tools we need and the arguments make sense |
| 408 | check_deps() { | 409 | check_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" ]; then | 413 | if [ "$ARCH" = "x86_64" ]; then |
| 413 | ARCH="x86" | 414 | ARCH="x86" |