Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 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. |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 38 | rm -f ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/*.d |
| 39 | cp ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir} |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 40 | } |