Changeset 6206 for icGREP


Ignore:
Timestamp:
Nov 19, 2018, 4:20:18 PM (3 months ago)
Author:
cameron
Message:

Check compiler support for -no-pie flag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r6186 r6206  
    239239SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
    240240
     241SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls")
     242
    241243# no pie disables the generation of position-independent executables, which is a default security feature of newer compiles
    242244# that prevents addr2line from being able to resolve which line corresponds to the code at run time. This in turn prevents
    243245# CreateAssert from being able to provide the compilation call stack for each JIT'ed assertion error.
    244246
    245 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -no-pie")
     247CHECK_CXX_COMPILER_FLAG("-no-pie" COMPILER_SUPPORTS_NO_PIE)
     248IF (COMPILER_SUPPORTS_NO_PIE)
     249  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -no-pie")
     250ENDIF()
    246251
    247252UNSET(HAS_ADDRESS_SANITIZER)
Note: See TracChangeset for help on using the changeset viewer.