[openwrt/openwrt] llvm-bpf: move to staging_dir/host/llvm-bpf

LEDE Commits lede-commits at lists.infradead.org
Thu Nov 4 08:59:42 PDT 2021


nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a7c0d7c06c5b353c98f6db6b0b766d2ff3dd6887

commit a7c0d7c06c5b353c98f6db6b0b766d2ff3dd6887
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Nov 2 19:38:12 2021 +0100

    llvm-bpf: move to staging_dir/host/llvm-bpf
    
    This makes it easier to package it up for the download server
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/bpf.mk          | 2 +-
 tools/llvm-bpf/Makefile | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/bpf.mk b/include/bpf.mk
index 9636ad5165..28cdf6cb32 100644
--- a/include/bpf.mk
+++ b/include/bpf.mk
@@ -10,7 +10,7 @@ ifneq ($(CONFIG_BPF_TOOLCHAIN_HOST),)
   CLANG:=$(firstword $(shell PATH='$(BPF_PATH)' which clang clang-13 clang-12 clang-11))
   LLVM_VER:=$(subst clang,,$(notdir $(CLANG)))
 else
-  CLANG:=$(STAGING_DIR_HOST)/bin/clang
+  CLANG:=$(STAGING_DIR_HOST)/llvm-bpf/bin/clang
   LLVM_VER:=
 endif
 
diff --git a/tools/llvm-bpf/Makefile b/tools/llvm-bpf/Makefile
index a5ba2a4cb7..ae279d26d2 100644
--- a/tools/llvm-bpf/Makefile
+++ b/tools/llvm-bpf/Makefile
@@ -24,6 +24,8 @@ CMAKE_SOURCE_SUBDIR := llvm
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/cmake.mk
 
+CMAKE_HOST_INSTALL_PREFIX = $(STAGING_DIR_HOST)/llvm-bpf
+
 CMAKE_HOST_OPTIONS += \
 	-DLLVM_ENABLE_BINDINGS=OFF \
 	-DLLVM_INCLUDE_DOCS=OFF \
@@ -31,6 +33,10 @@ CMAKE_HOST_OPTIONS += \
 	-DLLVM_INCLUDE_TESTS=OFF \
 	-DLLVM_ENABLE_PROJECTS="clang;lld" \
 	-DLLVM_TARGETS_TO_BUILD=BPF \
-	-DCLANG_BUILD_EXAMPLES=OFF
+	-DCLANG_BUILD_EXAMPLES=OFF \
+	-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \
+	-DLLVM_LINK_LLVM_DYLIB=ON \
+	-DLLVM_TOOLCHAIN_TOOLS="llvm-objcopy;llvm-objdump;llvm-readelf;llvm-strip;llvm-ar;llvm-as;llvm-dis;llvm-link;llvm-nm;llvm-ranlib;llc;opt" \
+	-DCMAKE_SKIP_RPATH=OFF
 
 $(eval $(call HostBuild))



More information about the lede-commits mailing list