Skip to contentSkip to conversation

tools/resolve_btfids: Include libsubcmd headers directly from source tree

PATCH Applied Thomas Weißschuh 4 participants 4 messages Jul 2 – Jul 8 BPF

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/resolve_btfids: Include libsubcmd headers directly from source tree

Currently each build with resolve_btfids enabled unnecessarily prints the line 'INSTALL libsubcmd_headers' from libsubcmd.

Use the libcmd headers from source tree instead, without installation.

The same was done for objtool in commit ac999926774a ("objtool: Include libsubcmd headers directly from source tree"), albeit for a different reason.

---
Changes in v2:
- Rebase on v7.2-rc1.
- Change the resolve_btfids rules instead of the libsubcmd ones
- Link to v1: https://lore.kernel.org/lkml/[email protected]/

---
 tools/bpf/resolve_btfids/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tools/bpf/resolve_btfids/Makefile +2 -3
index 7672208f65e4..bb0463b380af 100644
@@ -40,7 +40,6 @@ LIBBPF_DESTDIR := $(LIBBPF_OUT)
 LIBBPF_INCLUDE := $(LIBBPF_DESTDIR)include
 
 SUBCMD_DESTDIR := $(SUBCMD_OUT)
-SUBCMD_INCLUDE := $(SUBCMD_DESTDIR)include
 
 BINARY     := $(OUTPUT)/resolve_btfids
 BINARY_IN  := $(BINARY)-in.o
