Add a compile-time check for FORTIFY_SOURCE support

This is broken on some platforms, so pull in the conditional macro from
the latest version of autoconf-archive to test for working support.
This commit is contained in:
Brent Cook
2020-08-20 02:18:39 -05:00
parent d9b4363a5f
commit 56202472bf
2 changed files with 81 additions and 1 deletions

View File

@@ -73,7 +73,7 @@ AC_DEFUN([CHECK_C_HARDENING_OPTIONS], [
CHECK_CFLAG([[-fno-strict-overflow]])
# _FORTIFY_SOURCE replaces builtin functions with safer versions.
CHECK_CFLAG([[-D_FORTIFY_SOURCE=2]])
AX_ADD_FORTIFY_SOURCE
# Enable read only relocations
CHECK_LDFLAG([[-Wl,-z,relro]])