When using lld-link to build static libraries containing object files
with module assembly, the program would crash with "Assertion `T &&
T->hasMCAsmParser()' failed". This change causes the code in lld-link
that initialized Targets, TargetInfos, and AsmParsers (which already
existed) to be run before entering the lib building path (which needs
it). This avoids the error (and is what llvm-lib and llvm-ar do, too).
Fixes PR41803.
Please extend this to put some symbols in the module assembly and then run llvm-nm on the archive to show that the archiver actually parsed the module level assembly and didn't just ignore it. There's a test at llvm/test/Object/X86/archive-ir-asm.ll that does this that you can steal.