Skip to contentSkip to conversation

libstd-rs: Build in the release mode to avoid error Issue: LINCD-7172

PATCH Yash Shinde 2 participants 2 messages Jan 9, 2023

lore
Share & tools
lore
#0 lore raw

When mozjs in firefox is built with DEBUG_BUILD = "1"
in local.conf, it will fail with the following error:
rustc-1.56.0-src/vendor/compiler_builtins/src/int/specialized_div_rem
/asymmetric.rs:57:
more undefined references to `core::panicking::panic' follow

Switch to building libstd-rs in "release" mode as that works around the issue and builds mozjs successfully. This is a work-around that can be used until the root cause of the debug build error is resolved.

(LOCAL REV: NOT UPSTREAM) -- to be sent to oe-core

---
 .../rust/rust/LINCD-11387.patch               | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 meta/recipes-devtools/rust/rust/LINCD-11387.patch
meta/recipes-devtools/rust/rust/LINCD-11387.patch new file +43 -0
new file mode 100644
index 0000000000..3e84aa7232
@@ -0,0 +1,43 @@
+From 45731fb0f735bc287e56b6fd6c93b56966195647 Mon Sep 17 00:00:00 2001
+From: naveen gowda <[email protected]>
+Date: Mon, 29 Nov 2021 21:40:27 -0800
+Subject: libstd-rs: Build in the release mode to avoid error
+
+Issue: LINCD-7172
+
+When mozjs in firefox is built with DEBUG_BUILD = "1"
+in local.conf, it will fail with the following error:
+   rustc-1.56.0-src/vendor/compiler_builtins/src/int/specialized_div_rem
+/asymmetric.rs:57:
+   more undefined references to `core::panicking::panic' follow
+
+Switch to building libstd-rs in "release" mode as that works
+around the issue and builds mozjs successfully. This is a
+work-around that can be used until the root cause of the debug
+build error is resolved.
+
+(LOCAL REV: NOT UPSTREAM) -- to be sent to oe-core
+
+Signed-off-by: naveen gowda <[email protected]>
+Signed-off-by: Randy MacLeod <[email protected]>
+---
+meta/recipes-devtools/rust/libstd-rs_1.66.0.bb | 3 +++
+ 1 file changed, 3 insertions(+)
+
+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 8802e9790c..c5295187f8 100644
+--- a/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
++++ b/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
+@@ -24,9 +24,12 @@ RUSTFLAGS += "-Cembed-bitcode=yes"
+ # Needed so cargo can find libbacktrace
+ RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
+
++CARGO_BUILD_FLAGS:append = "${@' --release' if d.getVar('DEBUG_BUILD') == '1' else ''}"
++
+ CARGO_FEATURES ?= "panic-unwind backtrace"
+ CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'"
+ CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
++BUILD_DIR = "release"
+
+ do_compile:prepend () {
+     export CARGO_TARGET_DIR="${B}"
Signature · 1 line
2.25.1
#1 lore raw

Hello,

is this the same problem as one addressed in mozjs recipe by this patch?
http://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-extended/mozjs/mozjs-102/0001-Cargo.toml-do-not-abort-on-panic.patch

Also note that you send a patch that adds a patch, not the patch itself. But we need to get to the bottom of the actual issue first; work-arounds built on incomplete understanding cannot be accepted.

Alex

Quoted 81 lines · Yash Shinde

When mozjs in firefox is built with DEBUG_BUILD = "1"
in local.conf, it will fail with the following error:
rustc-1.56.0-src/vendor/compiler_builtins/src/int/specialized_div_rem
/asymmetric.rs:57:
more undefined references to `core::panicking::panic' follow

Switch to building libstd-rs in "release" mode as that works around the issue and builds mozjs successfully. This is a work-around that can be used until the root cause of the debug build error is resolved.

(LOCAL REV: NOT UPSTREAM) -- to be sent to oe-core

---
 .../rust/rust/LINCD-11387.patch               | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 meta/recipes-devtools/rust/rust/LINCD-11387.patch
meta/recipes-devtools/rust/rust/LINCD-11387.patch new file +43 -1
new file mode 100644
index 0000000000..3e84aa7232
@@ -0,0 +1,43 @@
+From 45731fb0f735bc287e56b6fd6c93b56966195647 Mon Sep 17 00:00:00 2001
+From: naveen gowda <[email protected]>
+Date: Mon, 29 Nov 2021 21:40:27 -0800
+Subject: libstd-rs: Build in the release mode to avoid error
+
+Issue: LINCD-7172
+
+When mozjs in firefox is built with DEBUG_BUILD = "1"
+in local.conf, it will fail with the following error:
+   rustc-1.56.0-src/vendor/compiler_builtins/src/int/specialized_div_rem
+/asymmetric.rs:57:
+   more undefined references to `core::panicking::panic' follow
+
+Switch to building libstd-rs in "release" mode as that works
+around the issue and builds mozjs successfully. This is a
+work-around that can be used until the root cause of the debug
+build error is resolved.
+
+(LOCAL REV: NOT UPSTREAM) -- to be sent to oe-core
+
+Signed-off-by: naveen gowda <[email protected]>
+Signed-off-by: Randy MacLeod <[email protected]>
+---
+meta/recipes-devtools/rust/libstd-rs_1.66.0.bb | 3 +++
+ 1 file changed, 3 insertions(+)
+
+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 8802e9790c..c5295187f8 100644
+--- a/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
++++ b/meta/recipes-devtools/rust/libstd-rs_1.66.0.bb
+@@ -24,9 +24,12 @@ RUSTFLAGS += "-Cembed-bitcode=yes"
+ # Needed so cargo can find libbacktrace
+ RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
+
++CARGO_BUILD_FLAGS:append = "${@' --release' if d.getVar('DEBUG_BUILD') == '1' else ''}"
++
+ CARGO_FEATURES ?= "panic-unwind backtrace"
+ CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'"
+ CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
++BUILD_DIR = "release"
+
+ do_compile:prepend () {
+     export CARGO_TARGET_DIR="${B}"
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#175685): https://lists.openembedded.org/g/openembedded-core/message/175685
Mute This Topic: https://lists.openembedded.org/mt/96152544/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-