1From 504ba0176a97c9b849fd18c4591a2cfc8d5eb130 Mon Sep 17 00:00:00 2001 2From: David 'Digit' Turner <digit@google.com> 3Date: Wed, 9 May 2012 17:53:13 +0200 4Subject: gcc-4.6: Disable sincos optimization 5 6Ensure that sincos optimization is disabled for NDK toolchain 7builds. This ensures that NDK-generated code will always link 8on legacy Android platforms that don't implement sincos() in 9their /system/lib/libm.so. 10 11For the record, this optimization changes the following code: 12 13 double c, s; 14 c = cos(angle); 15 s = sin(angle); 16 17Into machine code that does: 18 19 double c, s; 20 sincos(angle, &s, &c); 21 22Change-Id: I332bf5788267dd56e93b8cdb0cefa04b970eca88 23--- 24 gcc-4.6/gcc/config/linux.h | 2 +- 25 1 files changed, 1 insertions(+), 1 deletions(-) 26 27diff --git a/gcc-4.6/gcc/config/linux.h b/gcc-4.6/gcc/config/linux.h 28index 4e21112..025157f 100644 29--- a/gcc-4.6/gcc/config/linux.h 30+++ b/gcc-4.6/gcc/config/linux.h 31@@ -99,7 +99,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 32 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) 33 34 /* Whether we have sincos that follows the GNU extension. */ 35-#define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC) 36+#define TARGET_HAS_SINCOS (OPTION_GLIBC) 37 38 /* Whether we have Bionic libc runtime */ 39 #undef TARGET_HAS_BIONIC 40diff --git a/gcc-4.7/gcc/config/linux.h b/gcc-4.7/gcc/config/linux.h 41index fb459e6..bf5993f 100644 42--- a/gcc-4.7/gcc/config/linux.h 43+++ b/gcc-4.7/gcc/config/linux.h 44@@ -103,7 +103,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 45 46 /* Whether we have sincos that follows the GNU extension. */ 47 #undef TARGET_HAS_SINCOS 48-#define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC) 49+#define TARGET_HAS_SINCOS (OPTION_GLIBC) 50 51 /* Whether we have Bionic libc runtime */ 52 #undef TARGET_HAS_BIONIC 53diff --git a/gcc-4.8/gcc/config/linux.h b/gcc-4.8/gcc/config/linux.h 54index 2be1079..b83dc08 100644 55--- a/gcc-4.8/gcc/config/linux.h 56+++ b/gcc-4.8/gcc/config/linux.h 57@@ -102,7 +102,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 58 59 /* Whether we have sincos that follows the GNU extension. */ 60 #undef TARGET_HAS_SINCOS 61-#define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC) 62+#define TARGET_HAS_SINCOS (OPTION_GLIBC) 63 64 /* Whether we have Bionic libc runtime */ 65 #undef TARGET_HAS_BIONIC 66-- 671.7.6.rc0 68 69