mirror of
https://git.yoctoproject.org/poky
synced 2026-02-25 19:09:41 +01:00
Rust stable version updated to 1.86.0. https://blog.rust-lang.org/2025/04/03/Rust-1.86.0.html * Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. As per rust document this is a required dependency. Fixes: | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated.f9c16997dcIt adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * Disable building of extended Rust tools to reduce build time and filesystem usage. Update config.toml to disable building of extended Rust tools that are not required. This helps minimize unnecessary build time and filesystem usage. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: https://github.com/rust-lang/rust/pull/1350018744b44e6b* Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0139d6ba054* LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. https://github.com/rust-lang/rust/commit/1fe351b * Restrict tests using "//@only <target_arch>" to avoid failures on riscv64, which is now part of default AB testing. Since riscv64 is Tier 2 with no automated testing, some tests may fail. This approach ensures tests continue running on supported architectures while skipping them on riscv64. https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools (From OE-Core rev: c064ef18343a956aea397d36d2e7665d6c8afd7d) Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
99 lines
3.3 KiB
BlitzBasic
99 lines
3.3 KiB
BlitzBasic
SUMMARY = "LLVM compiler framework (packaged with rust)"
|
|
LICENSE ?= "Apache-2.0-with-LLVM-exception"
|
|
HOMEPAGE = "http://www.rust-lang.org"
|
|
|
|
# check src/llvm-project/cmake/Modules/LLVMVersion.cmake for llvm version in use
|
|
#
|
|
LLVM_RELEASE = "19.1.7"
|
|
|
|
require rust-source.inc
|
|
|
|
SRC_URI += "file://0002-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \
|
|
file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \
|
|
"
|
|
|
|
S = "${RUSTSRC}/src/llvm-project/llvm"
|
|
|
|
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe"
|
|
|
|
inherit cmake
|
|
|
|
DEPENDS += "ninja-native rust-llvm-native"
|
|
|
|
ARM_INSTRUCTION_SET:armv5 = "arm"
|
|
ARM_INSTRUCTION_SET:armv4t = "arm"
|
|
|
|
# rustc_llvm with debug info is not recognized as a valid crate that's
|
|
# generated by rust-llvm-native.
|
|
CFLAGS:remove = "-g"
|
|
CXXFLAGS:remove = "-g"
|
|
|
|
LLVM_DIR = "llvm${LLVM_RELEASE}"
|
|
|
|
RUST_LLVM_TARGETS ?= "ARM;AArch64;Mips;PowerPC;RISCV;X86"
|
|
|
|
EXTRA_OECMAKE = " \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DLLVM_TARGETS_TO_BUILD='${RUST_LLVM_TARGETS}' \
|
|
-DLLVM_BUILD_DOCS=OFF \
|
|
-DLLVM_ENABLE_TERMINFO=OFF \
|
|
-DLLVM_ENABLE_ZLIB=OFF \
|
|
-DLLVM_ENABLE_ZSTD=OFF \
|
|
-DLLVM_ENABLE_LIBXML2=OFF \
|
|
-DLLVM_ENABLE_FFI=OFF \
|
|
-DLLVM_ENABLE_LIBEDIT=OFF \
|
|
-DLLVM_INSTALL_UTILS=ON \
|
|
-DLLVM_BUILD_EXAMPLES=OFF \
|
|
-DLLVM_BUILD_LLVM_DYLIB=ON \
|
|
-DLLVM_LINK_LLVM_DYLIB=ON \
|
|
-DLLVM_INCLUDE_EXAMPLES=OFF \
|
|
-DLLVM_BUILD_TESTS=OFF \
|
|
-DLLVM_INCLUDE_TESTS=OFF \
|
|
-DLLVM_INCLUDE_BENCHMARKS=OFF \
|
|
-DLLVM_TARGET_ARCH=${TARGET_ARCH} \
|
|
-DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust \
|
|
"
|
|
|
|
# Forcibly disable the detection of these packages as otherwise
|
|
# it will look at the host Python install
|
|
EXTRA_OECMAKE += "\
|
|
-DPY_PYGMENTS_FOUND=OFF \
|
|
-DPY_PYGMENTS_LEXERS_C_CPP_FOUND=OFF \
|
|
-DPY_YAML_FOUND=OFF \
|
|
"
|
|
|
|
EXTRA_OECMAKE:append:class-target = "\
|
|
-DLLVM_BUILD_TOOLS=OFF \
|
|
-DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \
|
|
-DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \
|
|
"
|
|
|
|
EXTRA_OECMAKE:append:class-nativesdk = "\
|
|
-DLLVM_BUILD_TOOLS=OFF \
|
|
-DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \
|
|
-DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \
|
|
"
|
|
|
|
# The debug symbols are huge here (>2GB) so suppress them since they
|
|
# provide almost no value. If you really need them then override this
|
|
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
|
|
|
|
export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config"
|
|
|
|
do_install:append () {
|
|
# we don't need any of this stuff to build Rust
|
|
rm -rf "${D}/usr/lib/cmake"
|
|
}
|
|
|
|
PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liblto"
|
|
|
|
# Add the extra locations to avoid the complaints about unpackaged files
|
|
FILES:${PN}-bugpointpasses = "${libdir}/llvm-rust/lib/BugpointPasses.so"
|
|
FILES:${PN}-llvmhello = "${libdir}/llvm-rust/lib/LLVMHello.so"
|
|
FILES:${PN}-liblto = "${libdir}/llvm-rust/lib/libLTO.so.*"
|
|
FILES:${PN}-staticdev =+ "${libdir}/llvm-rust/*/*.a"
|
|
FILES:${PN} += "${libdir}/libLLVM*.so.* ${libdir}/llvm-rust/lib/*.so.* ${libdir}/llvm-rust/bin"
|
|
FILES:${PN}-dev += "${datadir}/llvm ${libdir}/llvm-rust/lib/*.so ${libdir}/llvm-rust/include ${libdir}/llvm-rust/share ${libdir}/llvm-rust/lib/cmake"
|
|
|
|
BBCLASSEXTEND = "native nativesdk"
|