summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Black <daniel@linux.ibm.com>2020-05-05 11:57:20 +1000
committerEugene Kosov <claprix@yandex.ru>2020-07-15 09:23:53 +0300
commit7473e1841c630d86f1873a2a7afacb53955b3f6f (patch)
tree56988a6cc9ea35b74cd9cda0bc17ad423484c8da /CMakeLists.txt
parentdfdfeecb03edaf5660f5e15337381dda6f83102c (diff)
downloadmariadb-git-7473e1841c630d86f1873a2a7afacb53955b3f6f.tar.gz
check_linker_flag: use for linker flags
-Wl,-z,relro,-z,now are linker flags and should be checked as such. TODO: perform module, exe shared checks separately rather than a pure linker check.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05e3c52f1e4..660b3ee46bb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -186,6 +186,7 @@ ENDIF()
OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system libraries. Only set it you never plan to distribute the resulting binaries" OFF)
INCLUDE(check_compiler_flag)
+INCLUDE(check_linker_flag)
OPTION(WITH_ASAN "Enable address sanitizer" OFF)
IF (WITH_ASAN)
@@ -234,7 +235,7 @@ IF(SECURITY_HARDENED)
ENDIF()
# security-enhancing flags
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
- MY_CHECK_AND_SET_COMPILER_FLAG("-Wl,-z,relro,-z,now")
+ MY_CHECK_AND_SET_LINKER_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("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
ENDIF()