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 gcc-4.8/gcc/config/linux.h | 2 +- 26 2 files changed, 2 insertions(+), 2 deletions(-) 27 28 diff --git a/gcc-4.6/gcc/config/linux.h b/gcc-4.6/gcc/config/linux.h 29 index 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 41 diff --git a/gcc-4.8/gcc/config/linux.h b/gcc-4.8/gcc/config/linux.h 42 index 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 -- 55 1.7.6.rc0 56 57