In some cases there can already by a visible copy of LLVM present in the address space, e.g., when a driver requires LLVM but doesn't hide its symbols. Depending on the platform, this may cause issues (reinitialization errors, silent use of the wrong library, etc). An abort due to doubly-registered passes when initializing the LLVM library is a common symptom for this.
It is possible to avoid this by renaming the symbols exported by the LLVM API
wrapper (and the underlying LLVM library). You can do so by defining the
LOCAL_NAMESPACE
environment variable when configuring llvm_shared
with CMake
(note that this requires a statically-built LLVM, or rewriting will fail):
LOCAL_NAMESPACE=1 \
cmake ../