lld::wasm::link() or lld::elf::link() call InitializeAllTargets() which is not thread-safe if another thread is attempting to use the llvm libraries.
This is an issue for Solang:
https://github.com/hyperledger-labs/solang/blob/master/src/linker/linker.cpp
It uses ldd by calling lld::wasm::link() but another thread might be trying to build an llvm module, which fails if InitializeAllTargets() gets called.
Ideally I'd like to make lld entirely thread-safe and more amiable for using as a a library, that is a much larger change.