summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2022-12-21 12:52:57 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-23 12:06:35 +0000
commit35528aff99478200ab22f921d16b7c85f106fd32 (patch)
treedbc05f129352920540f4fa167a13276801cf0057
parent06763de40af8dd0c152bfb536f3d6e83e1c03000 (diff)
downloadpoky-35528aff99478200ab22f921d16b7c85f106fd32.tar.gz
libstd-rs: Merge .inc into .bb
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/rust/libstd-rs.inc40
-rw-r--r--meta/recipes-devtools/rust/libstd-rs_1.66.0.bb40
2 files changed, 39 insertions, 41 deletions
diff --git a/meta/recipes-devtools/rust/libstd-rs.inc b/meta/recipes-devtools/rust/libstd-rs.inc
deleted file mode 100644
index 44cf683837..0000000000
--- a/meta/recipes-devtools/rust/libstd-rs.inc
+++ /dev/null
@@ -1,40 +0,0 @@
1SUMMARY = "Rust standard libaries"
2HOMEPAGE = "http://www.rust-lang.org"
3SECTION = "devel"
4LICENSE = "(MIT | Apache-2.0) & Unicode-TOU"
5LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=92289ed52a60b63ab715612ad2915603"
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}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/*.d
39 cp ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir}
40}
diff --git a/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb b/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
index eec0245ae1..6c5a979f4f 100644
--- a/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
+++ b/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
@@ -1,7 +1,45 @@
1SUMMARY = "Rust standard libaries"
2HOMEPAGE = "http://www.rust-lang.org"
3SECTION = "devel"
4LICENSE = "(MIT | Apache-2.0) & Unicode-TOU"
5LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=92289ed52a60b63ab715612ad2915603"
6
1require rust-source.inc 7require rust-source.inc
2require libstd-rs.inc
3 8
4# libstd moved from src/libstd to library/std in 1.47+ 9# libstd moved from src/libstd to library/std in 1.47+
5S = "${RUSTSRC}/library/std" 10S = "${RUSTSRC}/library/std"
6 11
12RUSTLIB_DEP = ""
13inherit cargo
14
15DEPENDS:append:libc-musl = " libunwind"
16# rv32 does not have libunwind ported yet
17DEPENDS:remove:riscv32 = "libunwind"
18DEPENDS:remove:riscv64 = "libunwind"
19
20# Embed bitcode in order to allow compiling both with and without LTO
21RUSTFLAGS += "-Cembed-bitcode=yes"
22# Needed so cargo can find libbacktrace
23RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
24
25CARGO_FEATURES ?= "panic-unwind backtrace"
26CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'"
27CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
28
29do_compile:prepend () {
30 export CARGO_TARGET_DIR="${B}"
31 # For Rust 1.13.0 and newer
32 export RUSTC_BOOTSTRAP="1"
33}
34
35do_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
7BBCLASSEXTEND = "nativesdk" 45BBCLASSEXTEND = "nativesdk"