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.

Signed-off-by: pgowda <[email protected]>
---
 meta/recipes-devtools/rust/libstd-rs.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/rust/libstd-rs.inc 
b/meta/recipes-devtools/rust/libstd-rs.inc
index 987956344a..96eaa2bdc0 100644
--- a/meta/recipes-devtools/rust/libstd-rs.inc
+++ b/meta/recipes-devtools/rust/libstd-rs.inc
@@ -19,9 +19,12 @@ RUSTFLAGS += "-L ${STAGING_LIBDIR} -C 
link-arg=-Wl,-soname,libstd.so"
 
 S = "${RUSTSRC}/src/libstd"
 
+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.31.1

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

Reply via email to