The following issue has been SUBMITTED. ====================================================================== http://public.kitware.com/Bug/view.php?id=12601 ====================================================================== Reported By: doob Assigned To: ====================================================================== Project: CMake Issue ID: 12601 Category: CMake Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2011-11-30 06:58 EST Last Modified: 2011-11-30 06:58 EST ====================================================================== Summary: CLang with Opiton -working-directory leads CMake to ommit fPIC in CXX_FLAGS for shared libs Description: I tried using CLang as drop in replacement for GCC with CMake and it worked just fine. (CLang Version 3.0) I just set CLang/CLang++ as the native C/CXX compiler in CMake.
However since qtcreator didn't recognized the paths given by warning and error messages from CLang I forced CLang to output absolute paths always by setting -working-directory "/" to output paths relative to the root directory. However this seams to fool some internal setup/path detection or whatever process of CMake. If I use CLang together with -working-directory "/" I can't build shared libraries anymore, because CMake somehow fails on setting the proper fPIC flags then. Steps to Reproduce: On a shared library target building project: - set clang/clang++ as the native C/CXX compiler in CMake - build the project ---> everything should be fine ---> grep -l -R fPIC . will show you that fPIC is actually in the compile line. Look into your ./**/flags.make files. - add -working-directory "/" to C/CXX flags in CMake - make rebuild_cache - build the project ---> linker complains about missing fPIC on your object files with something like: relocation R_X86_64_32S against `.bss' can not be used when making a shared object ---> grep -l -R fPIC . will show you that fPIC is missing in the compile line. Look into your ./**/flags.make files. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2011-11-30 06:58 doob New Issue ====================================================================== -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers