Skip to content

Commit 2ce344b

Browse files
akihikodakianakryiko
authored andcommitted
selftests/bpf: Choose pkg-config for the target
pkg-config is used to build sign-file executable. It should use the library for the target instead of the host as it is called during tests. Signed-off-by: Akihiko Odaki <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent d4e7dd4 commit 2ce344b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/testing/selftests/bpf/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ else
1818
GENDIR := $(abspath ../../../../include/generated)
1919
endif
2020
GENHDR := $(GENDIR)/autoconf.h
21-
HOSTPKG_CONFIG := pkg-config
21+
PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
2222

2323
ifneq ($(wildcard $(GENHDR)),)
2424
GENFLAGS := -DHAVE_GENHDR
@@ -219,9 +219,9 @@ $(OUTPUT)/urandom_read: urandom_read.c urandom_read_aux.c $(OUTPUT)/liburandom_r
219219

220220
$(OUTPUT)/sign-file: ../../../../scripts/sign-file.c
221221
$(call msg,SIGN-FILE,,$@)
222-
$(Q)$(CC) $(shell $(HOSTPKG_CONFIG) --cflags libcrypto 2> /dev/null) \
222+
$(Q)$(CC) $(shell $(PKG_CONFIG) --cflags libcrypto 2> /dev/null) \
223223
$< -o $@ \
224-
$(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
224+
$(shell $(PKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
225225

226226
$(OUTPUT)/bpf_testmod.ko: $(VMLINUX_BTF) $(RESOLVE_BTFIDS) $(wildcard bpf_testmod/Makefile bpf_testmod/*.[ch])
227227
$(call msg,MOD,,$@)

0 commit comments

Comments
 (0)