Commit 52a1b5a8 authored by Alexey Botchkov's avatar Alexey Botchkov

MY_CHECK_AND_SET_COMPILER_FLAG changes

* watch for "redefined macro" warning
* don't enable -D_FORTIFY_SOURCE=2 in debug builds (it requires -O)
parent 190858d9
...@@ -206,13 +206,7 @@ IF(SECURITY_HARDENED) ...@@ -206,13 +206,7 @@ IF(SECURITY_HARDENED)
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC") MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wl,-z,relro,-z,now") MY_CHECK_AND_SET_COMPILER_FLAG("-Wl,-z,relro,-z,now")
MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector --param=ssp-buffer-size=4") MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector --param=ssp-buffer-size=4")
MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
# sometimes _FORTIFY_SOURCE is predefined
INCLUDE(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(_FORTIFY_SOURCE "" HAVE_FORTIFY_SOURCE)
IF(NOT HAVE_FORTIFY_SOURCE)
ADD_DEFINITIONS(-D_FORTIFY_SOURCE=2)
ENDIF()
ENDIF() ENDIF()
OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON) OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON)
......
...@@ -9,6 +9,7 @@ SET(fail_patterns ...@@ -9,6 +9,7 @@ SET(fail_patterns
FAIL_REGEX "unrecognized .*option" FAIL_REGEX "unrecognized .*option"
FAIL_REGEX "ignoring unknown option" FAIL_REGEX "ignoring unknown option"
FAIL_REGEX "warning:.*ignored" FAIL_REGEX "warning:.*ignored"
FAIL_REGEX "warning:.*redefined"
FAIL_REGEX "[Ww]arning: [Oo]ption" FAIL_REGEX "[Ww]arning: [Oo]ption"
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment