compiler-builtins icon indicating copy to clipboard operation
compiler-builtins copied to clipboard

Undefined reference to core::panicking::panic

Open pgowda-cve opened this issue 3 years ago • 2 comments

Hi,

We are trying to build mozjs-91 in debug mode on Yocto framework.

However, the build fails with the following error on compiler_builtins.

/libexec/i686-linux/gcc/i686-linux/12.1.0/ld: mozjs-91/91.8.0-r0/build/i686-linux/release/libjsrust.a(compiler_builtins-3fc4b4898efc1e1d.compiler_builtins.b3f4713f-cgu.3.rcgu.o): in function compiler_builtins::int::specialized_div_rem::u64_div_rem': compiler_builtins.b3f4713f-cgu.3:(.text._ZN17compiler_builtins3int19specialized_div_rem11u64_div_rem17ha9ef929772c35813E+0x178): undefined reference to core::panicking::panic'

The issue is not seen when built without debug mode (DEBUG_BUILD = "1") Tried to debug the issue and observed that building libstd-rs in release mode fixed the issue.

The following issues were referred that are related to the same error https://github.com/rust-lang/compiler-builtins/issues/347 https://github.com/rust-lang/compiler-builtins/issues/79

Tweaked the files to modify for overflow-checks = false opt-level = 1 However, it did not fix the issue.

pgowda-cve avatar Jul 14 '22 13:07 pgowda-cve

Can you try with the latest nightly? According to https://github.com/rust-lang/rust/issues/96486#issuecomment-1180395751 it might have been fixed recently.

Amanieu avatar Jul 14 '22 16:07 Amanieu

Thanks very much for the pointer. Will check the issue with the latest sources as per your suggestion and try

pgowda-cve avatar Jul 18 '22 09:07 pgowda-cve