Skip to content

Commit

Permalink
Merge pull request #10755 from SUSE/wip-cmake-use-pie
Browse files Browse the repository at this point in the history
cmake: Add -pie to CMAKE_EXE_LINKER_FLAGS

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Aug 17, 2016
2 parents aaacd3e + 9e705be commit 810f660
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Expand Up @@ -25,6 +25,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Werror=format-security -fno
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
add_definitions("-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-export-dynamic")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -rdynamic -Wl,-export-dynamic -export-dynamic")
Expand Down

0 comments on commit 810f660

Please sign in to comment.