diff options
author | Eduard Zingerman <[email protected]> | 2024-09-05 08:13:54 +0000 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2024-09-05 13:13:39 -0700 |
commit | 67ab80a01886a178c69c91728c49f94ccb71f338 (patch) | |
tree | cd8300b1cb4543305cc783ece41acf8e2401004d | |
parent | a48a43884cdd46dba8cc4a15160c116ffd965800 (diff) |
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]>
-rw-r--r-- | tools/testing/selftests/bpf/Makefile | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 9905e3739dd0..04716a5e43f1 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -202,11 +202,9 @@ ifeq ($(feature-llvm),1) LLVM_CONFIG_LIB_COMPONENTS := mcdisassembler all-targets # both llvm-config and lib.mk add -D_GNU_SOURCE, which ends up as conflict LLVM_CFLAGS += $(filter-out -D_GNU_SOURCE,$(shell $(LLVM_CONFIG) --cflags)) - LLVM_LDLIBS += $(shell $(LLVM_CONFIG) --libs $(LLVM_CONFIG_LIB_COMPONENTS)) - ifeq ($(shell $(LLVM_CONFIG) --shared-mode),static) - LLVM_LDLIBS += $(shell $(LLVM_CONFIG) --system-libs $(LLVM_CONFIG_LIB_COMPONENTS)) - LLVM_LDLIBS += -lstdc++ - endif + LLVM_LDLIBS += $(shell $(LLVM_CONFIG) --link-static --libs $(LLVM_CONFIG_LIB_COMPONENTS)) + LLVM_LDLIBS += $(shell $(LLVM_CONFIG) --link-static --system-libs $(LLVM_CONFIG_LIB_COMPONENTS)) + LLVM_LDLIBS += -lstdc++ LLVM_LDFLAGS += $(shell $(LLVM_CONFIG) --ldflags) endif |