diff options
Diffstat (limited to 'meta/recipes-devtools/rust/libstd-rs_1.86.0.bb')
-rw-r--r-- | meta/recipes-devtools/rust/libstd-rs_1.86.0.bb | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rust/libstd-rs_1.86.0.bb b/meta/recipes-devtools/rust/libstd-rs_1.86.0.bb new file mode 100644 index 0000000000..b39ec0ab39 --- /dev/null +++ b/meta/recipes-devtools/rust/libstd-rs_1.86.0.bb | |||
@@ -0,0 +1,52 @@ | |||
1 | SUMMARY = "Rust standard libaries" | ||
2 | HOMEPAGE = "http://www.rust-lang.org" | ||
3 | SECTION = "devel" | ||
4 | LICENSE = "(MIT | Apache-2.0) & Unicode-3.0" | ||
5 | LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=11a3899825f4376896e438c8c753f8dc" | ||
6 | |||
7 | require rust-source.inc | ||
8 | |||
9 | # The dummy crate named `sysroot` represents the standard library target. | ||
10 | # | ||
11 | # See fd4c81f4c19e ("Add a `sysroot` crate to represent the standard library crates") | ||
12 | # https://github.com/rust-lang/rust/pull/108865/ | ||
13 | S = "${RUSTSRC}/library/sysroot" | ||
14 | |||
15 | RUSTLIB_DEP = "" | ||
16 | inherit cargo | ||
17 | |||
18 | CVE_PRODUCT = "rust" | ||
19 | |||
20 | DEPENDS:append:libc-musl = " libunwind" | ||
21 | # rv32 does not have libunwind ported yet | ||
22 | DEPENDS:remove:riscv32 = "libunwind" | ||
23 | DEPENDS:remove:riscv64 = "libunwind" | ||
24 | |||
25 | # Embed bitcode in order to allow compiling both with and without LTO | ||
26 | RUSTFLAGS += "-Cembed-bitcode=yes" | ||
27 | # Ensure that user code can't access the dependencies of the standard library | ||
28 | RUSTFLAGS += "-Zforce-unstable-if-unmarked" | ||
29 | # Needed so cargo can find libbacktrace | ||
30 | RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so" | ||
31 | |||
32 | CARGO_FEATURES ?= "panic-unwind backtrace" | ||
33 | CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'" | ||
34 | CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor" | ||
35 | |||
36 | do_compile:prepend () { | ||
37 | export CARGO_TARGET_DIR="${B}" | ||
38 | # For Rust 1.13.0 and newer | ||
39 | export RUSTC_BOOTSTRAP="1" | ||
40 | } | ||
41 | |||
42 | do_install () { | ||
43 | mkdir -p ${D}${rustlibdir} | ||
44 | |||
45 | # With the incremental build support added in 1.24, the libstd deps directory also includes dependency | ||
46 | # files that get installed. Those are really only needed to incrementally rebuild the libstd library | ||
47 | # itself and don't need to be installed. | ||
48 | rm -f ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/*.d | ||
49 | cp ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir} | ||
50 | } | ||
51 | |||
52 | BBCLASSEXTEND = "nativesdk" | ||