Closed Bug 1568026 Opened 3 months ago Closed 3 months ago

Check that clang version is >= 8.0 when using xLTO

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: fabrice, Assigned: froydnj)

Details

Attachments

(2 files, 1 obsolete file)

Enabling xLTO (with export MOZ_LTO=cross in mozconfig) fails when using an older clang version (eg. 7.0) with this error message:

"ld.lld: error: Invalid summary version 6, 1, 2, 3 or 4 expected"

Updating to clang 8.0 with ./mach bootstrap fixes the issue.

cf. my comments in the xLTO bug, we need to test that the combination of rust and clang works, not check versions. That won't account for rust possibly using random broken llvm trunk versions that have some bug in the IR, but we can't do much about that.

This change will eventually enable us to cross-check rustc's version
with clang's version when doing cross-language LTO/PGO and avoid
people running into peculiar errors at link time.

To do properly checks on LLVM version correspondence between clang and
rustc, we need information about both of those compilers to be
available. The current placement of the LTO/PGO checks is after we know
something about clang, but before we know something about rustc.
Therefore we need to move those checks after we've gathered information
about rustc.

The PGO bits come along for this bug because the LTO bits depend on
them, and we're going to need the Rust information for cross-language
PGO checks in a different bug. So we might as well move everything all
at once.

Depends on D39388

Doing this check early in configure alerts people to potential problems
before they spend significant time running the build and then failing at
libxul link time.

This check is admittedly pretty weak: it's possible that the IR hasn't
changed that much between major versions, and a more robust check
might try a real cross-language LTO testcase to see if everything
works. But we can cross that bridge when we come to it.

Depends on D39390

Attachment #9080691 - Attachment is obsolete: true
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d5e10d2f4721
parse the LLVM version from rustc's version output; r=dmajor
https://hg.mozilla.org/integration/autoland/rev/4dd6f3fa5e5c
move LTO/PGO configure bits to a new file; r=dmajor
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Assignee: nobody → nfroyd
You need to log in before you can comment on or make changes to this bug.