blob: 987956344a243a7a1e5c4ded131fd4712acf4f6c [file] [log] [blame]
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05001SUMMARY = "Rust standard libaries"
2HOMEPAGE = "http://www.rust-lang.org"
3SECTION = "devel"
4LICENSE = "MIT | Apache-2.0"
5LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
6
7RUSTLIB_DEP = ""
8inherit cargo
9
10DEPENDS:append:libc-musl = " libunwind"
11# rv32 does not have libunwind ported yet
12DEPENDS:remove:riscv32 = "libunwind"
13DEPENDS:remove:riscv64 = "libunwind"
14
15# Embed bitcode in order to allow compiling both with and without LTO
16RUSTFLAGS += "-Cembed-bitcode=yes"
17# Needed so cargo can find libbacktrace
18RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
19
20S = "${RUSTSRC}/src/libstd"
21
22CARGO_FEATURES ?= "panic-unwind backtrace"
23CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'"
24CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
25
26do_compile:prepend () {
27 export CARGO_TARGET_DIR="${B}"
28 # For Rust 1.13.0 and newer
29 export RUSTC_BOOTSTRAP="1"
30}
31
32do_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}