diff options
author | fche <fche> | 2008-01-29 15:36:16 +0000 |
---|---|---|
committer | fche <fche> | 2008-01-29 15:36:16 +0000 |
commit | bbfd8c1a59001a26cf04c34a97b247fbab9a5bad (patch) | |
tree | a5a74ad372b6d9062b1076a5016a5d4bc497b070 | |
parent | 564eb0a8ce73a298715c94e02988a29c2064a4ad (diff) | |
download | systemtap-steved-bbfd8c1a59001a26cf04c34a97b247fbab9a5bad.tar.gz systemtap-steved-bbfd8c1a59001a26cf04c34a97b247fbab9a5bad.tar.xz systemtap-steved-bbfd8c1a59001a26cf04c34a97b247fbab9a5bad.zip |
PR5647: build with -fstack-protector-all by default
2008-01-29 Frank Ch. Eigler <fche@elastic.org>
PR 5647
* configure.ac (--enable-ssp): Make default on compilers that
support it.
* configure: Regenerated.
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | configure | 45 | ||||
-rw-r--r-- | configure.ac | 15 |
3 files changed, 57 insertions, 10 deletions
@@ -1,3 +1,10 @@ +2008-01-29 Frank Ch. Eigler <fche@elastic.org> + + PR 5647 + * configure.ac (--enable-ssp): Make default on compilers that + support it. + * configure: Regenerated. + 2008-01-28 David Smith <dsmith@redhat.com> * configure.ac: Fixed a bug when "--disable-permon" was used. @@ -1317,7 +1317,7 @@ Optional Features: installation (needed if installed in a non-standard location). --enable-prologues make -P prologue-searching default - --enable-ssp enable gcc stack-protector + --disable-ssp disable gcc stack-protector --enable-sqlite build with sqlite support --enable-crash[=DIRECTORY] enable crash extension (default is disabled). @@ -5948,17 +5948,52 @@ fi fi - # Check whether --enable-ssp was given. if test "${enable_ssp+set}" = set; then enableval=$enable_ssp; fi -if test "x$enable_ssp" == xyes; then - CFLAGS="$CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2" +if test "x$enable_ssp" != xno; then + + save_CFLAGS="$CFLAGS" + save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2" - { echo "$as_me:$LINENO: Compiling with gcc -fstack-protector-all et al." >&5 + CFLAGS="$CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2" + cat >conftest.$ac_ext <<_ACEOF +int something (); +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + { echo "$as_me:$LINENO: Compiling with gcc -fstack-protector-all et al." >&5 echo "$as_me: Compiling with gcc -fstack-protector-all et al." >&6;} +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + { echo "$as_me:$LINENO: Compiler does not support -fstack-protector-all et al." >&5 +echo "$as_me: Compiler does not support -fstack-protector-all et al." >&6;} + CFLAGS="$save_CFLAGS" + CXXFLAGS="$save_CXXFLAGS" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi diff --git a/configure.ac b/configure.ac index 445b592f..d8a7d38c 100644 --- a/configure.ac +++ b/configure.ac @@ -66,13 +66,18 @@ if test "$enable_prologues" = yes; then AC_DEFINE([ENABLE_PROLOGUES],[],[make -P prologue-searching default]) fi]) - AC_ARG_ENABLE([ssp], - [AS_HELP_STRING([--enable-ssp], [enable gcc stack-protector])]) -AS_IF([test "x$enable_ssp" == xyes], - [CFLAGS="$CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2" + [AS_HELP_STRING([--disable-ssp], [disable gcc stack-protector])]) +AS_IF([test "x$enable_ssp" != xno],[ + save_CFLAGS="$CFLAGS" + save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2" - AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.])]) + CFLAGS="$CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2" + AC_COMPILE_IFELSE([int something ();], [ + AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.])], [ + AC_MSG_NOTICE([Compiler does not support -fstack-protector-all et al.]) + CFLAGS="$save_CFLAGS" + CXXFLAGS="$save_CXXFLAGS"])]) dnl Handle optional sqlite support. If enabled/disabled by the user, dnl do the right thing. If not specified by the user, use it if |