Closed Bug 1602355 Opened 4 years ago Closed 4 years ago

with thin lto enabled, -import-instr-limit is forced for gcc, resulting in: error: unrecognized command line option '-import-instr-limit=10'

Categories

(Firefox :: Untriaged, defect)

72 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 73
Tracking Status
firefox-esr68 --- unaffected
firefox71 --- unaffected
firefox72 --- fixed
firefox73 --- fixed

People

(Reporter: herrtimson, Assigned: away)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

47 bytes, text/x-phabricator-request
Details | Review

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

Steps to reproduce:

I wanted to compile firefox-72.0-beta3 on linux with thin lto enabled, using gcc.

Actual results:

The build fails in configure, as seems that the linker doesn't understand -import-instr-limit:

0:11.14 checking what kind of list files are supported by the linker... configure: error: Couldn't find one that works
0:11.15 DEBUG: <truncated - see config.log for full output>
0:11.15 DEBUG: configure:10778: /usr/bin/x86_64-pc-linux-gnu-g++ -o conftest -march=znver1 -pipe -flifetime-dse=1 -Wno-psabi -Wno-class-memaccess -Wno-int-in-bool-context -Wno-multistatement-macros -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -lpthread -Wl,-O1 -Wl,--as-needed -Wl,-rpath=/usr/lib64/firefox,--enable-new-dtags -Wl,--compress-debug-sections=zlib -fuse-ld=gold -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -Wl,--icf=safe conftest.C -ldl 1>&5
0:11.15 DEBUG: configure:10864: checking for -pipe support
0:11.15 DEBUG: configure:10891: checking what kind of list files are supported by the linker
0:11.15 DEBUG: configure:10896: /usr/bin/x86_64-pc-linux-gnu-gcc -std=gnu99 -o conftest.o -c -flto -flifetime-dse=1 -march=znver1 -pipe -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -pthread -fPIC -pipe conftest.c 1>&5
0:11.15 DEBUG: configure:10903: /usr/bin/x86_64-pc-linux-gnu-gcc -std=gnu99 -o conftest -flto=12 -flifetime-dse=1 -Wl,-plugin-opt=-import-instr-limit=10 -lpthread -Wl,-O1 -Wl,--as-needed -Wl,-rpath=/usr/lib64/firefox,--enable-new-dtags -Wl,--compress-debug-sections=zlib -fuse-ld=gold -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -Wl,--icf=safe conftest.list -ldl 1>&5
0:11.15 DEBUG: x86_64-pc-linux-gnu-gcc: error: unrecognized command line option '-import-instr-limit=10'
0:11.15 DEBUG: lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-gcc returned 1 exit status
0:11.15 DEBUG: compilation terminated.
0:11.15 DEBUG: /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.gold: fatal error: lto-wrapper failed
0:11.15 DEBUG: collect2: error: ld returned 1 exit status
0:11.15 DEBUG: configure:10907: /usr/bin/x86_64-pc-linux-gnu-gcc -std=gnu99 -o conftest -flto=12 -flifetime-dse=1 -Wl,-plugin-opt=-import-instr-limit=10 -lpthread -Wl,-O1 -Wl,--as-needed -Wl,-rpath=/usr/lib64/firefox,--enable-new-dtags -Wl,--compress-debug-sections=zlib -fuse-ld=gold -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -Wl,--icf=safe -Wl,-filelist,conftest.list -ldl 1>&5
0:11.15 DEBUG: /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.gold: fatal error: -f/--auxiliary may not be used without -shared
0:11.15 DEBUG: collect2: error: ld returned 1 exit status
0:11.15 DEBUG: configure:10909: /usr/bin/x86_64-pc-linux-gnu-gcc -std=gnu99 -o conftest -flto=12 -flifetime-dse=1 -Wl,-plugin-opt=-import-instr-limit=10 -lpthread -Wl,-O1 -Wl,--as-needed -Wl,-rpath=/usr/lib64/firefox,--enable-new-dtags -Wl,--compress-debug-sections=zlib -fuse-ld=gold -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -Wl,--icf=safe @conftest.list -ldl 1>&5
0:11.15 DEBUG: x86_64-pc-linux-gnu-gcc: error: unrecognized command line option '-import-instr-limit=10'
0:11.15 DEBUG: lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-gcc returned 1 exit status
0:11.15 DEBUG: compilation terminated.
0:11.15 DEBUG: /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld.gold: fatal error: lto-wrapper failed
0:11.15 DEBUG: collect2: error: ld returned 1 exit status
0:11.15 DEBUG: configure: error: Couldn't find one that works
0:11.15 ERROR: old-configure failed
0:11.19 *** Fix above errors and then restart with
0:11.19 "./mach build"
0:11.19 gmake: *** [client.mk:115: configure] Error 1

-import-instr-limit is llvm/clang specific, hence the gcc linker fails to understand that input.

Expected results:

-import-instr-limit should only be used for llvm/clang based compile

this was introduced by the patch from https://bugzilla.mozilla.org/show_bug.cgi?id=1592981

reverting this patch makes it all work, again.

so, this needs to be reworked, to be llvm/clang specific

GCC doesn't understand the import-instr-limit option.

Assignee: nobody → dmajor
Regressed by: 1592981
Has Regression Range: --- → yes
Keywords: regression
Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/360910f1a154
Fix GCC LTO build break r=froydnj

I tested the patch locally, configure was successfull with CC=gcc CXX=g++

it should be available with beta5

you take care of fixing this for mozilla central as well?

The patch should be automatically merged to mozilla-central in a few hours.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 73

Can this please be backported to firefox-72.0 beta branch? I thought it had been fixed there first, and later uplifted to the master branch, but turns out it's been done the other way around and the fix is now missing in the firefox-72.0 beta branch. Thanks.

Comment on attachment 9114554 [details]
Fix GCC LTO build break

Beta/Release Uplift Approval Request

  • User impact if declined: Build breaks in some non-Mozilla configurations
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • 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): Does not affect official builds
  • String changes made/needed: no
Attachment #9114554 - Flags: approval-mozilla-beta?

Comment on attachment 9114554 [details]
Fix GCC LTO build break

essentially npotb, approved for 72.0b8.

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

fixed in 72.0beta8, thank you! :-)

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

Attachment

General

Creator:
Created:
Updated:
Size: