Skip to content

Commit 1c8b319

Browse files
mykyta5Kernel Patches Daemon
authored and
Kernel Patches Daemon
committed
selftests/bpf: add SKIP_LLVM makefile variable
Introduce SKIP_LLVM makefile variable that allows to avoid using llvm dependencies when building BPF selftests. This is different from existing feature-llvm, as the latter is a result of automatic detection and should not be set by user explicitly. Avoiding llvm dependencies could be useful for environments that do not have them, given that as of now llvm dependencies are required only by jit_disasm_helpers.c. Signed-off-by: Mykyta Yatsenko <[email protected]>
1 parent 9e047b7 commit 1c8b319

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/testing/selftests/bpf/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ OPT_FLAGS ?= $(if $(RELEASE),-O2,-O0)
3434
LIBELF_CFLAGS := $(shell $(PKG_CONFIG) libelf --cflags 2>/dev/null)
3535
LIBELF_LIBS := $(shell $(PKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf)
3636

37+
SKIP_DOCS ?=
38+
SKIP_LLVM ?=
39+
3740
ifeq ($(srctree),)
3841
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
3942
srctree := $(patsubst %/,%,$(dir $(srctree)))
@@ -172,6 +175,7 @@ override OUTPUT := $(patsubst %/,%,$(OUTPUT))
172175
endif
173176
endif
174177

178+
ifneq ($(SKIP_LLVM),1)
175179
ifeq ($(feature-llvm),1)
176180
LLVM_CFLAGS += -DHAVE_LLVM_SUPPORT
177181
LLVM_CONFIG_LIB_COMPONENTS := mcdisassembler all-targets
@@ -187,6 +191,7 @@ ifeq ($(feature-llvm),1)
187191
endif
188192
LLVM_LDFLAGS += $(shell $(LLVM_CONFIG) --ldflags)
189193
endif
194+
endif
190195

191196
SCRATCH_DIR := $(OUTPUT)/tools
192197
BUILD_DIR := $(SCRATCH_DIR)/build

0 commit comments

Comments
 (0)