This check should ensure we don't reproduce the problem fixed by
02df443d2801601a4e42e360e436d97314e9da30
More accurately, it checks every llvm::Any::TypeId symbol in libLLVM-x.so and
make sure they have weak linkage and are not local to the library, which would
lead to duplicate definition if another weak version of the symbol is defined in
another linked library.
It's a follow-up to https://reviews.llvm.org/D108943
I wonder whether config.build_shared_libs should be checked also to ensure that shared libraries built?
I've got an error on the added test by this commit due to shared library is not exist.