Backport from trunk r187586 http://gcc.gnu.org/ml/gcc-cvs/2012-05/msg00583.html
Enable -fstack-protector support for Android targets. The patch only affects targets where __BIONIC__ is defined. Built Android arm toolchain. Would like to commit the patch to google/gcc-4_6 and google/gcc-4_6_2-mobile. OK? 2012-05-18 Jing Yu <jin...@google.com> Backport from trunk r187586: 2012-05-16 Igor Zamyatin <igor.zamya...@intel.com> * configure.ac: Stack protector enabling for Android targets. * configure: Regenerate. Index: gcc/configure =================================================================== --- gcc/configure (revision 187663) +++ gcc/configure (working copy) @@ -25862,6 +25862,11 @@ $target_header_dir/bits/uClibc_config.h > /dev/null; then gcc_cv_libc_provides_ssp=yes fi + # all versions of Bionic support stack protector + elif test -f $target_header_dir/sys/cdefs.h \ + && $EGREP '^[ ]*#[ ]*define[ ]+__BIONIC__[ ]+1' \ + $target_header_dir/sys/cdefs.h > /dev/null; then + gcc_cv_libc_provides_ssp=yes fi ;; *-*-gnu*) Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 187663) +++ gcc/configure.ac (working copy) @@ -4414,6 +4414,11 @@ $target_header_dir/bits/uClibc_config.h > /dev/null; then gcc_cv_libc_provides_ssp=yes fi + # all versions of Bionic support stack protector + elif test -f $target_header_dir/sys/cdefs.h \ + && $EGREP '^[ ]*#[ ]*define[ ]+__BIONIC__[ ]+1' \ + $target_header_dir/sys/cdefs.h > /dev/null; then + gcc_cv_libc_provides_ssp=yes fi] ;; *-*-gnu*) Index: gcc/ChangeLog.google-4_6 =================================================================== --- gcc/ChangeLog.google-4_6 (revision 187663) +++ gcc/ChangeLog.google-4_6 (working copy) @@ -1,3 +1,11 @@ +2012-05-18 Jing Yu <jin...@google.com> + + Backport from trunk r187586: + 2012-05-16 Igor Zamyatin <igor.zamya...@intel.com> + + * configure.ac: Stack protector enabling for Android targets. + * configure: Regenerate. + 2012-05-18 Teresa Johnson <tejohn...@google.com> Backport from google/main r187660: -- This patch is available for review at http://codereview.appspot.com/6220051