aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-11-04 20:04:44 +0100
committerFelix Fietkau <nbd@nbd.name>2021-11-04 20:06:14 +0100
commit9f90a89655d41ba8afcd8018d7bc8b3753beb17e (patch)
treeead1ebfa7f623eda36d9f0af892e28d769a322c0 /include
parent10cbce3b52c9a21b115a471fa548a40e1212e3e9 (diff)
downloadupstream-9f90a89655d41ba8afcd8018d7bc8b3753beb17e.tar.gz
upstream-9f90a89655d41ba8afcd8018d7bc8b3753beb17e.tar.bz2
upstream-9f90a89655d41ba8afcd8018d7bc8b3753beb17e.zip
build: add support for using prebuilt LLVM toolchain
When the prebuilt llvm toolchain is unpacked into the source dir, it is automatically picked up and used by the build system, and eBPF based packages can be selected Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include')
-rw-r--r--include/bpf.mk10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/bpf.mk b/include/bpf.mk
index 28cdf6cb32..c68ad74554 100644
--- a/include/bpf.mk
+++ b/include/bpf.mk
@@ -1,6 +1,7 @@
BPF_DEPENDS := @HAS_BPF_TOOLCHAIN
+LLVM_VER:=
-ifneq ($(CONFIG_BPF_TOOLCHAIN_HOST),)
+ifneq ($(CONFIG_USE_LLVM_HOST),)
BPF_TOOLCHAIN_HOST_PATH:=$(call qstrip,$(CONFIG_BPF_TOOLCHAIN_HOST_PATH))
ifneq ($(BPF_TOOLCHAIN_HOST_PATH),)
BPF_PATH:=$(BPF_TOOLCHAIN_HOST_PATH)/bin:$(PATH)
@@ -9,9 +10,12 @@ ifneq ($(CONFIG_BPF_TOOLCHAIN_HOST),)
endif
CLANG:=$(firstword $(shell PATH='$(BPF_PATH)' which clang clang-13 clang-12 clang-11))
LLVM_VER:=$(subst clang,,$(notdir $(CLANG)))
-else
+endif
+ifneq ($(CONFIG_USE_LLVM_PREBUILT),)
+ CLANG:=$(TOPDIR)/llvm-bpf/bin/clang
+endif
+ifneq ($(CONFIG_USE_LLVM_BUILD),)
CLANG:=$(STAGING_DIR_HOST)/llvm-bpf/bin/clang
- LLVM_VER:=
endif
LLVM_PATH:=$(dir $(CLANG))