Closed Bug 1538236 Opened 5 years ago Closed 5 years ago

>=firefox-66.0 fails to compile with lto enabled on armhf with error: undefined reference to '_PrepareAndDispatch'

Categories

(Core :: XPCOM, defect, P3)

66 Branch
ARM64
All
defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox-esr60 --- wontfix
firefox66 --- wontfix
firefox67 --- fixed
firefox68 --- fixed

People

(Reporter: herrtimson, Assigned: froydnj)

Details

Attachments

(3 files, 2 obsolete files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce:

I tried to emerge firefox for armhf with lto enabled.

Actual results:

The initial compile without lto passed, but the lto phase fails with this beauty:

27:12.99 /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/www-client/firefox-66.0-r1/temp/ccuBxeIi.ltrans0.ltrans.o(.text+0xc): error: undefined reference to '_PrepareAndDispatch'

compressed build.log is attached.

Expected results:

The expectation is that the compile passes.

Component: Untriaged → General
Product: Firefox → Firefox Build System

:tt_1 Can you provide the exact steps you used to build? Your log just provides the output of the build process.

Flags: needinfo?(shes050117)

redirect the ni to the right person :)

Flags: needinfo?(shes050117) → needinfo?(herrtimson)

I'm willing to provide more details, it's just that I'm not sure what you mean by exact steps used to build? I set up a cross-compiler, compiled all dependencies + rust-std for target. All configure and make steps are in the log.

Without lto it's passing.

Flags: needinfo?(herrtimson)

Pretty sure this is an xpcom bug.

Assignee: nobody → nfroyd
Component: General → XPCOM
Priority: -- → P3
Product: Firefox Build System → Core

Otherwise, LTO will eliminate it because the compiler can't see the
calls to PrepareAndDispatch from the relevant assembly file.

Would you please see if the posted patch fixes your problem? I don't have an armhf system to test on. Thanks!

Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(herrtimson)
OS: Unspecified → All
Hardware: Unspecified → ARM64

hey there, this bug is against armv7a-unknown-linux-gnueabihf, it's essentially armv7 + hardfloat. It is not ARM64. Nontheless I tested your patch, but to no avail.

It might be a reincarnation of #336183

Flags: needinfo?(herrtimson)
Attached patch fix for arm (obsolete) — Splinter Review

(In reply to tt_1 from comment #7)

hey there, this bug is against armv7a-unknown-linux-gnueabihf, it's essentially armv7 + hardfloat. It is not ARM64. Nontheless I tested your patch, but to no avail.

It might be a reincarnation of #336183

Doh, sorry about that! I've had aarch64 on the brain for a while now.

I believe this new patch should work better, though I haven't tested it. Would you try it out?

Flags: needinfo?(herrtimson)

That patch fixes the compile, thank you!

Flags: needinfo?(herrtimson)
Attachment #9055966 - Attachment is obsolete: true

ARM's xptcstubs use a slightly different setup for PrepareAndDispatch
than...well, all of our other stubs. This difference appears to be
causing problems with LTO builds. Change the setup to be more like our
other stubs, which additionally gets rid of some of the asm nonsense.

Attached image firefox-66.0.2-lto.png

runtime tested with --enable-lto=thin, works fine.

An uplift to beta 67 would be highly appreciated.

Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/576f9e652a20
fix LTO issues with arm xptcstubs; r=mccr8
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Attachment #9055982 - Attachment is obsolete: true

Comment on attachment 9055989 [details]
Bug 1538236 - fix LTO issues with arm xptcstubs; r=mccr8

Beta/Release Uplift Approval Request

  • Feature/Bug causing the regression: None
  • User impact if declined: Third parties doing arm-specific builds with LTO will run into issues.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This change is in core code, but it's such core code that if it was broken, the entire browser would fall over in every test we run or builds would fail completely.
  • String changes made/needed: None.
Attachment #9055989 - Flags: approval-mozilla-beta?

Comment on attachment 9055989 [details]
Bug 1538236 - fix LTO issues with arm xptcstubs; r=mccr8

Low risk, covered by tests and verified on nightly, approved for 67 beta 10, thanks.

Attachment #9055989 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

excellent, thank you very much!

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

Attachment

General

Creator:
Created:
Updated:
Size: