|
|
|
@ -16,6 +16,7 @@
|
|
|
|
|
#################################################
|
|
|
|
|
|
|
|
|
|
include( CheckCXXCompilerFlag )
|
|
|
|
|
include( CheckLinkerFlag OPTIONAL )
|
|
|
|
|
include( TDEVersion )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2843,7 +2844,29 @@ macro( tde_setup_architecture_flags )
|
|
|
|
|
check_cxx_compiler_flag( -fPIE HAVE_PIE_SUPPORT )
|
|
|
|
|
if( HAVE_PIE_SUPPORT )
|
|
|
|
|
set( TDE_PIE_CFLAGS -fPIE )
|
|
|
|
|
set( TDE_PIE_LDFLAGS -pie )
|
|
|
|
|
|
|
|
|
|
if( ${CMAKE_VERSION} VERSION_LESS "3.18" )
|
|
|
|
|
execute_process(COMMAND "${CMAKE_LINKER}" --help
|
|
|
|
|
OUTPUT_VARIABLE __linker_help
|
|
|
|
|
ERROR_VARIABLE __linker_help)
|
|
|
|
|
if( "${__linker_help}" MATCHES "-pie" )
|
|
|
|
|
set( LINKER_PIE_SUPPORT 1 )
|
|
|
|
|
elseif( "${__linker_help}" MATCHES "type=type.*pie" )
|
|
|
|
|
set( LINKER_ZTYPE_PIE_SUPPORT 1 )
|
|
|
|
|
endif( )
|
|
|
|
|
unset(__linker_help)
|
|
|
|
|
else( )
|
|
|
|
|
check_linker_flag(CXX -pie LINKER_PIE_SUPPORT)
|
|
|
|
|
if( NOT LINKER_PIE_SUPPORT )
|
|
|
|
|
check_linker_flag(CXX -ztype=pie LINKER_ZTYPE_PIE_SUPPORT)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
if( LINKER_PIE_SUPPORT )
|
|
|
|
|
set( TDE_PIE_LDFLAGS -pie )
|
|
|
|
|
endif( LINKER_PIE_SUPPORT )
|
|
|
|
|
if( LINKER_ZTYPE_PIE_SUPPORT )
|
|
|
|
|
set( TDE_PIE_LDFLAGS -ztype=pie )
|
|
|
|
|
endif( LINKER_ZTYPE_PIE_SUPPORT )
|
|
|
|
|
endif( HAVE_PIE_SUPPORT )
|
|
|
|
|
|
|
|
|
|
set( _reproducible_cxxflags
|
|
|
|
|