Bug 2019160 - Fails to link on aarch64
Summary: Fails to link on aarch64
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: firefox
Version: 33
Hardware: aarch64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gecko Maintainer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ARMTracker
TreeView+ depends on / blocked
 
Reported: 2021-11-01 17:50 UTC by Martin Stransky
Modified: 2021-11-30 16:13 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-30 16:13:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martin Stransky 2021-11-01 17:50:30 UTC
Description of problem:
Build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=78157342

325:30.77 /builddir/build/BUILD/firefox-94.0/objdir/_virtualenvs/build/bin/python -m mozbuild.action.check_binary --target ../../../dist/bin/js
325:31.11 gmake[4]: Leaving directory '/builddir/build/BUILD/firefox-94.0/objdir/js/src/shell'
334:04.06 /usr/bin/ld: /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.06 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.06 /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
334:04.06 /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
334:04.07 /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.08 /builddir/build/BUILD/firefox-94.0/objdir/aarch64-unknown-linux-gnu/release/libgkrust.a(gkrust-c3270c86cd04426b.gkrust_shared-5eee622b89b241db.hdlaqs91nx87yx7.rcgu.o.rcgu.o): in function `qcms_transform_data_rgb_out_lut_neon':
334:04.08 hdlaqs91nx87yx7:(.text.qcms_transform_data_rgb_out_lut_neon+0x124): undefined reference to `llvm.fptosi.sat.v4i32.v4f32'
334:04.09 /usr/bin/ld: /builddir/build/BUILD/firefox-94.0/objdir/aarch64-unknown-linux-gnu/release/libgkrust.a(gkrust-c3270c86cd04426b.gkrust_shared-5eee622b89b241db.hdlaqs91nx87yx7.rcgu.o.rcgu.o): in function `qcms_transform_data_rgba_out_lut_neon':
334:04.09 hdlaqs91nx87yx7:(.text.qcms_transform_data_rgba_out_lut_neon+0x11c): undefined reference to `llvm.fptosi.sat.v4i32.v4f32'
334:04.09 /usr/bin/ld: hdlaqs91nx87yx7:(.text.qcms_transform_data_rgba_out_lut_neon+0x1c4): undefined reference to `llvm.fptosi.sat.v4i32.v4f32'
334:04.10 /usr/bin/ld: /builddir/build/BUILD/firefox-94.0/objdir/aarch64-unknown-linux-gnu/release/libgkrust.a(gkrust-c3270c86cd04426b.gkrust_shared-5eee622b89b241db.hdlaqs91nx87yx7.rcgu.o.rcgu.o): in function `qcms_transform_data_bgra_out_lut_neon':
334:04.10 hdlaqs91nx87yx7:(.text.qcms_transform_data_bgra_out_lut_neon+0x120): undefined reference to `llvm.fptosi.sat.v4i32.v4f32'
334:04.10 /usr/bin/ld: hdlaqs91nx87yx7:(.text.qcms_transform_data_bgra_out_lut_neon+0x1d0): undefined reference to `llvm.fptosi.sat.v4i32.v4f32'
334:13.81 collect2: error: ld returned 1 exit status

Comment 1 Martin Stransky 2021-11-01 17:58:40 UTC
I tried to disable debuginfo for it.

Comment 2 Dominik 'Rathann' Mierzejewski 2021-11-02 10:51:24 UTC
Would it be possible to post the exact ld invocation that's failing?

Comment 3 Dan Horák 2021-11-02 11:13:21 UTC
Seems it fails in the final phase where libxul.so is being produced. I guess it needs LLVM/Rust people.

For the record, I don't see any issues building FF trunk on slightly outdated F-34 in our CI.

