diff mbox

[google] Backport to enable stack protector for Android targets (issue6220051)

Message ID 20120518183530.3739A60CE5@jingyu.mtv.corp.google.com
State New
Headers show

Commit Message

Jing Yu May 18, 2012, 6:35 p.m. UTC
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  <jingyu@google.com>

	Backport from trunk r187586:
	2012-05-16  Igor Zamyatin  <igor.zamyatin@intel.com>
	* configure.ac: Stack protector enabling for Android targets.
	* configure: Regenerate.


--
This patch is available for review at http://codereview.appspot.com/6220051

Comments

Diego Novillo May 18, 2012, 7:13 p.m. UTC | #1
On Fri, May 18, 2012 at 2:35 PM, Jing Yu <jingyu@google.com> wrote:

> 2012-05-18   Jing Yu  <jingyu@google.com>
>
>        Backport from trunk r187586:
>        2012-05-16  Igor Zamyatin  <igor.zamyatin@intel.com>
>        * configure.ac: Stack protector enabling for Android targets.
>        * configure: Regenerate.

OK.


Diego.
diff mbox

Patch

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  <jingyu@google.com>
+
+	Backport from trunk r187586:
+	2012-05-16  Igor Zamyatin  <igor.zamyatin@intel.com>
+
+	* configure.ac: Stack protector enabling for Android targets.
+	* configure: Regenerate.
+
 2012-05-18   Teresa Johnson  <tejohnson@google.com>
 
 	Backport from google/main r187660: