blob: d7f445385be4bce22762275a08319da8800144b4 [file] [log] [blame]
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05001SUMMARY = "LLVM compiler framework (packaged with rust)"
2LICENSE ?= "Apache-2.0-with-LLVM-exception"
3HOMEPAGE = "http://www.rust-lang.org"
4
5SRC_URI += "file://0002-llvm-allow-env-override-of-exe-path.patch;striplevel=2"
6
7S = "${RUSTSRC}/src/llvm-project/llvm"
8
9LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe"
10
11inherit cmake python3native
12
13DEPENDS += "ninja-native rust-llvm-native"
14
15ARM_INSTRUCTION_SET:armv5 = "arm"
16ARM_INSTRUCTION_SET:armv4t = "arm"
17
18LLVM_DIR = "llvm${LLVM_RELEASE}"
19
20EXTRA_OECMAKE = " \
21 -DCMAKE_BUILD_TYPE=Release \
22 -DLLVM_TARGETS_TO_BUILD='ARM;AArch64;Mips;PowerPC;RISCV;X86' \
23 -DLLVM_BUILD_DOCS=OFF \
24 -DLLVM_ENABLE_TERMINFO=OFF \
25 -DLLVM_ENABLE_ZLIB=OFF \
26 -DLLVM_ENABLE_LIBXML2=OFF \
27 -DLLVM_ENABLE_FFI=OFF \
28 -DLLVM_INSTALL_UTILS=ON \
29 -DLLVM_BUILD_EXAMPLES=OFF \
30 -DLLVM_INCLUDE_EXAMPLES=OFF \
31 -DLLVM_BUILD_TESTS=OFF \
32 -DLLVM_INCLUDE_TESTS=OFF \
33 -DLLVM_TARGET_ARCH=${TARGET_ARCH} \
34 -DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust \
35"
36EXTRA_OECMAKE:append:class-target = "\
37 -DCMAKE_CROSSCOMPILING:BOOL=ON \
38 -DLLVM_BUILD_TOOLS=OFF \
39 -DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \
40 -DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \
41"
42
43# The debug symbols are huge here (>2GB) so suppress them since they
44# provide almost no value. If you really need them then override this
45INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
46
47export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config"
48
49do_install:append () {
50 # we don't need any of this stuff to build Rust
51 rm -rf "${D}/usr/lib/cmake"
52}
53
54PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liblto"
55
56# Add the extra locations to avoid the complaints about unpackaged files
57FILES:${PN}-bugpointpasses = "${libdir}/llvm-rust/lib/BugpointPasses.so"
58FILES:${PN}-llvmhello = "${libdir}/llvm-rust/lib/LLVMHello.so"
59FILES:${PN}-liblto = "${libdir}/llvm-rust/lib/libLTO.so.*"
60FILES:${PN}-staticdev =+ "${libdir}/llvm-rust/*/*.a"
61FILES:${PN} += "${libdir}/libLLVM*.so.* ${libdir}/llvm-rust/lib/*.so.* ${libdir}/llvm-rust/bin"
62FILES:${PN}-dev += "${datadir}/llvm ${libdir}/llvm-rust/lib/*.so ${libdir}/llvm-rust/include ${libdir}/llvm-rust/share ${libdir}/llvm-rust/lib/cmake"
63
64BBCLASSEXTEND = "native"