diff options
author | Darren Tucker <dtucker@zip.com.au> | 2014-01-17 09:53:24 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2014-01-17 09:53:24 +1100 |
commit | fd994379dd972417d0491767f7cd9b5bf23f4975 (patch) | |
tree | 7148d308a263413c41d896350be1d538d4e01948 /aclocal.m4 | |
parent | 366224d21768ee8ec28cfbcc5fbade1b32582d58 (diff) |
- (dtucker) [aclocal.m4 configure.ac] Add some additional compiler/toolchain
hardening flags including -fstack-protector-strong. These default to on
if the toolchain supports them, but there is a configure-time knob
(--without-hardening) to disable them if necessary. ok djm@
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 1b3bed790..b1648e4e7 100644 --- a/aclocal.m4 +++ b/aclocal.m4 | |||
@@ -1,4 +1,4 @@ | |||
1 | dnl $Id: aclocal.m4,v 1.9 2013/06/02 21:31:27 tim Exp $ | 1 | dnl $Id: aclocal.m4,v 1.10 2014/01/16 22:53:24 dtucker Exp $ |
2 | dnl | 2 | dnl |
3 | dnl OpenSSH-specific autoconf macros | 3 | dnl OpenSSH-specific autoconf macros |
4 | dnl | 4 | dnl |
@@ -10,7 +10,7 @@ dnl 'check_flag'. | |||
10 | AC_DEFUN([OSSH_CHECK_CFLAG_COMPILE], [{ | 10 | AC_DEFUN([OSSH_CHECK_CFLAG_COMPILE], [{ |
11 | AC_MSG_CHECKING([if $CC supports $1]) | 11 | AC_MSG_CHECKING([if $CC supports $1]) |
12 | saved_CFLAGS="$CFLAGS" | 12 | saved_CFLAGS="$CFLAGS" |
13 | CFLAGS="$CFLAGS $1" | 13 | CFLAGS="$CFLAGS $WERROR $1" |
14 | _define_flag="$2" | 14 | _define_flag="$2" |
15 | test "x$_define_flag" = "x" && _define_flag="$1" | 15 | test "x$_define_flag" = "x" && _define_flag="$1" |
16 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], | 16 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], |
@@ -28,6 +28,23 @@ fi], | |||
28 | ) | 28 | ) |
29 | }]) | 29 | }]) |
30 | 30 | ||
31 | dnl OSSH_CHECK_CFLAG_LINK(check_flag[, define_flag]) | ||
32 | dnl Check that $LD accepts a flag 'check_flag'. If it is supported append | ||
33 | dnl 'define_flag' to $LDFLAGS. If 'define_flag' is not specified, then append | ||
34 | dnl 'check_flag'. | ||
35 | AC_DEFUN([OSSH_CHECK_LDFLAG_LINK], [{ | ||
36 | AC_MSG_CHECKING([if $LD supports $1]) | ||
37 | saved_LDFLAGS="$LDFLAGS" | ||
38 | LDFLAGS="$LDFLAGS $WERROR $1" | ||
39 | _define_flag="$2" | ||
40 | test "x$_define_flag" = "x" && _define_flag="$1" | ||
41 | AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], | ||
42 | [ AC_MSG_RESULT([yes]) | ||
43 | LDFLAGS="$saved_LDFLAGS $_define_flag"], | ||
44 | [ AC_MSG_RESULT([no]) | ||
45 | LDFLAGS="$saved_LDFLAGS" ] | ||
46 | ) | ||
47 | }]) | ||
31 | 48 | ||
32 | dnl OSSH_CHECK_HEADER_FOR_FIELD(field, header, symbol) | 49 | dnl OSSH_CHECK_HEADER_FOR_FIELD(field, header, symbol) |
33 | dnl Does AC_EGREP_HEADER on 'header' for the string 'field' | 50 | dnl Does AC_EGREP_HEADER on 'header' for the string 'field' |