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 gcc-4.8/gcc/config/linux.h | 2 +- 26 2 files changed, 2 insertions(+), 2 deletions(-) 27 28diff --git a/gcc-4.6/gcc/config/linux.h b/gcc-4.6/gcc/config/linux.h 29index 4e21112..025157f 100644 30--- a/gcc-4.6/gcc/config/linux.h 31+++ b/gcc-4.6/gcc/config/linux.h 32@@ -99,7 +99,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 33 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) 34 35 /* Whether we have sincos that follows the GNU extension. */ 36-#define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC) 37+#define TARGET_HAS_SINCOS (OPTION_GLIBC) 38 39 /* Whether we have Bionic libc runtime */ 40 #undef TARGET_HAS_BIONIC 41diff --git a/gcc-4.8/gcc/config/linux.h b/gcc-4.8/gcc/config/linux.h 42index 2be1079..b83dc08 100644 43--- a/gcc-4.8/gcc/config/linux.h 44+++ b/gcc-4.8/gcc/config/linux.h 45@@ -102,7 +102,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 46 47 /* Whether we have sincos that follows the GNU extension. */ 48 #undef TARGET_HAS_SINCOS 49-#define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC) 50+#define TARGET_HAS_SINCOS (OPTION_GLIBC) 51 52 /* Whether we have Bionic libc runtime */ 53 #undef TARGET_HAS_BIONIC 54-- 551.7.6.rc0 56 57