CMake: when building shared libraries, use -fPIC for compiling
partially linked objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59699 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index fd6f73b..5158bfe 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -52,6 +52,9 @@
 check_symbol_exists(pthread_mutex_lock pthread.h HAVE_PTHREAD_MUTEX_LOCK)
 check_symbol_exists(strtoll stdlib.h HAVE_STRTOLL)
 
+include(CheckCXXCompilerFlag)
+check_cxx_compiler_flag("-fPIC" SUPPORTS_FPIC_FLAG)
+
 include(GetTargetTriple)
 get_target_triple(LLVM_HOSTTRIPLE)
 message(STATUS "LLVM_HOSTTRIPLE: ${LLVM_HOSTTRIPLE}")