]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
selftests/bpf: Fix pkg-config call on static builds
authorPaul Chaignon <paul.chaignon@gmail.com>
Tue, 10 Mar 2026 11:39:51 +0000 (12:39 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 10 Mar 2026 19:04:00 +0000 (12:04 -0700)
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.

Fixes: b0dcdcb9ae75 ("resolve_btfids: Fix linker flags detection")
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Acked-by: Mykyta Yatsenko <yatsenko@meta.com>
Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/r/abADBwn_ykblpABE@mail.gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/Makefile

index d5acbeba03838f74103724d780c5634d0d2c4793..65485967c9681234a8e8056c3cbf71a91f7c8fa9 100644 (file)
@@ -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