The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14983 
====================================================================== 
Reported By:                Ludwig Nussel
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14983
Category:                   CMake
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-06-20 07:19 EDT
Last Modified:              2014-06-20 07:19 EDT
====================================================================== 
Summary:                    POSITION_INDEPENDENT_CODE does not add -pie
Description: 
I tried to make wodim a position independent executable to comply with distro
policies. I did that by adding this to CMakeLists.txt:
SET_TARGET_PROPERTIES(wodim PROPERTIES POSITION_INDEPENDENT_CODE TRUE)

That however does not set -pie for the linker flags so no actual pie binary is
created. An extra "LINK_FLAGS -pie" is necessary. I guess that's not the
intention of the abstraction.


Steps to Reproduce: 
SET_TARGET_PROPERTIES(wodim PROPERTIES POSITION_INDEPENDENT_CODE TRUE)

should result in

$ readelf -h wodim|grep Type:
  Type:                              DYN (Shared object file)

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-06-20 07:19 Ludwig Nussel  New Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to