From 330c93f68a8cbbf416b2e2c9150e0a9b8964a51b Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 16 Jun 2008 02:27:48 +1000 Subject: [PATCH] - (dtucker) [configure.ac] Enable -fno-builtin-memset when using gcc. --- ChangeLog | 5 ++++- configure.ac | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0bd06cd6a..38fb74a44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20080615 + - (dtucker) [configure.ac] Enable -fno-builtin-memset when using gcc. + 20080614 - (djm) [openbsd-compat/sigact.c] Avoid NULL derefs in ancient sigaction replacement code; patch from ighighi AT gmail.com in bz#1240; @@ -4369,4 +4372,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.5011 2008/06/15 00:55:34 djm Exp $ +$Id: ChangeLog,v 1.5012 2008/06/15 16:27:48 dtucker Exp $ diff --git a/configure.ac b/configure.ac index aea6cb312..eb71a879a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.405 2008/06/13 23:14:46 dtucker Exp $ +# $Id: configure.ac,v 1.406 2008/06/15 16:27:48 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.405 $) +AC_REVISION($Revision: 1.406 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -112,6 +112,18 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then *) ;; esac + AC_MSG_CHECKING(if $CC accepts -fno-builtin-memset) + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-builtin-memset" + AC_LINK_IFELSE( [AC_LANG_SOURCE([[ +#include +int main(void){char b[10]; memset(b, 0, sizeof(b));} + ]])], + [ AC_MSG_RESULT(yes) ], + [ AC_MSG_RESULT(no) + CFLAGS="$saved_CFLAGS" ] +) + # -fstack-protector-all doesn't always work for some GCC versions # and/or platforms, so we test if we can. If it's not supported # on a give platform gcc will emit a warning so we use -Werror.