Skip to contentSkip to conversation

Build libstd-rs in release mode to compile mozjs

PATCH In review pgowda 3 participants 3 messages Dec 6, 2021 – Dec 8, 2021

lore
Share & tools
lore

pgowda

author
#0 lore raw

PATCH 1/1 Build libstd-rs in release mode to compile mozjs

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.

---
 meta/recipes-devtools/rust/libstd-rs.inc | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/rust/libstd-rs.inc +3 -0
index 987956344a..96eaa2bdc0 100644
@@ -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}"
Signature · 1 line
2.31.1
#1 lore raw
Quoted 11 lines · pgowda

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.

Thank you, but I think the problem needs to be properly understood before any fix to oe-core is merged. Can you keep the workaround as a bbappend until then?

Alex

#2 lore raw
Quoted 10 lines · Alexander Kanavin

On Mon, 6 Dec 2021 at 06:45, pgowda <[email protected] <mailto:[email protected]>> wrote:

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
<http://asymmetric.rs:57>:
   more undefined references to `core::panicking::panic' follow

Quoted 7 lines

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.

Thank you, but I think the problem needs to be properly understood before any fix to oe-core is merged. Can you keep the workaround as a bbappend until then?

That's fine. We (WR) have this as an open bug so Naveen will work on getting to the root cause.

CCing Khem in case he want's the work-around in meta-oe.

../Randy

Quoted 13 lines

Alex

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

Signature · 2 lines
# Randy MacLeod
# Wind River Linux