aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <[email protected]>2020-06-18 13:31:07 +0800
committerfanquake <[email protected]>2020-06-19 17:20:27 +0800
commit076183b36b76a11438463883ff916f17aef9e001 (patch)
tree0fd11ad5682521d0a0587169a6a43d5688c0605b
parentMerge #19293: net: Avoid redundant and confusing FAILED log (diff)
downloaddiscoin-076183b36b76a11438463883ff916f17aef9e001.tar.xz
discoin-076183b36b76a11438463883ff916f17aef9e001.zip
build: add -fcf-protection=full to hardening options
Enables code instrumentation of control-flow transfers. Available in GCC 8 and Clang 7. This option is now on by default in Ubuntu GCC as of 19.10.
-rw-r--r--configure.ac1
1 files changed, 1 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 12bece690..fe8ce1a8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -785,6 +785,7 @@ if test x$use_hardening != xno; then
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
+ AX_CHECK_COMPILE_FLAG([-fcf-protection=full],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fcf-protection=full"])
dnl When enable_debug is yes, all optimizations are disabled.
dnl However, FORTIFY_SOURCE requires that there is some level of optimization, otherwise it does nothing and just creates a compiler warning.
dnl Since FORTIFY_SOURCE is a no-op without optimizations, do not enable it when enable_debug is yes.