selftests/bpf: Fix pkg-config call on static builds
Subsystems (3)
PATCH 1/1 selftests/bpf: Fix pkg-config call on static builds
For commit b0dcdcb9ae75 ("resolve_btfids: Fix linker flags detection"), I suggested setting HOSTPKG_CONFIG to $PKG_CONFIG when compiling resolve_btfids, but I forgot the quotes around that variable.
As a result, when running vmtest.sh with static linking, it fails as follows:
$ LDLIBS=-static PKG_CONFIG='pkg-config --static' ./vmtest.sh
[...]
make: unrecognized option '--static'
Usage: make [options] [target] ...
[...]This worked when I tested it because HOSTPKG_CONFIG didn't have a default value in the resolve_btfids Makefile, but once it does, the quotes aren't preserved and it fails on the next make call.
--- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/Makefile +1 -1
@@ -409,7 +409,7 @@ $(RESOLVE_BTFIDS): $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/resolve_btfids \ CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)" \ LIBBPF_INCLUDE=$(HOST_INCLUDE_DIR) \ EXTRA_LDFLAGS='$(SAN_LDFLAGS) $(EXTRA_LDFLAGS)' \ - HOSTPKG_CONFIG=$(PKG_CONFIG) \ + HOSTPKG_CONFIG='$(PKG_CONFIG)' \ OUTPUT=$(HOST_BUILD_DIR)/resolve_btfids/ BPFOBJ=$(HOST_BPFOBJ) # Get Clang's default includes on this system, as opposed to those seen by
Signature · 1 line
2.43.0
Quoted 13 lines · Paul Chaignon
For commit
b0dcdcb9ae75("resolve_btfids: Fix linker flags detection"), I suggested settingHOSTPKG_CONFIGto $PKG_CONFIG when compilingresolve_btfids, but I forgot the quotes around that variable.As a result, when running
vmtest.shwith static linking, it fails as follows:$ LDLIBS=-static PKG_CONFIG='pkg-config --static' ./vmtest.sh [...] make: unrecognized option '--static' Usage: make [options] [target] ... [...]
Quoted 7 lines
This worked when I tested it because
HOSTPKG_CONFIGdidn't have a default value in theresolve_btfidsMakefile, but once it does, the quotes aren't preserved and it fails on the next make call.Fixes b0dcdcb9ae75 ("resolve_btfids: Fix linker flags detection")Signed-off-by Paul Chaignon <[email protected]>---
Quoted 18 lines
tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/Makefile +1
-1@@ -409,7 +409,7 @@ $(RESOLVE_BTFIDS): $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/resolve_btfids \ CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)" \ LIBBPF_INCLUDE=$(HOST_INCLUDE_DIR) \ EXTRA_LDFLAGS='$(SAN_LDFLAGS) $(EXTRA_LDFLAGS)' \ - HOSTPKG_CONFIG=$(PKG_CONFIG) \ + HOSTPKG_CONFIG='$(PKG_CONFIG)' \ OUTPUT=$(HOST_BUILD_DIR)/resolve_btfids/ BPFOBJ=$(HOST_BPFOBJ) # Get Clang's default includes on this system, as opposed to those seen bySignature · 1 line
2.43.0
Quoted 28 lines · Paul Chaignon
For commit
b0dcdcb9ae75("resolve_btfids: Fix linker flags detection"), I suggested settingHOSTPKG_CONFIGto $PKG_CONFIG when compilingresolve_btfids, but I forgot the quotes around that variable.As a result, when running
vmtest.shwith static linking, it fails as follows:$ LDLIBS=-static PKG_CONFIG='pkg-config --static' ./vmtest.sh [...] make: unrecognized option '--static' Usage: make [options] [target] ... [...]This worked when I tested it because
HOSTPKG_CONFIGdidn't have a default value in theresolve_btfidsMakefile, but once it does, the quotes aren't preserved and it fails on the next make call.Fixes b0dcdcb9ae75 ("resolve_btfids: Fix linker flags detection")Signed-off-by Paul Chaignon <[email protected]>--- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/Makefile +0
-0
tools/testing/selftests/bpf/Makefile $(RESOLVE_BTFIDS): $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/resolve_btfids \ · line 412
Quoted 5 lines
tools/testing/selftests/bpf/Makefile +1
-1@@ -409,7 +409,7 @@ $(RESOLVE_BTFIDS): $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/resolve_btfids \ CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)" \ LIBBPF_INCLUDE=$(HOST_INCLUDE_DIR) \ EXTRA_LDFLAGS='$(SAN_LDFLAGS) $(EXTRA_LDFLAGS)' \ - HOSTPKG_CONFIG=$(PKG_CONFIG) \ + HOSTPKG_CONFIG='$(PKG_CONFIG)' \
That's an oopsie... Thanks for fixing.
Quoted 3 lines
tools/testing/selftests/bpf/Makefile +0
-0OUTPUT=$(HOST_BUILD_DIR)/resolve_btfids/ BPFOBJ=$(HOST_BPFOBJ) # Get Clang's default includes on this system, as opposed to those seen by
This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <[email protected]>:
Quoted 8 lines · On Tue, 10 Mar 2026 12:39:51 +0100 you wrote:
For commit
b0dcdcb9ae75("resolve_btfids: Fix linker flags detection"), I suggested settingHOSTPKG_CONFIGto $PKG_CONFIG when compilingresolve_btfids, but I forgot the quotes around that variable.As a result, when running
vmtest.shwith static linking, it fails as follows:[...]
Here is the summary with links:
- [bpf] selftests/bpf: Fix pkg-config call on static builds
https://git.kernel.org/bpf/bpf/c/e06e6b800123
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html