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