View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012601CMakeCMakepublic2011-11-30 06:582012-04-02 10:10
Reporterdoob 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionsuspended 
PlatformLinux x86_64OSLinux OpenSuseOS Version11.4
Product VersionCMake 2.8.6 
Target VersionFixed in Version 
Summary0012601: CLang with Opiton -working-directory leads CMake to ommit fPIC in CXX_FLAGS for shared libs
DescriptionI 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 ReproduceOn 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.


TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0027873)
Brad King (manager)
2011-11-30 09:07

Please bring this up on the users list first to see if anyone else can reproduce it and help:

  http://www.cmake.org/mailman/listinfo/cmake [^]
(0029054)
David Cole (manager)
2012-04-02 10:10

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-11-30 06:58 doob New Issue
2011-11-30 09:07 Brad King Note Added: 0027873
2011-11-30 09:07 Brad King Status new => resolved
2011-11-30 09:07 Brad King Resolution open => suspended
2011-11-30 09:07 Brad King Assigned To => Brad King
2012-04-02 10:10 David Cole Note Added: 0029054
2012-04-02 10:10 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team