Message ID | 20230109140005.234301-1-yashinde145@gmail.com |
---|---|
State | New |
Headers | show |
Series | libstd-rs: Build in the release mode to avoid error Issue: LINCD-7172 | expand |
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 On Mon, 9 Jan 2023 at 15:00, Yash Shinde <yashinde145@gmail.com> 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: > 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: Yash Shinde <Yash.Shinde@windriver.com> > --- > .../rust/rust/LINCD-11387.patch | 43 +++++++++++++++++++ > 1 file changed, 43 insertions(+) > create mode 100644 meta/recipes-devtools/rust/rust/LINCD-11387.patch > > diff --git a/meta/recipes-devtools/rust/rust/LINCD-11387.patch b/meta/recipes-devtools/rust/rust/LINCD-11387.patch > new file mode 100644 > index 0000000000..3e84aa7232 > --- /dev/null > +++ b/meta/recipes-devtools/rust/rust/LINCD-11387.patch > @@ -0,0 +1,43 @@ > +From 45731fb0f735bc287e56b6fd6c93b56966195647 Mon Sep 17 00:00:00 2001 > +From: naveen gowda <pgowda.cve@gmail.com> > +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 <naveen.gowda@windriver.com> > +Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> > +--- > +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: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- >
diff --git a/meta/recipes-devtools/rust/rust/LINCD-11387.patch b/meta/recipes-devtools/rust/rust/LINCD-11387.patch new file mode 100644 index 0000000000..3e84aa7232 --- /dev/null +++ b/meta/recipes-devtools/rust/rust/LINCD-11387.patch @@ -0,0 +1,43 @@ +From 45731fb0f735bc287e56b6fd6c93b56966195647 Mon Sep 17 00:00:00 2001 +From: naveen gowda <pgowda.cve@gmail.com> +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 <naveen.gowda@windriver.com> +Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> +--- +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}"
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: Yash Shinde <Yash.Shinde@windriver.com> --- .../rust/rust/LINCD-11387.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 meta/recipes-devtools/rust/rust/LINCD-11387.patch