...
325:06.40 gmake[4]: Entering directory '/builddir/build/BUILD/firefox-94.0/objdir/toolkit/library/build'
325:06.40 toolkit/library/build/libxul.so
325:06.40 rm -f libxul.so
325:06.41 /usr/bin/g++ -std=gnu++17 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wc++2a-compat -Wduplicated-cond -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wno-error=unused-but-set-variable -Wformat -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fpermissive -fPIC -Wl,-z,relro -Wl,-z,now -DNSS_PKCS11_3_0_STRICT -fno-exceptions -fno-strict-aliasing -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -g -O2 -fomit-frame-pointer -funwind-tables  -shared -Wl,-z,defs -Wl,--gc-sections -Wl,-h,libxul.so -o libxul.so /builddir/build/BUILD/firefox-94.0/objdir/toolkit/library/build/libxul_so.list   -lpthread -Wl,--no-keep-memory -Wl,--reduce-memory-overheads -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -Wl,--build-id=sha1 -fstack-protector-strong -Wl,-rpath-link,/builddir/build/BUILD/firefox-94.0/objdir/dist/bin -Wl,-rpath-link,/usr/lib  ../../../js/src/build/libjs_static.a /builddir/build/BUILD/firefox-94.0/objdir/aarch64-unknown-linux-gnu/release/libgkrust.a ../../../security/sandbox/linux/libmozsandbox.so ../../../config/external/lgpllibs/liblgpllibs.so ../../../config/external/sqlite/libmozsqlite3.so ../../../widget/gtk/mozgtk/libmozgtk.so ../../../widget/gtk/mozwayland/libmozwayland.so -Wl,--version-script,symverscript  -ldl  -lrt -lm -lX11 -lX11-xcb -lxcb -lXcomposite -lXcursor -lXdamage -lXext -lXfixes -lXi -lXrender -lpthread -ldl -lc -lffi -lplds4 -lplc4 -lnspr4 -lz -lssl3 -lsmime3 -lnss3 -lnssutil3 -lfreetype -lfontconfig -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -ldbus-glib-1 -ldbus-1 -lxcb-shm -lXrandr
325:30.77 /builddir/build/BUILD/firefox-94.0/objdir/_virtualenvs/build/bin/python -m mozbuild.action.check_binary --target ../../../dist/bin/js
325:31.11 gmake[4]: Leaving directory '/builddir/build/BUILD/firefox-94.0/objdir/js/src/shell'
334:04.06 /usr/bin/ld: /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.06 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.06 /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
334:04.06 /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
334:04.07 /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: invalid abstract instance DIE ref
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.07 /usr/bin/ld: DWARF error: mangled line number section (bad file number)
334:04.08 /builddir/build/BUILD/firefox-94.0/objdir/aarch64-unknown-linux-gnu/release/libgkrust.a(gkrust-c3270c86cd04426b.gkrust_shared-5eee622b89b241db.hdlaqs91nx87yx7.rcgu.o.rcgu.o): in function `qcms_transform_data_rgb_out_lut_neon':
334:04.08 hdlaqs91nx87yx7:(.text.qcms_transform_data_rgb_out_lut_neon+0x124): undefined reference to `llvm.fptosi.sat.v4i32.v4f32'
334:04.09 /usr/bin/ld: /builddir/build/BUILD/firefox-94.0/objdir/aarch64-unknown-linux-gnu/release/libgkrust.a(gkrust-c3270c86cd04426b.gkrust_shared-5eee622b89b241db.hdlaqs91nx87yx7.rcgu.o.rcgu.o): in function `qcms_transform_data_rgba_out_lut_neon':
334:04.09 hdlaqs91nx87yx7:(.text.qcms_transform_data_rgba_out_lut_neon+0x11c): undefined reference to `llvm.fptosi.sat.v4i32.v4f32'
334:04.09 /usr/bin/ld: hdlaqs91nx87yx7:(.text.qcms_transform_data_rgba_out_lut_neon+0x1c4): undefined reference to `llvm.fptosi.sat.v4i32.v4f32'
334:04.10 /usr/bin/ld: /builddir/build/BUILD/firefox-94.0/objdir/aarch64-unknown-linux-gnu/release/libgkrust.a(gkrust-c3270c86cd04426b.gkrust_shared-5eee622b89b241db.hdlaqs91nx87yx7.rcgu.o.rcgu.o): in function `qcms_transform_data_bgra_out_lut_neon':
334:04.10 hdlaqs91nx87yx7:(.text.qcms_transform_data_bgra_out_lut_neon+0x120): undefined reference to `llvm.fptosi.sat.v4i32.v4f32'
334:04.10 /usr/bin/ld: hdlaqs91nx87yx7:(.text.qcms_transform_data_bgra_out_lut_neon+0x1d0): undefined reference to `llvm.fptosi.sat.v4i32.v4f32'
334:13.81 collect2: error: ld returned 1 exit status
334:13.81 gmake[4]: *** [/builddir/build/BUILD/firefox-94.0/config/rules.mk:545: libxul.so] Error 1
334:13.81 gmake[4]: Leaving directory '/builddir/build/BUILD/firefox-94.0/objdir/toolkit/library/build'
334:13.81 gmake[3]: *** [/builddir/build/BUILD/firefox-94.0/config/recurse.mk:72: toolkit/library/build/target] Error 2
334:13.81 gmake[3]: Leaving directory '/builddir/build/BUILD/firefox-94.0/objdir'
334:13.82 gmake[2]: *** [/builddir/build/BUILD/firefox-94.0/config/recurse.mk:34: compile] Error 2
334:13.82 gmake[2]: Leaving directory '/builddir/build/BUILD/firefox-94.0/objdir'
334:13.82 gmake[1]: *** [/builddir/build/BUILD/firefox-94.0/config/rules.mk:358: default] Error 2
334:13.82 gmake[1]: Leaving directory '/builddir/build/BUILD/firefox-94.0/objdir'
334:13.82 gmake: *** [client.mk:54: build] Error 2

