diff options
Diffstat (limited to 'meta/recipes-devtools/rust/libstd-rs.inc')
-rw-r--r-- | meta/recipes-devtools/rust/libstd-rs.inc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rust/libstd-rs.inc b/meta/recipes-devtools/rust/libstd-rs.inc new file mode 100644 index 0000000000..987956344a --- /dev/null +++ b/meta/recipes-devtools/rust/libstd-rs.inc | |||
@@ -0,0 +1,40 @@ | |||
1 | SUMMARY = "Rust standard libaries" | ||
2 | HOMEPAGE = "http://www.rust-lang.org" | ||
3 | SECTION = "devel" | ||
4 | LICENSE = "MIT | Apache-2.0" | ||
5 | LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0" | ||
6 | |||
7 | RUSTLIB_DEP = "" | ||
8 | inherit cargo | ||
9 | |||
10 | DEPENDS:append:libc-musl = " libunwind" | ||
11 | # rv32 does not have libunwind ported yet | ||
12 | DEPENDS:remove:riscv32 = "libunwind" | ||
13 | DEPENDS:remove:riscv64 = "libunwind" | ||
14 | |||
15 | # Embed bitcode in order to allow compiling both with and without LTO | ||
16 | RUSTFLAGS += "-Cembed-bitcode=yes" | ||
17 | # Needed so cargo can find libbacktrace | ||
18 | RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so" | ||
19 | |||
20 | S = "${RUSTSRC}/src/libstd" | ||
21 | |||
22 | CARGO_FEATURES ?= "panic-unwind backtrace" | ||
23 | CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'" | ||
24 | CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor" | ||
25 | |||
26 | do_compile:prepend () { | ||
27 | export CARGO_TARGET_DIR="${B}" | ||
28 | # For Rust 1.13.0 and newer | ||
29 | export RUSTC_BOOTSTRAP="1" | ||
30 | } | ||
31 | |||
32 | do_install () { | ||
33 | mkdir -p ${D}${rustlibdir} | ||
34 | |||
35 | # With the incremental build support added in 1.24, the libstd deps directory also includes dependency | ||
36 | # files that get installed. Those are really only needed to incrementally rebuild the libstd library | ||
37 | # itself and don't need to be installed. | ||
38 | rm -f ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/*.d | ||
39 | cp ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir} | ||
40 | } | ||