Skip to contentSkip to conversation

tools/resolve_btfids: Fix build when cross compiling kernel with clang.

PATCH Superseded Suleiman Souhlal 2 participants 7 messages Jun 6, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/resolve_btfids: Fix build when cross compiling kernel with clang.

When cross compiling the kernel with clang, we need to override CLANG_CROSS_FLAGS when preparing the step libraries for resolve_btfids.

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.

Fixes 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program")
---
 tools/bpf/resolve_btfids/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/resolve_btfids/Makefile +1 -1
index afbddea3a39c..ce1b556dfa90 100644
@@ -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
Signature · 1 line
2.50.0.rc0.642.g800a2b2222-goog
#1 lore raw

PATCH RESEND 1/1 tools/resolve_btfids: Fix build when cross compiling kernel with clang.

When cross compiling the kernel with clang, we need to override CLANG_CROSS_FLAGS when preparing the step libraries for resolve_btfids.

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.

Fixes 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program")
---
 tools/bpf/resolve_btfids/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/resolve_btfids/Makefile +1 -1
index afbddea3a39c..ce1b556dfa90 100644
@@ -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
Signature · 1 line
2.50.0.rc0.642.g800a2b2222-goog
maintainer
#2 lore raw
Quoted 9 lines · Suleiman Souhlal

When cross compiling the kernel with clang, we need to override CLANG_CROSS_FLAGS when preparing the step libraries for resolve_btfids.

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.

Quoted 6 lines
Fixes 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program")
---
 tools/bpf/resolve_btfids/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

You forgot to say why this is a resend :(

#3 lore raw
Quoted 11 lines · Greg KH
Quoted 9 lines · Suleiman Souhlal

When cross compiling the kernel with clang, we need to override CLANG_CROSS_FLAGS when preparing the step libraries for resolve_btfids.

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.

Quoted 8 lines
Quoted 6 lines
Fixes 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program")
---
 tools/bpf/resolve_btfids/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

You forgot to say why this is a resend :(

I wasn't sure how to say it. It didn't occur to me that I could have replied to it with the reason.

It was because I had "Signed-of-by:" instead of "Signed-off-by:".

-- Suleiman

maintainer
#4 lore raw
Quoted 19 lines · Suleiman Souhlal
Quoted 18 lines · Greg KH
Quoted 15 lines · Suleiman Souhlal

When cross compiling the kernel with clang, we need to override CLANG_CROSS_FLAGS when preparing the step libraries for resolve_btfids.

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.

Fixes 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program")
---
 tools/bpf/resolve_btfids/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 1 line

You forgot to say why this is a resend :(

I wasn't sure how to say it. It didn't occur to me that I could have replied to it with the reason.

That goes below the --- line and it would be a v2, not a RESEND as you changed something:

Quoted 1 line

It was because I had "Signed-of-by:" instead of "Signed-off-by:".

Which means it was not identical to the first version (a RESEND means a maintainer can take either as they are the same).

thanks,

greg k-h

#5 lore raw
Quoted 26 lines · Greg KH
Quoted 19 lines · Suleiman Souhlal
Quoted 18 lines · Greg KH
Quoted 15 lines · Suleiman Souhlal

When cross compiling the kernel with clang, we need to override CLANG_CROSS_FLAGS when preparing the step libraries for resolve_btfids.

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.

Fixes 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program")
---
 tools/bpf/resolve_btfids/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 1 line

You forgot to say why this is a resend :(

I wasn't sure how to say it. It didn't occur to me that I could have replied to it with the reason.

Quoted 7 lines

That goes below the --- line and it would be a v2, not a RESEND as you changed something:

Quoted 1 line

It was because I had "Signed-of-by:" instead of "Signed-off-by:".

Which means it was not identical to the first version (a RESEND means a maintainer can take either as they are the same).

Ah. Should I resend it as a v2?

Thanks,
-- Suleiman

maintainer
#6 lore raw
Quoted 30 lines · Suleiman Souhlal
Quoted 29 lines · Greg KH
Quoted 19 lines · Suleiman Souhlal
Quoted 18 lines · Greg KH
Quoted 15 lines · Suleiman Souhlal

When cross compiling the kernel with clang, we need to override CLANG_CROSS_FLAGS when preparing the step libraries for resolve_btfids.

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.

Fixes 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program")
---
 tools/bpf/resolve_btfids/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 1 line

You forgot to say why this is a resend :(

I wasn't sure how to say it. It didn't occur to me that I could have replied to it with the reason.

That goes below the --- line and it would be a v2, not a RESEND as you changed something:

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

It was because I had "Signed-of-by:" instead of "Signed-off-by:".

Which means it was not identical to the first version (a RESEND means a maintainer can take either as they are the same).

Ah. Should I resend it as a v2?

Think about what you would want to see if you were on the recieving end of thousands of patches and had to try to figure out what to ignore and what to pay attention to...

thanks,

greg k-h