Re: [PATCH v1] objtool: HAVE_XXHASH test uses HOSTCFLAGS.
From: Carlos Llamas
Date: Tue Mar 03 2026 - 13:29:13 EST
On Tue, Mar 03, 2026 at 01:03:39AM +0000, 'HONG Yifan' via kernel-team wrote:
> Previously, HAVE_XXHASH is tested by invoking HOSTCC without HOSTCFLAGS.
>
> Consider the following scenario:
>
> - The host machine has libxxhash installed
> - We build the kernel with HOSTCFLAGS containing a --sysroot that does
> not have xxhash.h (for hermetic builds)
>
> In this case, HAVE_XXHASH is set to y, but when it builds objtool with
> HOSTCFLAGS, because the --sysroot does not contain xxhash.h, the
> following error is raised:
>
> <...>/common/tools/objtool/include/objtool/checksum_types.h:12:10: fatal error: 'xxhash.h' file not found
> 12 | #include <xxhash.h>
> | ^~~~~~~~~~
>
> To resolve the error, we test HAVE_XXHASH by invoking HOSTCC with
> HOSTCFLAGS.
>
> Signed-off-by: HONG Yifan <elsk@xxxxxxxxxx>
> ---
Reviewed-by: Carlos Llamas <cmllamas@xxxxxxxxxx>