Skip to content

Commit 67ab80a

Browse files
eddyz87Alexei Starovoitov
authored andcommitted
selftests/bpf: Prefer static linking for LLVM libraries
It is not always convenient to have LLVM libraries installed inside CI rootfs images, thus request static libraries from llvm-config. Suggested-by: Andrii Nakryiko <[email protected]> Signed-off-by: Eduard Zingerman <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Tested-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent a48a438 commit 67ab80a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tools/testing/selftests/bpf/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,9 @@ ifeq ($(feature-llvm),1)
202202
LLVM_CONFIG_LIB_COMPONENTS := mcdisassembler all-targets
203203
# both llvm-config and lib.mk add -D_GNU_SOURCE, which ends up as conflict
204204
LLVM_CFLAGS += $(filter-out -D_GNU_SOURCE,$(shell $(LLVM_CONFIG) --cflags))
205-
LLVM_LDLIBS += $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS))
206-
ifeq ($(shell $(LLVM_CONFIG) --shared-mode),static)
207-
LLVM_LDLIBS += $(shell $(LLVM_CONFIG) --system-libs $(LLVM_CONFIG_LIB_COMPONENTS))
208-
LLVM_LDLIBS += -lstdc++
209-
endif
205+
LLVM_LDLIBS += $(shell $(LLVM_CONFIG) --link-static --libs $(LLVM_CONFIG_LIB_COMPONENTS))
206+
LLVM_LDLIBS += $(shell $(LLVM_CONFIG) --link-static --system-libs $(LLVM_CONFIG_LIB_COMPONENTS))
207+
LLVM_LDLIBS += -lstdc++
210208
LLVM_LDFLAGS += $(shell $(LLVM_CONFIG) --ldflags)
211209
endif
212210

0 commit comments

Comments
 (0)