@@ -56,7 +55,7 @@ $(OUTPUT) $(OUTPUT)/libsubcmd $(LIBBPF_OUT):
 $(SUBCMDOBJ): fixdep FORCE | $(OUTPUT)/libsubcmd
 	$(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(SUBCMD_OUT) \
 		    DESTDIR=$(SUBCMD_DESTDIR) $(HOST_OVERRIDES) prefix= subdir= \
-		    $(abspath $@) install_headers
+		    $(abspath $@)
 
 $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OUT)
 	$(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(LIBBPF_OUT)    \
@@ -77,7 +76,7 @@ HOSTCFLAGS_resolve_btfids += -g \
           -I$(srctree)/tools/include \
           -I$(srctree)/tools/include/uapi \
           -I$(LIBBPF_INCLUDE) \
-          -I$(SUBCMD_INCLUDE) \
+          -I$(srctree)/tools/lib \
           $(LIBELF_FLAGS) \
           -Wall -Werror
 

---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260213-libsubcmd-spam-1f52f0d0c579

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>
reviewer Tested-by on v1 1/1
#1 lore raw
Quoted 10 lines · Thomas WeiÃschuh

Currently each build with resolve_btfids enabled unnecessarily prints the line 'INSTALL libsubcmd_headers' from libsubcmd.

Use the libcmd headers from source tree instead, without installation.

The same was done for objtool in commit ac999926774a ("objtool: Include libsubcmd headers directly from source tree"), albeit for a different reason.

LGTM, thanks!

Quoted 48 lines

---
Changes in v2:
- Rebase on v7.2-rc1.
- Change the resolve_btfids rules instead of the libsubcmd ones
- Link to v1: https://lore.kernel.org/lkml/[email protected]/

---
  tools/bpf/resolve_btfids/Makefile | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
tools/bpf/resolve_btfids/Makefile +2 -4
index 7672208f65e4..bb0463b380af 100644
@@ -40,7 +40,6 @@ LIBBPF_DESTDIR := $(LIBBPF_OUT)
  LIBBPF_INCLUDE := $(LIBBPF_DESTDIR)include
 
  SUBCMD_DESTDIR := $(SUBCMD_OUT)
-SUBCMD_INCLUDE := $(SUBCMD_DESTDIR)include
 
  BINARY     := $(OUTPUT)/resolve_btfids
  BINARY_IN  := $(BINARY)-in.o
@@ -56,7 +55,7 @@ $(OUTPUT) $(OUTPUT)/libsubcmd $(LIBBPF_OUT):
  $(SUBCMDOBJ): fixdep FORCE | $(OUTPUT)/libsubcmd
  	$(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(SUBCMD_OUT) \
  		    DESTDIR=$(SUBCMD_DESTDIR) $(HOST_OVERRIDES) prefix= subdir= \
-		    $(abspath $@) install_headers
+		    $(abspath $@)
 
  $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OUT)
  	$(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(LIBBPF_OUT)    \
@@ -77,7 +76,7 @@ HOSTCFLAGS_resolve_btfids += -g \
            -I$(srctree)/tools/include \
            -I$(srctree)/tools/include/uapi \
            -I$(LIBBPF_INCLUDE) \
-          -I$(SUBCMD_INCLUDE) \
+          -I$(srctree)/tools/lib \
            $(LIBELF_FLAGS) \
            -Wall -Werror
 
 
---

base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260213-libsubcmd-spam-1f52f0d0c579

Best regards,
--
Thomas Weißschuh <[email protected]>

#2 lore raw
In reply to Thomas Weißschuh

Hello,

+CC Ian

Quoted 8 lines · Thomas Weißschuh

Currently each build with resolve_btfids enabled unnecessarily prints the line 'INSTALL libsubcmd_headers' from libsubcmd.

Use the libcmd headers from source tree instead, without installation.

The same was done for objtool in commit ac999926774a ("objtool: Include libsubcmd headers directly from source tree"), albeit for a different reason.

I think the intention was to avoid dependencies on internal headers. See af03299d8536d ("tools/resolve_btfids: Install subcmd headers").

Thanks,
Namhyung

Quoted 50 lines

---
Changes in v2:
- Rebase on v7.2-rc1.
- Change the resolve_btfids rules instead of the libsubcmd ones
- Link to v1: https://lore.kernel.org/lkml/[email protected]/

---
 tools/bpf/resolve_btfids/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tools/bpf/resolve_btfids/Makefile +2 -4
index 7672208f65e4..bb0463b380af 100644
@@ -40,7 +40,6 @@ LIBBPF_DESTDIR := $(LIBBPF_OUT)
 LIBBPF_INCLUDE := $(LIBBPF_DESTDIR)include
 
 SUBCMD_DESTDIR := $(SUBCMD_OUT)
-SUBCMD_INCLUDE := $(SUBCMD_DESTDIR)include
 
 BINARY     := $(OUTPUT)/resolve_btfids
 BINARY_IN  := $(BINARY)-in.o
@@ -56,7 +55,7 @@ $(OUTPUT) $(OUTPUT)/libsubcmd $(LIBBPF_OUT):
 $(SUBCMDOBJ): fixdep FORCE | $(OUTPUT)/libsubcmd
 	$(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(SUBCMD_OUT) \
 		    DESTDIR=$(SUBCMD_DESTDIR) $(HOST_OVERRIDES) prefix= subdir= \
-		    $(abspath $@) install_headers
+		    $(abspath $@)
 
 $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OUT)
 	$(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(LIBBPF_OUT)    \
@@ -77,7 +76,7 @@ HOSTCFLAGS_resolve_btfids += -g \
           -I$(srctree)/tools/include \
           -I$(srctree)/tools/include/uapi \
           -I$(LIBBPF_INCLUDE) \
-          -I$(SUBCMD_INCLUDE) \
+          -I$(srctree)/tools/lib \
           $(LIBELF_FLAGS) \
           -Wall -Werror
 
 
---

base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260213-libsubcmd-spam-1f52f0d0c579

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>
#3 lore raw
In reply to Thomas Weißschuh
This patch was applied to bpf/bpf-next.git (master) by Eduard Zingerman <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Eduard Zingerman <[email protected]>:

Quoted 10 lines · On Thu, 02 Jul 2026 10:26:30 +0200 you wrote:

Currently each build with resolve_btfids enabled unnecessarily prints the line 'INSTALL libsubcmd_headers' from libsubcmd.

Use the libcmd headers from source tree instead, without installation.

The same was done for objtool in commit ac999926774a ("objtool: Include libsubcmd headers directly from source tree"), albeit for a different reason.

[...]

Here is the summary with links:
- tools/resolve_btfids: Include libsubcmd headers directly from source tree

    https://git.kernel.org/bpf/bpf-next/c/0bdbed9133fd

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html