Comment 4 Josh Stone 2021-11-02 21:45:39 UTC
> undefined reference to `llvm.fptosi.sat.v4i32.v4f32'

Fedora 33 has LLVM 11, but llvm.fptosi.sat.* was only added in LLVM 12. I don't think this is coming from rustc though, because the code that emits that is guarded for the version, and never does vectored versions either.

https://github.com/rust-lang/rust/blob/09c42c45858d5f3aedfa670698275303a3d19afa/compiler/rustc_codegen_llvm/src/builder.rs#L704-L714

Comment 5 Josh Stone 2021-11-02 22:05:21 UTC
I take it back -- it was hidden from me in a submodule. That is emitted by the aarch64 simd instrinsic `vcvtq_s32_f32` here:

https://github.com/rust-lang/stdarch/blob/89b0e355bc3cff5cddec2290c84f36eb3a026aad/crates/core_arch/src/arm_shared/neon/generated.rs#L2419-L2433

However, all of `core::arch::aarch64` is still marked unstable. This is cheated by gfx/qcms/build.rs's RUSTC_BOOTSTRAP=1 and the feature enablement in lib.rs, but this is explicitly not supported. It looks like the "neon" feature is optional for that crate, so perhaps there's a global firefox config you can change to avoid that.

Comment 6 Rémi Verschelde 2021-11-04 09:07:19 UTC
I can confirm the issue, we ran into it too on Mageia 8 when updating Rust and Firefox (relevant bug report: https://bugs.mageia.org/show_bug.cgi?id=29616#c8).

I'm documenting our findings here in case it's useful to others (I guess a fix is not so useful for F33 which is near EOL).

After identifying with Josh that it's indeed a LLVM version incompatibility, I tried to rebuild Mageia 8's aarch64 rust with the bundled LLVM 13.0. That ultimately failed because our build nodes ran out of memory, competing with a kernel build. Didn't seem worth the trouble to push further, so I went with the approach suggested by Josh in comment 5 to disable the `neon` feature:

http://svnweb.mageia.org/packages/updates/8/firefox/current/SOURCES/qcms-disable-neon-aarch64.patch?view=markup&pathrev=1753852

This seemed to work fine.

Technically this is either a Firefox or a Rust bug that it tries to use LLVM 12 intrinsics despite building against LLVM 11. But I doubt either project will really care so this issue can likely be closed as WONTFIX or just left to reach F33's EOL.

Comment 7 Ben Cotton 2021-11-04 13:37:19 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Ben Cotton 2021-11-04 14:06:56 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Ben Cotton 2021-11-04 15:03:54 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Josh Stone 2021-11-04 18:05:32 UTC
(In reply to Rémi Verschelde from comment #6)
> Technically this is either a Firefox or a Rust bug that it tries to use LLVM
> 12 intrinsics despite building against LLVM 11. But I doubt either project
> will really care so this issue can likely be closed as WONTFIX or just left
> to reach F33's EOL.

It's a WONTFIX from my Rust perspective, because these are unstable features. It's nice that it works for LLVM 12+, but it's still not supported.

Firefox could disable neon if they want to get a build out before EOL. Thanks for reporting back on that!

Comment 11 Ben Cotton 2021-11-30 16:13:13 UTC
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.