Skip to content

Commit

Permalink
remove FORTIFY_SOURCE, redefined
Browse files Browse the repository at this point in the history
  • Loading branch information
AviaAv committed Sep 29, 2024
1 parent 04259b3 commit 6035b57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMake/unix_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ macro(os_set_flags)

if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|armv7l" OR APPLE OR # Some flags are not recognized or some systems / gcc versions
(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")) #
set(ADDITIONAL_COMPILER_FLAGS "-Wformat -Wformat-security -fPIC -D_FORTIFY_SOURCE=2 -fstack-protector")
set(ADDITIONAL_COMPILER_FLAGS "-Wformat -Wformat-security -fPIC -fstack-protector")
else()
#‘-mfunction-return’ and ‘-fcf-protection’ are not compatible, so specifing -fcf-protection=none
set(ADDITIONAL_COMPILER_FLAGS "-Wformat -Wformat-security -fPIC -D_FORTIFY_SOURCE=2 -fcf-protection=none -mfunction-return=thunk -mindirect-branch=thunk -mindirect-branch-register -fstack-protector")
set(ADDITIONAL_COMPILER_FLAGS "-Wformat -Wformat-security -fPIC -fcf-protection=none -mfunction-return=thunk -mindirect-branch=thunk -mindirect-branch-register -fstack-protector")
endif()
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -pie")

Expand Down

0 comments on commit 6035b57

Please sign in to comment.