In https://bugs.llvm.org/show_bug.cgi?id=45636 firefox was linked
against stale object files that don't match profiled build.
Before the change ld.lld was crashing with a backtrace as:
LLVM ERROR: Function Import: link error:
linking module flags 'ProfileSummary':
IDs have conflicting values in 'Mutex_posix.o' and 'nsBrowserApp.o'
PLEASE submit a bug report to https://bugs.llvm.org/ and include the
crash backtrace.
#0 0x000055b58915b86a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm/lib/Support/Unix/Signals.inc:564:22
...
#11 0x000055b589111f89 llvm::report_fatal_error(llvm::Twine const&, bool)
llvm/lib/Support/ErrorHandling.cpp:113:27
#12 0x000055b5891120e1 llvm/lib/Support/ErrorHandling.cpp:87:21
#13 0x000055b58a22611f llvm::FunctionImporter::importFunctions(...)
llvm/lib/Transforms/IPO/FunctionImport.cpp:1250:25After the change ld.lld collects all errors during ThinLTO and reports
them as usual:
ld.lld: error: Function Import: link error:
linking module flags 'ProfileSummary':
IDs have conflicting values in 'Mutex_posix.o' and 'nsBrowserApp.o'
Move this to lto/ and add REQUIRES: x86