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
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 \
-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))