From: Deepesh.Varatharajan@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: Shivaprasad.Moodalappa@windriver.com,
Sundeep.Kokkonda@windriver.com,
Deepesh.Varatharajan@windriver.com
Subject: [PATCH 2/5] rust: Fix build failure when multilibs are enabled
Date: Fri, 21 Mar 2025 06:24:53 -0700 [thread overview]
Message-ID: <20250321132502.2607941-2-Deepesh.Varatharajan@windriver.com> (raw)
In-Reply-To: <20250321132502.2607941-1-Deepesh.Varatharajan@windriver.com>
From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
When multilibs are enabled, rustc could not find dynamic libraries in the
lib64 directory due to the bootstrapping process searching in the lib
directory. This commit exports both lib and lib64 paths to ensure
correct library detection.
dropped:
revert-Zdual-proc-macros-additional-check.patch
We reverted the previous commit to prevent errors when rustc cannot find
dynamic libraries. Since the issue has been resolved by exporting the
lib paths, this revert is no longer necessary, as it won't cause any
errors moving forward.
Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
---
...t-Zdual-proc-macros-additional-check.patch | 43 -------------------
meta/recipes-devtools/rust/rust-source.inc | 1 -
meta/recipes-devtools/rust/rust_1.83.0.bb | 3 ++
3 files changed, 3 insertions(+), 44 deletions(-)
delete mode 100644 meta/recipes-devtools/rust/files/revert-Zdual-proc-macros-additional-check.patch
diff --git a/meta/recipes-devtools/rust/files/revert-Zdual-proc-macros-additional-check.patch b/meta/recipes-devtools/rust/files/revert-Zdual-proc-macros-additional-check.patch
deleted file mode 100644
index 58e77e4e6e..0000000000
--- a/meta/recipes-devtools/rust/files/revert-Zdual-proc-macros-additional-check.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-rust: Fix build failure for v1.83 when lib32 enabled
-
-Because of the following commit ,
-https://github.com/rust-lang/rust/commit/68034f837a39387e49fc7d7c5b088f5372a1127e
-when we enable lib32, getting build failure because there is a check for target
-support for "-Zdual-proc-macros" flag not functioning properly when lib32 is
-enabled in the build environment. So for now reverting this commit and bring
-back the previous behavior, where the "-Zdual-proc-macros" flag is always
-added for building proc macros, regardless of the target architecture's support.
-This would bypass the check introduced in the patch, allowing the build to
-proceed without error, even when building for a 64-bit architecture with lib32 enabled.
-
-Upstream-Status: Pending
-
-Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
-diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
-index 9ac0b0a01f..b1374042fb 100644
---- a/src/bootstrap/src/core/builder.rs
-+++ b/src/bootstrap/src/core/builder.rs
-@@ -1701,21 +1701,8 @@ impl<'a> Builder<'a> {
- // Build proc macros both for the host and the target unless proc-macros are not
- // supported by the target.
- if target != compiler.host && cmd_kind != Kind::Check {
-- let error = command(self.rustc(compiler))
-- .arg("--target")
-- .arg(target.rustc_target_arg())
-- .arg("--print=file-names")
-- .arg("--crate-type=proc-macro")
-- .arg("-")
-- .run_capture(self)
-- .stderr();
-- let not_supported = error
-- .lines()
-- .any(|line| line.contains("unsupported crate type `proc-macro`"));
-- if !not_supported {
-- cargo.arg("-Zdual-proc-macros");
-- rustflags.arg("-Zdual-proc-macros");
-- }
-+ cargo.arg("-Zdual-proc-macros");
-+ rustflags.arg("-Zdual-proc-macros");
- }
- }
- }
diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc
index 838544e089..59774e4794 100644
--- a/meta/recipes-devtools/rust/rust-source.inc
+++ b/meta/recipes-devtools/rust/rust-source.inc
@@ -7,7 +7,6 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
file://oeqa-selftest-Increase-timeout-in-process-sigpipe-ru.patch;patchdir=${RUSTSRC} \
file://0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch;patchdir=${RUSTSRC} \
file://revert-link-std-statically-in-rustc_driver-feature.patch;patchdir=${RUSTSRC} \
- file://revert-Zdual-proc-macros-additional-check.patch;patchdir=${RUSTSRC} \
"
SRC_URI[rust.sha256sum] = "7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11735760f97df"
diff --git a/meta/recipes-devtools/rust/rust_1.83.0.bb b/meta/recipes-devtools/rust/rust_1.83.0.bb
index aaf35692ab..ec1e7a683d 100644
--- a/meta/recipes-devtools/rust/rust_1.83.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.83.0.bb
@@ -223,6 +223,9 @@ rust_runx () {
oe_cargo_fix_env
+ # When multilibs are enabled, rustc can't find dynamic libraries in "lib64" because the bootstrapping process looks in "lib". To fix this, export both paths:
+ export LD_LIBRARY_PATH=${S}/build/${RUST_BUILD_SYS}/stage1/lib:${S}/build/${RUST_BUILD_SYS}/stage1/lib64:$LD_LIBRARY_PATH
+
python3 src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose
}
rust_runx[vardepsexclude] += "PARALLEL_MAKE"
--
2.43.0
next prev parent reply other threads:[~2025-03-21 13:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 13:24 [PATCH 1/5] rust: Fix bloat issue in recent rust updates Deepesh.Varatharajan
2025-03-21 13:24 ` Deepesh.Varatharajan [this message]
2025-03-24 9:23 ` [OE-core] [PATCH 2/5] rust: Fix build failure when multilibs are enabled Alexander Kanavin
2025-03-24 17:48 ` Randy MacLeod
2025-03-25 8:35 ` Deepesh Varatharajan
2025-03-27 6:26 ` Deepesh Varatharajan
2025-03-25 4:44 ` Deepesh Varatharajan
2025-03-21 13:24 ` [PATCH 3/5] rust: Fix build break because of "download-rustc" and "llvm-tools" Deepesh.Varatharajan
2025-03-21 13:24 ` [PATCH 4/5] rust: Upgrade 1.83.0->1.84.1 Deepesh.Varatharajan
2025-03-21 13:24 ` [PATCH 5/5] rust: Oe-selftest changes for rust v1.84.1 Deepesh.Varatharajan
2025-03-22 6:50 ` [OE-core] [PATCH 1/5] rust: Fix bloat issue in recent rust updates Khem Raj
2025-03-24 22:28 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250321132502.2607941-2-Deepesh.Varatharajan@windriver.com \
--to=deepesh.varatharajan@windriver.com \
--cc=Shivaprasad.Moodalappa@windriver.com \
--cc=Sundeep.Kokkonda@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).