A build on sparcv9-sun-solaris2.11 with -DLLVM_ENABLE_PIC=Off failed linking libRemarks.so:
[27/2297] Linking CXX shared library lib/libRemarks.so.12git FAILED: lib/libRemarks.so.12git [...] ld: fatal: relocation error: R_SPARC_H44: file lib/libLLVMRemarks.a(Remark.cpp.o): symbol _ZTVN4llvm18raw_string_ostreamE: invalid shared object relocation type: ABS44 code model unsupported [...]
On Solaris/sparcv9 as on many other targets you cannot link non-PIC objects into a shared object.
The following patch avoids this by not building the library with PIC. It allowed the build to complete and ninja check-all showed no errors.
Is this the only LLVM shared library that was missing this if(LLVM_ENABLE_PIC) check?
If not, this comment is misleading, since clearly it worked so far everywhere else.