diff options
author | Darren Tucker <dtucker@zip.com.au> | 2008-03-09 22:50:50 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2008-03-09 22:50:50 +1100 |
commit | fe1cf97ee811dc7a2bb7cea912c9292c976ab5af (patch) | |
tree | 24111b20b19b559247bda0f35ee289893228d9bc | |
parent | 7643e3397d27bb4c18940d1af65c247c48c4bae1 (diff) |
- (dtucker) [configure.ac] Run stack-protector tests with -Werror to catch
platforms where gcc understands the option but it's not supported (and
thus generates a warning).
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | configure.ac | 23 |
2 files changed, 19 insertions, 9 deletions
@@ -8,6 +8,9 @@ | |||
8 | - (dtucker) [openbsd-compat/regress/strtonumtest.c] Bug #1347: Use platform's | 8 | - (dtucker) [openbsd-compat/regress/strtonumtest.c] Bug #1347: Use platform's |
9 | equivalent of LLONG_MAX for the compat regression tests, which makes them | 9 | equivalent of LLONG_MAX for the compat regression tests, which makes them |
10 | run on AIX and HP-UX. Patch from David Leonard. | 10 | run on AIX and HP-UX. Patch from David Leonard. |
11 | - (dtucker) [configure.ac] Run stack-protector tests with -Werror to catch | ||
12 | platforms where gcc understands the option but it's not supported (and | ||
13 | thus generates a warning). | ||
11 | 14 | ||
12 | 20080307 | 15 | 20080307 |
13 | - (djm) OpenBSD CVS Sync | 16 | - (djm) OpenBSD CVS Sync |
@@ -3709,4 +3712,4 @@ | |||
3709 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 3712 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
3710 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 3713 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
3711 | 3714 | ||
3712 | $Id: ChangeLog,v 1.4863 2008/03/09 06:10:09 dtucker Exp $ | 3715 | $Id: ChangeLog,v 1.4864 2008/03/09 11:50:50 dtucker Exp $ |
diff --git a/configure.ac b/configure.ac index b71f6832a..b6fa19bd0 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.394 2008/03/09 00:34:23 dtucker Exp $ | 1 | # $Id: configure.ac,v 1.395 2008/03/09 11:50:50 dtucker Exp $ |
2 | # | 2 | # |
3 | # Copyright (c) 1999-2004 Damien Miller | 3 | # Copyright (c) 1999-2004 Damien Miller |
4 | # | 4 | # |
@@ -15,7 +15,7 @@ | |||
15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | 16 | ||
17 | AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) | 17 | AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) |
18 | AC_REVISION($Revision: 1.394 $) | 18 | AC_REVISION($Revision: 1.395 $) |
19 | AC_CONFIG_SRCDIR([ssh.c]) | 19 | AC_CONFIG_SRCDIR([ssh.c]) |
20 | 20 | ||
21 | AC_CONFIG_HEADER(config.h) | 21 | AC_CONFIG_HEADER(config.h) |
@@ -113,16 +113,23 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then | |||
113 | esac | 113 | esac |
114 | 114 | ||
115 | # -fstack-protector-all doesn't always work for some GCC versions | 115 | # -fstack-protector-all doesn't always work for some GCC versions |
116 | # and/or platforms, so we test if we can. | 116 | # and/or platforms, so we test if we can. If it's not supported |
117 | # on a give platform gcc will emit a warning so we use -Werror. | ||
117 | if test "x$use_stack_protector" = "x1"; then | 118 | if test "x$use_stack_protector" = "x1"; then |
118 | for t in -fstack-protector-all -fstack-protector; do | 119 | for t in -fstack-protector-all -fstack-protector; do |
119 | AC_MSG_CHECKING(if $CC understands $t) | 120 | AC_MSG_CHECKING(if $CC supports $t) |
120 | saved_CFLAGS="$CFLAGS" | 121 | saved_CFLAGS="$CFLAGS" |
121 | saved_LDFLAGS="$LDFLAGS" | 122 | saved_LDFLAGS="$LDFLAGS" |
122 | CFLAGS="$CFLAGS $t" | 123 | CFLAGS="$CFLAGS $t -Werror" |
123 | LDFLAGS="$LDFLAGS $t" | 124 | LDFLAGS="$LDFLAGS $t -Werror" |
124 | AC_TRY_LINK([], [ int main(void){return 0;} ], | 125 | AC_LINK_IFELSE( |
126 | [AC_LANG_SOURCE([ | ||
127 | #include <stdlib.h> | ||
128 | int main(void){return 0;} | ||
129 | ])], | ||
125 | [ AC_MSG_RESULT(yes) | 130 | [ AC_MSG_RESULT(yes) |
131 | CFLAGS="$saved_CFLAGS $t" | ||
132 | LDFLAGS="$saved_LDFLAGS $t" | ||
126 | AC_MSG_CHECKING(if $t works) | 133 | AC_MSG_CHECKING(if $t works) |
127 | AC_RUN_IFELSE( | 134 | AC_RUN_IFELSE( |
128 | [AC_LANG_SOURCE([ | 135 | [AC_LANG_SOURCE([ |
@@ -134,7 +141,7 @@ int main(void){exit(0);} | |||
134 | [ AC_MSG_RESULT(no) ], | 141 | [ AC_MSG_RESULT(no) ], |
135 | [ AC_MSG_WARN([cross compiling: cannot test]) | 142 | [ AC_MSG_WARN([cross compiling: cannot test]) |
136 | break ] | 143 | break ] |
137 | ) | 144 | ) |
138 | ], | 145 | ], |
139 | [ AC_MSG_RESULT(no) ] | 146 | [ AC_MSG_RESULT(no) ] |
140 | ) | 147 | ) |