I patch both configure.ac and configure itself (though only configure is required for the build) Serenity's GCC doesn't support SSP, so this is disabled. --- a/configure.ac.orig +++ b/configure.ac @@ -99,22 +99,7 @@ [AC_MSG_NOTICE([Not setting $TESTFLAGS]); LDFLAGS="$OLDLDFLAGS" ] ) fi # non-static - # stack protector. -strong is good but only in gcc 4.9 or later - OLDCFLAGS="$CFLAGS" - TESTFLAGS="-fstack-protector-strong" - CFLAGS="$CFLAGS $TESTFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], - [AC_MSG_NOTICE([Setting $TESTFLAGS])], - [ - CFLAGS="$OLDCFLAGS" - TESTFLAGS="-fstack-protector --param=ssp-buffer-size=4" - CFLAGS="$CFLAGS $TESTFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], - [AC_MSG_NOTICE([Setting $TESTFLAGS])], - [AC_MSG_NOTICE([Not setting $TESTFLAGS]); CFLAGS="$OLDCFLAGS" ] - ) - ] - ) + # FORTIFY_SOURCE DB_TRYADDCFLAGS([-D_FORTIFY_SOURCE=2]) --- a/configure.orig +++ b/configure @@ -3357,53 +3357,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # non-static - # stack protector. -strong is good but only in gcc 4.9 or later - OLDCFLAGS="$CFLAGS" - TESTFLAGS="-fstack-protector-strong" - CFLAGS="$CFLAGS $TESTFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting $TESTFLAGS" >&5 -$as_echo "$as_me: Setting $TESTFLAGS" >&6;} -else - - CFLAGS="$OLDCFLAGS" - TESTFLAGS="-fstack-protector --param=ssp-buffer-size=4" - CFLAGS="$CFLAGS $TESTFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: Setting $TESTFLAGS" >&5 -$as_echo "$as_me: Setting $TESTFLAGS" >&6;} -else - { $as_echo "$as_me:${as_lineno-$LINENO}: Not setting $TESTFLAGS" >&5 -$as_echo "$as_me: Not setting $TESTFLAGS" >&6;}; CFLAGS="$OLDCFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # FORTIFY_SOURCE { OLDFLAGS="$CFLAGS"