* [PATCH v1] objtool: HAVE_XXHASH test uses HOSTCFLAGS.
@ 2026-03-03 1:03 HONG Yifan
2026-03-03 1:16 ` Hong, Yifan
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: HONG Yifan @ 2026-03-03 1:03 UTC (permalink / raw)
To: Josh Poimboeuf, Peter Zijlstra; +Cc: HONG Yifan, kernel-team, linux-kernel
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@google.com>
---
tools/objtool/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 6964175abdfd..b8b8529f8ea9 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -13,7 +13,7 @@ endif
ifeq ($(ARCH_HAS_KLP),y)
HAVE_XXHASH = $(shell printf "$(pound)include <xxhash.h>\nXXH3_state_t *state;int main() {}" | \
- $(HOSTCC) -xc - -o /dev/null -lxxhash 2> /dev/null && echo y || echo n)
+ $(HOSTCC) $(HOSTCFLAGS) -xc - -o /dev/null -lxxhash 2> /dev/null && echo y || echo n)
ifeq ($(HAVE_XXHASH),y)
BUILD_KLP := y
LIBXXHASH_CFLAGS := $(shell $(HOSTPKG_CONFIG) libxxhash --cflags 2>/dev/null) \
--
2.53.0.473.g4a7958ca14-goog
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1] objtool: HAVE_XXHASH test uses HOSTCFLAGS.
2026-03-03 1:03 [PATCH v1] objtool: HAVE_XXHASH test uses HOSTCFLAGS HONG Yifan
@ 2026-03-03 1:16 ` Hong, Yifan
2026-03-03 18:24 ` Carlos Llamas
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Hong, Yifan @ 2026-03-03 1:16 UTC (permalink / raw)
To: Josh Poimboeuf, Peter Zijlstra; +Cc: kernel-team, linux-kernel, linux-kbuild
On Mon, Mar 2, 2026 at 5:03 PM HONG Yifan <elsk@google.com> 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@google.com>
> ---
> tools/objtool/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
> index 6964175abdfd..b8b8529f8ea9 100644
> --- a/tools/objtool/Makefile
> +++ b/tools/objtool/Makefile
> @@ -13,7 +13,7 @@ endif
>
> ifeq ($(ARCH_HAS_KLP),y)
> HAVE_XXHASH = $(shell printf "$(pound)include <xxhash.h>\nXXH3_state_t *state;int main() {}" | \
> - $(HOSTCC) -xc - -o /dev/null -lxxhash 2> /dev/null && echo y || echo n)
> + $(HOSTCC) $(HOSTCFLAGS) -xc - -o /dev/null -lxxhash 2> /dev/null && echo y || echo n)
> ifeq ($(HAVE_XXHASH),y)
> BUILD_KLP := y
> LIBXXHASH_CFLAGS := $(shell $(HOSTPKG_CONFIG) libxxhash --cflags 2>/dev/null) \
> --
> 2.53.0.473.g4a7958ca14-goog
>
Sorry, I forgot to cc linux-kbuild@vger.kernel.org as well. Adding
now. The original patch is at
https://lore.kernel.org/lkml/20260303010340.306164-1-elsk@google.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] objtool: HAVE_XXHASH test uses HOSTCFLAGS.
2026-03-03 1:03 [PATCH v1] objtool: HAVE_XXHASH test uses HOSTCFLAGS HONG Yifan
2026-03-03 1:16 ` Hong, Yifan
@ 2026-03-03 18:24 ` Carlos Llamas
2026-03-05 20:02 ` Josh Poimboeuf
2026-03-09 19:54 ` [tip: objtool/urgent] objtool: Use HOSTCFLAGS for HAVE_XXHASH test tip-bot2 for HONG Yifan
3 siblings, 0 replies; 5+ messages in thread
From: Carlos Llamas @ 2026-03-03 18:24 UTC (permalink / raw)
To: HONG Yifan; +Cc: Josh Poimboeuf, Peter Zijlstra, kernel-team, linux-kernel
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@google.com>
> ---
Reviewed-by: Carlos Llamas <cmllamas@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] objtool: HAVE_XXHASH test uses HOSTCFLAGS.
2026-03-03 1:03 [PATCH v1] objtool: HAVE_XXHASH test uses HOSTCFLAGS HONG Yifan
2026-03-03 1:16 ` Hong, Yifan
2026-03-03 18:24 ` Carlos Llamas
@ 2026-03-05 20:02 ` Josh Poimboeuf
2026-03-09 19:54 ` [tip: objtool/urgent] objtool: Use HOSTCFLAGS for HAVE_XXHASH test tip-bot2 for HONG Yifan
3 siblings, 0 replies; 5+ messages in thread
From: Josh Poimboeuf @ 2026-03-05 20:02 UTC (permalink / raw)
To: HONG Yifan; +Cc: Peter Zijlstra, kernel-team, linux-kernel
On Tue, Mar 03, 2026 at 01:03:39AM +0000, HONG Yifan 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@google.com>
Queued, thanks!
--
Josh
^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip: objtool/urgent] objtool: Use HOSTCFLAGS for HAVE_XXHASH test
2026-03-03 1:03 [PATCH v1] objtool: HAVE_XXHASH test uses HOSTCFLAGS HONG Yifan
` (2 preceding siblings ...)
2026-03-05 20:02 ` Josh Poimboeuf
@ 2026-03-09 19:54 ` tip-bot2 for HONG Yifan
3 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for HONG Yifan @ 2026-03-09 19:54 UTC (permalink / raw)
To: linux-tip-commits
Cc: HONG Yifan, Carlos Llamas, Josh Poimboeuf, x86, linux-kernel
The following commit has been merged into the objtool/urgent branch of tip:
Commit-ID: 32234049107d012703d50547e815f198f147968b
Gitweb: https://git.kernel.org/tip/32234049107d012703d50547e815f198f147968b
Author: HONG Yifan <elsk@google.com>
AuthorDate: Tue, 03 Mar 2026 01:03:39
Committer: Josh Poimboeuf <jpoimboe@kernel.org>
CommitterDate: Fri, 06 Mar 2026 07:48:41 -08:00
objtool: Use HOSTCFLAGS for HAVE_XXHASH test
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@google.com>
Reviewed-by: Carlos Llamas <cmllamas@google.com>
Link: https://patch.msgid.link/20260303010340.306164-1-elsk@google.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
tools/objtool/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 6964175..b8b8529 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -13,7 +13,7 @@ endif
ifeq ($(ARCH_HAS_KLP),y)
HAVE_XXHASH = $(shell printf "$(pound)include <xxhash.h>\nXXH3_state_t *state;int main() {}" | \
- $(HOSTCC) -xc - -o /dev/null -lxxhash 2> /dev/null && echo y || echo n)
+ $(HOSTCC) $(HOSTCFLAGS) -xc - -o /dev/null -lxxhash 2> /dev/null && echo y || echo n)
ifeq ($(HAVE_XXHASH),y)
BUILD_KLP := y
LIBXXHASH_CFLAGS := $(shell $(HOSTPKG_CONFIG) libxxhash --cflags 2>/dev/null) \
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-09 19:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03 1:03 [PATCH v1] objtool: HAVE_XXHASH test uses HOSTCFLAGS HONG Yifan
2026-03-03 1:16 ` Hong, Yifan
2026-03-03 18:24 ` Carlos Llamas
2026-03-05 20:02 ` Josh Poimboeuf
2026-03-09 19:54 ` [tip: objtool/urgent] objtool: Use HOSTCFLAGS for HAVE_XXHASH test tip-bot2 for HONG Yifan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox