1 From 504ba0176a97c9b849fd18c4591a2cfc8d5eb130 Mon Sep 17 00:00:00 2001 2 From: David 'Digit' Turner <digit (a] google.com> 3 Date: Wed, 9 May 2012 17:53:13 +0200 4 Subject: gcc-4.6: Disable sincos optimization 5 6 Ensure that sincos optimization is disabled for NDK toolchain 7 builds. This ensures that NDK-generated code will always link 8 on legacy Android platforms that don't implement sincos() in 9 their /system/lib/libm.so. 10 11 For the record, this optimization changes the following code: 12 13 double c, s; 14 c = cos(angle); 15 s = sin(angle); 16 17 Into machine code that does: 18 19 double c, s; 20 sincos(angle, &s, &c); 21 22 Change-Id: I332bf5788267dd56e93b8cdb0cefa04b970eca88 23 --- 24 gcc-4.6/gcc/config/linux.h | 2 +- 25 1 files changed, 1 insertions(+), 1 deletions(-) 26 27 diff --git a/gcc-4.6/gcc/config/linux.h b/gcc-4.6/gcc/config/linux.h 28 index 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 40 diff --git a/gcc-4.7/gcc/config/linux.h b/gcc-4.7/gcc/config/linux.h 41 index 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 53 diff --git a/gcc-4.8/gcc/config/linux.h b/gcc-4.8/gcc/config/linux.h 54 index 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 -- 67 1.7.6.rc0 68 69