Closed Bug 1480005 Opened 6 years ago Closed 3 years ago

Automatically use llvm-ar, llvm-ranlib and llvm-nm when building with llvm-based LTO


(Firefox Build System :: General, enhancement)

Not set


(firefox86 fixed)

86 Branch
Tracking Status
firefox86 --- fixed


(Reporter: glandium, Assigned: glandium)




(4 files)

      No description provided.
Blocks: android-lto
It'd be nice to have longer term, but I'll just hack up mozconfigs for my needs for now.

Fixing this properly will require moving the detection to moz.configure, and detect and handle llvm toolchains generically (e.g. looking for llvm-$tool-$version where $version matches that of clang-$version, if the compiler is not the short "clang").
Assignee: mh+mozilla → nobody
No longer blocks: android-lto

What exactly must be added to the mozconfig to work around this?

Flags: needinfo?(mh+mozilla)


You may need the full paths, and you may need to export the variables.

Flags: needinfo?(mh+mozilla)

The linker is always lld-link, as we don't support MSVC anymore, so the
fallback to "lib" is never used.

Assignee: nobody → mh+mozilla

And stop setting AR to llvm-ar in mozconfigs.

It hasn't been used since bug 569597 and bug 1295937.

There is only one place where it's used:
config/, which is only executed from
js/src/build/ on the condition that the build is targeting
Linux and not LTO. But the LTO test is actually outdated, because we
don't build with -flto, but -flto=thin, so the exclusion doesn't
work anymore.

There is however no AC_CHECK_PROG, and we currently rely on NM to be
given, or fall back to "nm", which works in most cases, except LTO with
clang. It works on CI because in LTO builds we explicitly set NM to
llvm-nm (which can output symbols from LLVM bitcode objects), but we
could also do that automatically.

So we add a full detection of nm/llvm-nm to python configure, and limit
it to Linux, since we only ever use it there.

Blocks: 1686646
Pushed by
Always use llvm-lib when targetting Windows. r=firefox-build-system-reviewers,dmajor
Look for llvm-ar for AR when compiling with clang. r=firefox-build-system-reviewers,nalexander
Remove check for RANLIB. r=firefox-build-system-reviewers,nalexander
Move NM to python configure. r=firefox-build-system-reviewers,nalexander
You need to log in before you can comment on or make changes to this bug.