blob: 9baad12dc8eb2c3dcb9b1a07d0132f7c3bc40a5e [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
Andrew Geissler595f6302022-01-24 19:11:47 +00005SRC_URI += "file://0002-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \
Patrick Williams03907ee2022-05-01 06:28:52 -05006 file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \
7 file://0003-llvm-fix-include-benchmarks.patch;striplevel=2"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05008
9S = "${RUSTSRC}/src/llvm-project/llvm"
10
11LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe"
12
13inherit cmake python3native
14
15DEPENDS += "ninja-native rust-llvm-native"
16
17ARM_INSTRUCTION_SET:armv5 = "arm"
18ARM_INSTRUCTION_SET:armv4t = "arm"
19
Andrew Geisslereff27472021-10-29 15:35:00 -050020# rustc_llvm with debug info is not recognized as a valid crate that's
21# generated by rust-llvm-native.
22CFLAGS:remove = "-g"
23CXXFLAGS:remove = "-g"
24
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050025LLVM_DIR = "llvm${LLVM_RELEASE}"
26
27EXTRA_OECMAKE = " \
28 -DCMAKE_BUILD_TYPE=Release \
29 -DLLVM_TARGETS_TO_BUILD='ARM;AArch64;Mips;PowerPC;RISCV;X86' \
30 -DLLVM_BUILD_DOCS=OFF \
31 -DLLVM_ENABLE_TERMINFO=OFF \
32 -DLLVM_ENABLE_ZLIB=OFF \
33 -DLLVM_ENABLE_LIBXML2=OFF \
34 -DLLVM_ENABLE_FFI=OFF \
35 -DLLVM_INSTALL_UTILS=ON \
36 -DLLVM_BUILD_EXAMPLES=OFF \
37 -DLLVM_INCLUDE_EXAMPLES=OFF \
38 -DLLVM_BUILD_TESTS=OFF \
39 -DLLVM_INCLUDE_TESTS=OFF \
40 -DLLVM_TARGET_ARCH=${TARGET_ARCH} \
41 -DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust \
42"
43EXTRA_OECMAKE:append:class-target = "\
44 -DCMAKE_CROSSCOMPILING:BOOL=ON \
45 -DLLVM_BUILD_TOOLS=OFF \
46 -DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \
47 -DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \
48"
49
50# The debug symbols are huge here (>2GB) so suppress them since they
51# provide almost no value. If you really need them then override this
52INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
53
54export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config"
55
56do_install:append () {
57 # we don't need any of this stuff to build Rust
58 rm -rf "${D}/usr/lib/cmake"
59}
60
61PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liblto"
62
63# Add the extra locations to avoid the complaints about unpackaged files
64FILES:${PN}-bugpointpasses = "${libdir}/llvm-rust/lib/BugpointPasses.so"
65FILES:${PN}-llvmhello = "${libdir}/llvm-rust/lib/LLVMHello.so"
66FILES:${PN}-liblto = "${libdir}/llvm-rust/lib/libLTO.so.*"
67FILES:${PN}-staticdev =+ "${libdir}/llvm-rust/*/*.a"
68FILES:${PN} += "${libdir}/libLLVM*.so.* ${libdir}/llvm-rust/lib/*.so.* ${libdir}/llvm-rust/bin"
69FILES:${PN}-dev += "${datadir}/llvm ${libdir}/llvm-rust/lib/*.so ${libdir}/llvm-rust/include ${libdir}/llvm-rust/share ${libdir}/llvm-rust/lib/cmake"
70
71BBCLASSEXTEND = "native"