llvm-bpf: move to staging_dir/host/llvm-bpf
authorFelix Fietkau <nbd@nbd.name>
Tue, 2 Nov 2021 18:38:12 +0000 (19:38 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 4 Nov 2021 15:55:04 +0000 (16:55 +0100)
This makes it easier to package it up for the download server

Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/bpf.mk
tools/llvm-bpf/Makefile

index 9636ad5165497ce434c39213739db9374442d03f..28cdf6cb3235f938077c521b2c0b86e19feb01db 100644 (file)
@@ -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
 
index a5ba2a4cb772d5c9d5d30c470bea904fe65ae6a4..ae279d26d2ae8c0b6f8250db90350c876f0168c4 100644 (file)
@@ -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))