Skip to content

Commit 3b611e3

Browse files
committed
libstd-rs: Merge .inc into .bb
Signed-off-by: Alex Kiernan <[email protected]>
1 parent c109e04 commit 3b611e3

File tree

2 files changed

+39
-41
lines changed

2 files changed

+39
-41
lines changed

recipes-devtools/rust/libstd-rs.inc

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,45 @@
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+
17
require rust-source.inc
2-
require libstd-rs.inc
38

49
# libstd moved from src/libstd to library/std in 1.47+
510
S = "${RUSTSRC}/library/std"
611

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+
745
BBCLASSEXTEND = "nativesdk"

0 commit comments

Comments
 (0)