diff options
| author | Alex Kiernan <alex.kiernan@gmail.com> | 2022-12-21 12:52:57 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-23 12:06:35 +0000 |
| commit | 35528aff99478200ab22f921d16b7c85f106fd32 (patch) | |
| tree | dbc05f129352920540f4fa167a13276801cf0057 /meta | |
| parent | 06763de40af8dd0c152bfb536f3d6e83e1c03000 (diff) | |
| download | poky-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>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-devtools/rust/libstd-rs.inc | 40 | ||||
| -rw-r--r-- | meta/recipes-devtools/rust/libstd-rs_1.66.0.bb | 40 |
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 @@ | |||
| 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 | |||
| 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. | ||
| 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 @@ | |||
| 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 | require rust-source.inc | 7 | require rust-source.inc |
| 2 | require 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+ |
| 5 | S = "${RUSTSRC}/library/std" | 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 | BBCLASSEXTEND = "nativesdk" | 45 | BBCLASSEXTEND = "nativesdk" |
