* [PATCH v2] tools/resolve_btfids: Fix build when cross compiling kernel with clang.
@ 2025-06-06 7:45 Suleiman Souhlal
2025-06-06 8:11 ` Jiri Olsa
2025-06-10 17:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Suleiman Souhlal @ 2025-06-06 7:45 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
Cc: Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Masahiro Yamada, Ian Rogers, ssouhlal, bpf, linux-kernel, llvm,
Suleiman Souhlal, stable
When cross compiling the kernel with clang, we need to override
CLANG_CROSS_FLAGS when preparing the step libraries.
Prior to commit d1d096312176 ("tools: fix annoying "mkdir -p ..." logs
when building tools in parallel"), MAKEFLAGS would have been set to a
value that wouldn't set a value for CLANG_CROSS_FLAGS, hiding the
fact that we weren't properly overriding it.
Cc: stable@vger.kernel.org
Fixes: 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program")
Signed-off-by: Suleiman Souhlal <suleiman@google.com>
---
v2:
- "Signed-off-by:" instead of "Signed-of-by".
v1: https://lore.kernel.org/lkml/20250606052301.810338-1-suleiman@google.com/
---
tools/bpf/resolve_btfids/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile
index afbddea3a39c..ce1b556dfa90 100644
--- a/tools/bpf/resolve_btfids/Makefile
+++ b/tools/bpf/resolve_btfids/Makefile
@@ -17,7 +17,7 @@ endif
# Overrides for the prepare step libraries.
HOST_OVERRIDES := AR="$(HOSTAR)" CC="$(HOSTCC)" LD="$(HOSTLD)" ARCH="$(HOSTARCH)" \
- CROSS_COMPILE="" EXTRA_CFLAGS="$(HOSTCFLAGS)"
+ CROSS_COMPILE="" CLANG_CROSS_FLAGS="" EXTRA_CFLAGS="$(HOSTCFLAGS)"
RM ?= rm
HOSTCC ?= gcc
--
2.50.0.rc0.642.g800a2b2222-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] tools/resolve_btfids: Fix build when cross compiling kernel with clang.
2025-06-06 7:45 [PATCH v2] tools/resolve_btfids: Fix build when cross compiling kernel with clang Suleiman Souhlal
@ 2025-06-06 8:11 ` Jiri Olsa
2025-06-10 17:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2025-06-06 8:11 UTC (permalink / raw)
To: Suleiman Souhlal
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo,
Masahiro Yamada, Ian Rogers, ssouhlal, bpf, linux-kernel, llvm,
stable
On Fri, Jun 06, 2025 at 04:45:38PM +0900, Suleiman Souhlal wrote:
> When cross compiling the kernel with clang, we need to override
> CLANG_CROSS_FLAGS when preparing the step libraries.
>
> Prior to commit d1d096312176 ("tools: fix annoying "mkdir -p ..." logs
> when building tools in parallel"), MAKEFLAGS would have been set to a
> value that wouldn't set a value for CLANG_CROSS_FLAGS, hiding the
> fact that we weren't properly overriding it.
>
> Cc: stable@vger.kernel.org
> Fixes: 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program")
> Signed-off-by: Suleiman Souhlal <suleiman@google.com>
lgtm
Acked-by: Jiri Olsa <jolsa@kernel.org>
thanks,
jirka
> ---
> v2:
> - "Signed-off-by:" instead of "Signed-of-by".
>
> v1: https://lore.kernel.org/lkml/20250606052301.810338-1-suleiman@google.com/
> ---
> tools/bpf/resolve_btfids/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile
> index afbddea3a39c..ce1b556dfa90 100644
> --- a/tools/bpf/resolve_btfids/Makefile
> +++ b/tools/bpf/resolve_btfids/Makefile
> @@ -17,7 +17,7 @@ endif
>
> # Overrides for the prepare step libraries.
> HOST_OVERRIDES := AR="$(HOSTAR)" CC="$(HOSTCC)" LD="$(HOSTLD)" ARCH="$(HOSTARCH)" \
> - CROSS_COMPILE="" EXTRA_CFLAGS="$(HOSTCFLAGS)"
> + CROSS_COMPILE="" CLANG_CROSS_FLAGS="" EXTRA_CFLAGS="$(HOSTCFLAGS)"
>
> RM ?= rm
> HOSTCC ?= gcc
> --
> 2.50.0.rc0.642.g800a2b2222-goog
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] tools/resolve_btfids: Fix build when cross compiling kernel with clang.
2025-06-06 7:45 [PATCH v2] tools/resolve_btfids: Fix build when cross compiling kernel with clang Suleiman Souhlal
2025-06-06 8:11 ` Jiri Olsa
@ 2025-06-10 17:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-10 17:10 UTC (permalink / raw)
To: Suleiman Souhlal
Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song,
john.fastabend, kpsingh, sdf, haoluo, jolsa, masahiroy, irogers,
ssouhlal, bpf, linux-kernel, llvm, stable
Hello:
This patch was applied to bpf/bpf.git (master)
by Andrii Nakryiko <andrii@kernel.org>:
On Fri, 6 Jun 2025 16:45:38 +0900 you wrote:
> When cross compiling the kernel with clang, we need to override
> CLANG_CROSS_FLAGS when preparing the step libraries.
>
> Prior to commit d1d096312176 ("tools: fix annoying "mkdir -p ..." logs
> when building tools in parallel"), MAKEFLAGS would have been set to a
> value that wouldn't set a value for CLANG_CROSS_FLAGS, hiding the
> fact that we weren't properly overriding it.
>
> [...]
Here is the summary with links:
- [v2] tools/resolve_btfids: Fix build when cross compiling kernel with clang.
https://git.kernel.org/bpf/bpf/c/a298bbab903e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-10 17:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-06 7:45 [PATCH v2] tools/resolve_btfids: Fix build when cross compiling kernel with clang Suleiman Souhlal
2025-06-06 8:11 ` Jiri Olsa
2025-06-10 17:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox