blob: f4e5abc0cc43c7e71f7191b37868b60503333ed4 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "Rust standard libaries"
2HOMEPAGE = "http://www.rust-lang.org"
3SECTION = "devel"
4LICENSE = "(MIT | Apache-2.0) & Unicode-TOU"
Patrick Williams864cc432023-02-09 14:54:44 -06005LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=c2cccf560306876da3913d79062a54b9"
Andrew Geissler517393d2023-01-13 08:55:19 -06006
7require rust-source.inc
8
9# Building with library/std omits proc_macro from the sysroot. Using
10# library/test causes that to be installed which then allows cargo to
11# build (https://github.com/meta-rust/meta-rust/issues/266)
12S = "${RUSTSRC}/library/test"
13
14RUSTLIB_DEP = ""
15inherit cargo
16
17DEPENDS:append:libc-musl = " libunwind"
18# rv32 does not have libunwind ported yet
19DEPENDS:remove:riscv32 = "libunwind"
20DEPENDS:remove:riscv64 = "libunwind"
21
22# Embed bitcode in order to allow compiling both with and without LTO
23RUSTFLAGS += "-Cembed-bitcode=yes"
24# Needed so cargo can find libbacktrace
25RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
26
27CARGO_FEATURES ?= "panic-unwind backtrace"
28CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'"
29CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
30
31do_compile:prepend () {
32 export CARGO_TARGET_DIR="${B}"
33 # For Rust 1.13.0 and newer
34 export RUSTC_BOOTSTRAP="1"
35}
36
37do_install () {
38 mkdir -p ${D}${rustlibdir}
39
40 # With the incremental build support added in 1.24, the libstd deps directory also includes dependency
41 # files that get installed. Those are really only needed to incrementally rebuild the libstd library
42 # itself and don't need to be installed.
43 rm -f ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/*.d
44 cp ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir}
45}
46
47BBCLASSEXTEND = "nativesdk"