aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain
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 /toolchain
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 'toolchain')
-rw-r--r--toolchain/Config.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/toolchain/Config.in b/toolchain/Config.in
index a7da2a1f73..366f5c8b48 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -41,11 +41,17 @@ menuconfig TARGET_OPTIONS
choice BPF_TOOLCHAIN
prompt "BPF toolchain" if DEVEL
default BPF_TOOLCHAIN_BUILD_LLVM if BUILDBOT
+ default BPF_TOOLCHAIN_PREBUILT if HAS_PREBUILT_LLVM_TOOLCHAIN
default BPF_TOOLCHAIN_NONE
config BPF_TOOLCHAIN_NONE
bool "None"
+ config BPF_TOOLCHAIN_PREBUILT
+ bool "Use prebuilt LLVM toolchain"
+ depends on HAS_PREBUILT_LLVM_TOOLCHAIN
+ select USE_LLVM_PREBUILT
+
config BPF_TOOLCHAIN_HOST
select USE_LLVM_HOST
bool "Use host LLVM toolchain"
@@ -298,10 +304,18 @@ config GDB_PYTHON
config HAS_BPF_TOOLCHAIN
bool
+config HAS_PREBUILT_LLVM_TOOLCHAIN
+ def_bool $(shell, [ -f llvm-bpf/.llvm-version ] && echo y || echo n)
+
config USE_LLVM_HOST
select HAS_BPF_TOOLCHAIN
bool
+config USE_LLVM_PREBUILT
+ select HAS_BPF_TOOLCHAIN
+ default y if !DEVEL && !BUILDBOT && HAS_PREBUILT_LLVM_TOOLCHAIN
+ bool
+
config USE_LLVM_BUILD
default y if !DEVEL && BUILDBOT
select HAS_BPF_TOOLCHAIN