rust-target-config: Update the data layout for x86 and ppc targets.
PATCH 1/3 rust-target-config: Update the data layout for x86 and ppc targets.
From: Deepesh Varatharajan <[email protected]>
The data layout for x86 and ppc targets were different in rust from llvm.
-----------------------------------------------------------------------------------------
error: data-layout for target x86-linux, e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128, differs from LLVM target's i686-unknown-linux-gnu default layout, e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128
error: data-layout for target powerpc-linux, E-m:e-p:32:32-i64:64-n32, differs from LLVM target's powerpc-unknown-linux-gnu default layout, E-m:e-p:32:32-Fn32-i64:64-n32
-----------------------------------------------------------------------------------------
Rust commits for updating the data layouts:
x86: https://github.com/rust-lang/rust/commit/dbff90c2a7c751cf9d6843cd585429beb100c17d
ppc: https://github.com/rust-lang/rust/commit/ad7ea8b7e690e6000006b6fde630a2c8c4385019
--- meta/classes-recipe/rust-target-config.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes-recipe/rust-target-config.bbclass +2 -2
@@ -167,7 +167,7 @@ TARGET_C_INT_WIDTH[x86_64-x32] = "32" MAX_ATOMIC_WIDTH[x86_64-x32] = "64" ## i686-unknown-linux-{gnu, musl} -DATA_LAYOUT[i686] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" +DATA_LAYOUT[i686] = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128" TARGET_ENDIAN[i686] = "little" TARGET_POINTER_WIDTH[i686] = "32" TARGET_C_INT_WIDTH[i686] = "32"
@@ -216,7 +216,7 @@ TARGET_C_INT_WIDTH[mips64el] = "32" MAX_ATOMIC_WIDTH[mips64el] = "64" ## powerpc-unknown-linux-{gnu, musl} -DATA_LAYOUT[powerpc] = "E-m:e-p:32:32-i64:64-n32" +DATA_LAYOUT[powerpc] = "E-m:e-p:32:32-Fn32-i64:64-n32" TARGET_ENDIAN[powerpc] = "big" TARGET_POINTER_WIDTH[powerpc] = "32" TARGET_C_INT_WIDTH[powerpc] = "32"
Signature · 1 line
2.43.0
PATCH 2/3 rust: Fix for duplicate libstd.so
From: Deepesh Varatharajan <[email protected]>
The do_package task fail with below error due to multiple libstd.so files installed in lib dir.
---------------------------------------------------------------------------------------------------------------------------
ERROR: rust-1.81.0-r0 do_package: rust-rustdoc: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust-rustdoc/usr/bin/rustdoc)
ERROR: rust-1.81.0-r0 do_package: rust-tools-rustfmt: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust-tools-rustfmt/usr/bin/rustfmt)
ERROR: rust-1.81.0-r0 do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/rustc)
ERROR: rust-1.81.0-r0 do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/clippy-driver)
ERROR: rust-1.81.0-r0 do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/cargo-clippy)
ERROR: rust-1.81.0-r0 do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/lib/ librustc_driver-fc36770e343ef852.so)
---------------------------------------------------------------------------------------------------------------------------
To fix the redundant libstd.so files are removed from the usr/lib/.
--- meta/recipes-devtools/rust/rust_1.80.1.bb | 6 ++++++ 1 file changed, 6 insertions(+)
meta/recipes-devtools/rust/rust_1.80.1.bb +6 -0
@@ -271,6 +271,7 @@ rust_do_install:class-nativesdk() { rm ${D}${libdir}/rustlib/uninstall.sh rm ${D}${libdir}/rustlib/install.log rm ${D}${libdir}/rustlib/manifest* + rm ${D}${libdir}/rustlib/${TARGET_ARCH}-pokysdk-linux-gnu/lib/libstd-*.so } EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt"
@@ -294,6 +295,11 @@ rust_do_install:class-target() { rm ${D}${libdir}/rustlib/uninstall.sh rm ${D}${libdir}/rustlib/install.log rm ${D}${libdir}/rustlib/manifest* + if [ "${TCLIBC}" = "musl" ]; then + rm -f ${D}${libdir}/rustlib/${TARGET_ARCH}-poky-linux-musl/lib/libstd-*.so + elif [ "${TCLIBC}" = "glibc" ]; then + rm -f ${D}${libdir}/rustlib/${TARGET_ARCH}-poky-linux-gnu/lib/libstd-*.so + fi } addtask do_update_snapshot after do_patch
Signature · 1 line
2.43.0
Re: [OE-core] [PATCH 2/3] rust: Fix for duplicate libstd.so
Quoted 40 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan<[email protected]>
The
do_packagetask fail with below error due to multiplelibstd.sofiles installed in lib dir.---------------------------------------------------------------------------------------------------------------------------
ERROR: rust-1.81.0-r0do_package: rust-rustdoc: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust-rustdoc/usr/bin/rustdoc)
ERROR: rust-1.81.0-r0do_package: rust-tools-rustfmt: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust-tools-rustfmt/usr/bin/rustfmt)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/rustc)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/clippy-driver)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/cargo-clippy)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/lib/ librustc_driver-fc36770e343ef852.so)
---------------------------------------------------------------------------------------------------------------------------To fix the redundant
libstd.sofiles are removed from theusr/lib/.Signed-off-by Deepesh Varatharajan<[email protected]>--- meta/recipes-devtools/rust/rust_1.80.1.bb | 6 ++++++ 1 file changed, 6 insertions(+)meta/recipes-devtools/rust/rust_1.80.1.bb +1
-0@@ -271,6 +271,7 @@ rust_do_install:class-nativesdk() { rm ${D}${libdir}/rustlib/uninstall.sh rm ${D}${libdir}/rustlib/install.log rm ${D}${libdir}/rustlib/manifest* + rm ${D}${libdir}/rustlib/${TARGET_ARCH}-pokysdk-linux-gnu/lib/libstd-*.so } EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt" @@ -294,6 +295,11 @@ rust_do_install:class-target() { rm
${D}${libdir}/rustlib/uninstall.shrm ${D}${libdir}/rustlib/install.log rm ${D}${libdir}/rustlib/manifest* + if [ "${TCLIBC}" = "musl" ]; then
meta/recipes-devtools/rust/rust_1.80.1.bb rust_do_install:class-target() { · line 302
Quoted 4 lines
meta/recipes-devtools/rust/rust_1.80.1.bb +4
-0+ rm -f ${D}${libdir}/rustlib/${TARGET_ARCH}-poky-linux-musl/lib/libstd-*.so + elif [ "${TCLIBC}" = "glibc" ]; then + rm -f ${D}${libdir}/rustlib/${TARGET_ARCH}-poky-linux-gnu/lib/libstd-*.so + fi
Hardcode "poky"/"pokysdk" here should not proper.
//Changqing
Quoted 12 lines
}addtask
do_update_snapshotafterdo_patch-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#209095):https://lists.openembedded.org/g/openembedded-core/message/209095 Mute This Topic:https://lists.openembedded.org/mt/110301947/3616873
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH 2/3] rust: Fix for duplicate libstd.so
In reply to [email protected]Quoted 21 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan <[email protected]>
The
do_packagetask fail with below error due to multiplelibstd.sofiles installed in lib dir.---------------------------------------------------------------------------------------------------------------------------
ERROR: rust-1.81.0-r0do_package: rust-rustdoc: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust-rustdoc/usr/bin/rustdoc)
ERROR: rust-1.81.0-r0do_package: rust-tools-rustfmt: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust-tools-rustfmt/usr/bin/rustfmt)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/rustc)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/clippy-driver)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/cargo-clippy)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/lib/ librustc_driver-fc36770e343ef852.so)
---------------------------------------------------------------------------------------------------------------------------
Quoted 1 line
To fix the redundant
libstd.sofiles are removed from theusr/lib/.
What installs the redundant files in the first place? Shouldn't it be adjusted to not do that?
Also, as noted elsewhere, you cannot hardcode 'poky', or special-case based on TCLIBC.
Alex
Re: [OE-core] [PATCH 2/3] rust: Fix for duplicate libstd.so
Quoted 26 lines · Alexander Kanavin
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.Quoted 20 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan<[email protected]>
The
do_packagetask fail with below error due to multiplelibstd.sofiles installed in lib dir.---------------------------------------------------------------------------------------------------------------------------
ERROR: rust-1.81.0-r0do_package: rust-rustdoc: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust-rustdoc/usr/bin/rustdoc)
ERROR: rust-1.81.0-r0do_package: rust-tools-rustfmt: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust-tools-rustfmt/usr/bin/rustfmt)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/rustc)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/clippy-driver)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/cargo-clippy)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/lib/ librustc_driver-fc36770e343ef852.so)
---------------------------------------------------------------------------------------------------------------------------
Quoted 3 lines
Quoted 1 line
To fix the redundant
libstd.sofiles are removed from theusr/lib/.What installs the redundant files in the first place? Shouldn't it be adjusted to not do that?
During the Rust build process, multiple copies of libstd-*.so are generated, as Rust copies the required files from the stage2 build artifacts to the target image directory. When these build binaries are copied to the image, Yocto's do_package step encounters an error. To resolve this, the redundant libstd-*.so files are removed during the do_install step.
Quoted 2 lines
Also, as noted elsewhere, you cannot hardcode 'poky', or special-case based on TCLIBC.
Updated the patch
https://lists.openembedded.org/g/openembedded-core/topic/patch_v2_2_3_rust_fix_for/110513058
Quoted 1 line
Alex
Re: [OE-core] [PATCH 2/3] rust: Fix for duplicate libstd.so
Quoted 29 lines · Deepesh Varatharajan
Quoted 26 lines · Alexander Kanavin
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.Quoted 20 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan<[email protected]>
The
do_packagetask fail with below error due to multiplelibstd.sofiles installed in lib dir.---------------------------------------------------------------------------------------------------------------------------
ERROR: rust-1.81.0-r0do_package: rust-rustdoc: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust-rustdoc/usr/bin/rustdoc)
ERROR: rust-1.81.0-r0do_package: rust-tools-rustfmt: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust-tools-rustfmt/usr/bin/rustfmt)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/rustc)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/clippy-driver)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/bin/cargo-clippy)
ERROR: rust-1.81.0-r0do_package: rust: Multiple shlib providers for libstd-20c3de2d9292cd03.so: rust, rust (used by files: poky/build/tmp/work/core2-64-poky-linux/rust/1.81.0/packages-split/rust/usr/lib/ librustc_driver-fc36770e343ef852.so)
---------------------------------------------------------------------------------------------------------------------------
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
To fix the redundant
libstd.sofiles are removed from theusr/lib/.What installs the redundant files in the first place? Shouldn't it be adjusted to not do that?
During the Rust build process, multiple copies of libstd-*.so are generated, as Rust copies the required files from the stage2 build artifacts to the target image directory. When these build binaries are copied to the image, Yocto's
do_packagestep encounters an error. To resolve this, the redundant libstd-*.so files are removed during thedo_installstep.
Sorry about the above format
During the Rust build process,multiple copies of libstd-*.so are generated, as Rust copies the required files from the stage2 build artifacts to the target image directory. When these build binaries are copied to image, Yocto's do_package step encounters an error. To resolve this the redundant libstd-*.so file is removed during the do_install step.
Quoted 5 lines
Quoted 2 lines
Also, as noted elsewhere, you cannot hardcode 'poky', or special-case based on TCLIBC.
Updated the patch
https://lists.openembedded.org/g/openembedded-core/topic/patch_v2_2_3_rust_fix_for/110513058Quoted 1 line
Alex
PATCH 3/3 rust: Upgrade 1.80.1->1.81.0
In reply to [email protected]From: Deepesh Varatharajan <[email protected]>
https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html
Dropped:
0001-cargo-do-not-write-host-information-into-compilation.patch hardcodepaths.patch
---
meta/conf/distro/include/tcmode-default.inc | 2 +-
.../rust/{cargo_1.80.1.bb => cargo_1.81.0.bb} | 0
...te-host-information-into-compilation.patch | 51 ------------
.../rust/files/hardcodepaths.patch | 46 -----------
...epro-issue-fix-with-cc-crate-hashmap.patch | 53 ++++++++++++-
...ibstd-rs_1.80.1.bb => libstd-rs_1.81.0.bb} | 0
....80.1.bb => rust-cross-canadian_1.81.0.bb} | 0
...ust-llvm_1.80.1.bb => rust-llvm_1.81.0.bb} | 0
meta/recipes-devtools/rust/rust-snapshot.inc | 78 +++++++++----------
meta/recipes-devtools/rust/rust-source.inc | 4 +-
.../rust/{rust_1.80.1.bb => rust_1.81.0.bb} | 0
11 files changed, 93 insertions(+), 141 deletions(-)
rename meta/recipes-devtools/rust/{cargo_1.80.1.bb => cargo_1.81.0.bb} (100%)
delete mode 100644 meta/recipes-devtools/rust/files/0001-cargo-do-not-write-host-information-into-compilation.patch
delete mode 100644 meta/recipes-devtools/rust/files/hardcodepaths.patch
rename meta/recipes-devtools/rust/{libstd-rs_1.80.1.bb => libstd-rs_1.81.0.bb} (100%)
rename meta/recipes-devtools/rust/{rust-cross-canadian_1.80.1.bb => rust-cross-canadian_1.81.0.bb} (100%)
rename meta/recipes-devtools/rust/{rust-llvm_1.80.1.bb => rust-llvm_1.81.0.bb} (100%)
rename meta/recipes-devtools/rust/{rust_1.80.1.bb => rust_1.81.0.bb} (100%)meta/conf/distro/include/tcmode-default.inc +1 -1
@@ -24,7 +24,7 @@ GLIBCVERSION ?= "2.40%" LINUXLIBCVERSION ?= "6.12%" QEMUVERSION ?= "9.2%" GOVERSION ?= "1.22%" -RUSTVERSION ?= "1.80%" +RUSTVERSION ?= "1.81%" PREFERRED_VERSION_gcc ?= "${GCCVERSION}" PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
meta/recipes-devtools/rust/cargo_1.81.0.bb renamed from meta/recipes-devtools/rust/cargo_1.80.1.bb +0 -0
meta/recipes-devtools/rust/files/0001-cargo-do-not-write-host-information-into-compilation.patch deleted +0 -51
51 lines not on this page · raw message
meta/recipes-devtools/rust/files/hardcodepaths.patch deleted +0 -46
46 lines not on this page · raw message
meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch +52 -1
62 lines not on this page · raw message
meta/recipes-devtools/rust/libstd-rs_1.81.0.bb renamed from meta/recipes-devtools/rust/libstd-rs_1.80.1.bb +0 -0
meta/recipes-devtools/rust/rust-cross-canadian_1.81.0.bb renamed from meta/recipes-devtools/rust/rust-cross-canadian_1.80.1.bb +0 -0
meta/recipes-devtools/rust/rust-llvm_1.81.0.bb renamed from meta/recipes-devtools/rust/rust-llvm_1.80.1.bb +0 -0
meta/recipes-devtools/rust/rust-snapshot.inc +39 -39
95 lines not on this page · raw message
meta/recipes-devtools/rust/rust-source.inc +1 -3
@@ -1,17 +1,15 @@ RUST_VERSION ?= "${@d.getVar('PV').split('-')[0]}" SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;name=rust \ - file://hardcodepaths.patch;patchdir=${RUSTSRC} \ file://zlib-off64_t.patch;patchdir=${RUSTSRC} \ file://rv32-rustix-libc-backend.patch;patchdir=${RUSTSRC} \ file://rv32-cargo-rustix-0.38.28-fix.patch;patchdir=${RUSTSRC} \ - file://0001-cargo-do-not-write-host-information-into-compilation.patch;patchdir=${RUSTSRC} \ file://rustdoc-repro-issue-fix-cargo-config-for-codegenunits.patch;patchdir=${RUSTSRC} \ file://rust-oe-selftest.patch;patchdir=${RUSTSRC} \ file://repro-issue-fix-with-cc-crate-hashmap.patch;patchdir=${RUSTSRC} \ file://oeqa-selftest-Increase-timeout-in-process-sigpipe-ru.patch;patchdir=${RUSTSRC} \ " -SRC_URI[rust.sha256sum] = "6ab79b70dc57737a1de378f212fcf8852d67fe6cf272d122a15b3ea13be77947" +SRC_URI[rust.sha256sum] = "36217ef7e32f40a180e3d79bd666b4dfdaed49dd381023a5fb765fd12d0092ce" RUSTSRC = "${WORKDIR}/rustc-${RUST_VERSION}-src"
meta/recipes-devtools/rust/rust_1.81.0.bb renamed from meta/recipes-devtools/rust/rust_1.80.1.bb +0 -0
Signature · 1 line
2.43.0
Re: [PATCH 3/3] rust: Upgrade 1.80.1->1.81.0
Testing Summary for rust_1.81.0
Target pass skipped
x86_64 18646 418
x86 18468 596
ARM64 18496 568
ARM 18451 613
ppc 18418 646
Re: [OE-core] [PATCH 3/3] rust: Upgrade 1.80.1->1.81.0
In reply to [email protected]Quoted 5 lines · Deepesh via lists.openembedded.org
https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html
Dropped:
0001-cargo-do-not-write-host-information-into-compilation.patch hardcodepaths.patch
You need to explain why the patches have been dropped, as they're both marked 'Inappropriate'.
Have the issues been fixed upstream? How and where? Can you include the pointers to the fixes?
Quoted 33 lines
meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch +33
-0+diff --git a/vendor/cc-1.0.99/src/command_helpers.rs b/vendor/cc-1.0.99/src/command_helpers.rs +index fe919a5239..2b1f442019 100644 +--- a/vendor/cc-1.0.99/src/command_helpers.rs ++++ b/vendor/cc-1.0.99/src/command_helpers.rs +@@ -257,6 +257,7 @@ fn wait_on_child( + /// and store them in the output Object. + pub(crate) fn objects_from_files(files: &[Arc<Path>], dst: &Path) -> Result<Vec<Object>, Error> { + let mut objects = Vec::with_capacity(files.len()); ++ let target_substring = ["rustc"]; + for file in files { + let basename = file + .file_name() +@@ -277,10 +278,29 @@ pub(crate) fn objects_from_files(files: &[Arc<Path>], dst: &Path) -> Result<Vec< + })? + .to_string_lossy(); + ++ // Function to find the position of the first occurrence of the target substring ++ fn find_target_position(s: &str, targets: &[&str]) -> Option<usize> { ++ let mut pos = None; ++ for target in targets { ++ if let Some(index) = s.rfind(target) { ++ //If a target is found and pos is None, set it ++ if pos.is_none() || index < pos.unwrap() { ++ pos = Some(index); ++ } ++ } ++ } ++ pos ++ } ++ ++ let filtered_dirname = if let Some(pos) = find_target_position(&dirname, &target_substring) { ++ dirname[pos..].to_string() //Keep everything from the target substring onwards ++ } else {
meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch Signed-off-by: Harish Sadineni <[email protected]> · line 94
Quoted 10 lines
meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch +10
-0++ dirname.to_string() //If target substring is not found, keep the original dirname ++ }; + // Hash the dirname. This should prevent conflicts if we have multiple + // object files with the same filename in different subfolders. + let mut hasher = hash_map::DefaultHasher::new(); +- hasher.write(dirname.to_string().as_bytes()); ++ hasher.write(filtered_dirname.as_bytes()); + let obj = dst + .join(format!("{:016x}-{}", hasher.finish(), basename)) + .with_extension("o");
Similarly, why this patch has this new addition? Is there an upstream discussion related to it somewhere, or is it just multiple versions of the same crate all needing the same fix?
Alex
Re: [OE-core] [PATCH 3/3] rust: Upgrade 1.80.1->1.81.0
Quoted 8 lines · Alexander Kanavin
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.Quoted 2 lines · Deepesh via lists.openembedded.org
Quoted 8 lines
Quoted 3 lines
Dropped:
0001-cargo-do-not-write-host-information-into-compilation.patch hardcodepaths.patchYou need to explain why the patches have been dropped, as they're both marked 'Inappropriate'.
Have the issues been fixed upstream? How and where? Can you include the pointers to the fixes?
V2 has been sent with the required info
https://lists.openembedded.org/g/openembedded-core/topic/patch_v2_3_3_rust_upgrade/110513059
Quoted 49 lines
Quoted 34 lines
meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch +33
-0+diff --git a/vendor/cc-1.0.99/src/command_helpers.rs b/vendor/cc-1.0.99/src/command_helpers.rs +index fe919a5239..2b1f442019 100644 +--- a/vendor/cc-1.0.99/src/command_helpers.rs ++++ b/vendor/cc-1.0.99/src/command_helpers.rs +@@ -257,6 +257,7 @@ fn wait_on_child( + /// and store them in the output Object. + pub(crate) fn objects_from_files(files: &[Arc<Path>], dst: &Path) -> Result<Vec<Object>, Error> { + let mut objects = Vec::with_capacity(files.len()); ++ let target_substring = ["rustc"]; + for file in files { + let basename = file + .file_name() +@@ -277,10 +278,29 @@ pub(crate) fn objects_from_files(files: &[Arc<Path>], dst: &Path) -> Result<Vec< + })? + .to_string_lossy(); + ++ // Function to find the position of the first occurrence of the target substring ++ fn find_target_position(s: &str, targets: &[&str]) -> Option<usize> { ++ let mut pos = None; ++ for target in targets { ++ if let Some(index) = s.rfind(target) { ++ //If a target is found and pos is None, set it ++ if pos.is_none() || index < pos.unwrap() { ++ pos = Some(index); ++ } ++ } ++ } ++ pos ++ } ++ ++ let filtered_dirname = if let Some(pos) = find_target_position(&dirname, &target_substring) { ++ dirname[pos..].to_string() //Keep everything from the target substring onwards ++ } else {meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch Signed-off-by: Harish Sadineni <[email protected]> · line 94
Quoted 10 lines
meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch +10
-0++ dirname.to_string() //If target substring is not found, keep the original dirname ++ }; + // Hash the dirname. This should prevent conflicts if we have multiple + // object files with the same filename in different subfolders. + let mut hasher = hash_map::DefaultHasher::new(); +- hasher.write(dirname.to_string().as_bytes()); ++ hasher.write(filtered_dirname.as_bytes()); + let obj = dst + .join(format!("{:016x}-{}", hasher.finish(), basename)) + .with_extension("o");Similarly, why this patch has this new addition? Is there an upstream discussion related to it somewhere, or is it just multiple versions of the same crate all needing the same fix?
Alex
Quoted 16 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan <[email protected]>
The data layout for x86 and ppc targets were different in rust from llvm.
-----------------------------------------------------------------------------------------
error: data-layout for targetx86-linux,e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128,
differs from LLVM target'si686-unknown-linux-gnudefault layout,
e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128error: data-layout for target
powerpc-linux,E-m:e-p:32:32-i64:64-n32, differs from LLVM target'spowerpc-unknown-linux-gnudefault layout,E-m:e-p:32:32-Fn32-i64:64-n32
Quoted 8 lines
-----------------------------------------------------------------------------------------
Rust commits for updating the data layouts:
x86:
https://github.com/rust-lang/rust/commit/dbff90c2a7c751cf9d6843cd585429beb100c17d
ppc:
https://github.com/rust-lang/rust/commit/ad7ea8b7e690e6000006b6fde630a2c8c4385019
LGTM
Quoted 44 lines
Signed-off-by Deepesh Varatharajan <[email protected]>--- meta/classes-recipe/rust-target-config.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)meta/classes-recipe/rust-target-config.bbclass +1
-1@@ -167,7 +167,7 @@ TARGET_C_INT_WIDTH[x86_64-x32] = "32" MAX_ATOMIC_WIDTH[x86_64-x32] = "64" ## i686-unknown-linux-{gnu, musl} -DATA_LAYOUT[i686] = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" +DATA_LAYOUT[i686] ="e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128"
TARGET_ENDIAN[i686] = "little"
TARGET_POINTER_WIDTH[i686] = "32"
TARGET_C_INT_WIDTH[i686] = "32"meta/classes-recipe/rust-target-config.bbclass +1
-2@@ -216,7 +216,7 @@ TARGET_C_INT_WIDTH[mips64el] = "32" MAX_ATOMIC_WIDTH[mips64el] = "64" ## powerpc-unknown-linux-{gnu, musl} -DATA_LAYOUT[powerpc] = "E-m:e-p:32:32-i64:64-n32" +DATA_LAYOUT[powerpc] = "E-m:e-p:32:32-Fn32-i64:64-n32" TARGET_ENDIAN[powerpc] = "big" TARGET_POINTER_WIDTH[powerpc] = "32" TARGET_C_INT_WIDTH[powerpc] = "32" --2.43.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#209094):
https://lists.openembedded.org/g/openembedded-core/message/209094
Mute This Topic: https://lists.openembedded.org/mt/110301946/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-