diff options
author | David 'Digit' Turner <digit@google.com> | 2012-05-09 17:56:30 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2012-05-09 17:56:30 +0200 |
commit | d7a05c21e24dd81c7dc62bf05fee71cc668c1552 (patch) | |
tree | 486c066507e9dbd8fe64a267e5adc49b0f95f8ee /build/tools/toolchain-patches/gcc | |
parent | b1da27bbf277add527f4e70ec9f572c80c46e999 (diff) | |
download | ndk-d7a05c21e24dd81c7dc62bf05fee71cc668c1552.tar.gz |
gcc-4.6: Disable sincos optimization.
This adds a local NDK-specific patch to GCC-4.6 to disable sincos
optimization. See patch commit-message for details.
This is required because legacy Android platforms don't implement
sincos() in their libm.so
Change-Id: I89f3d45e53019bd79067f8edc22544a8c8695606
Diffstat (limited to 'build/tools/toolchain-patches/gcc')
-rw-r--r-- | build/tools/toolchain-patches/gcc/0001-gcc-4.6-Disable-sincos-optimization.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/build/tools/toolchain-patches/gcc/0001-gcc-4.6-Disable-sincos-optimization.patch b/build/tools/toolchain-patches/gcc/0001-gcc-4.6-Disable-sincos-optimization.patch new file mode 100644 index 000000000..fd56ad307 --- /dev/null +++ b/build/tools/toolchain-patches/gcc/0001-gcc-4.6-Disable-sincos-optimization.patch @@ -0,0 +1,39 @@ +From 504ba0176a97c9b849fd18c4591a2cfc8d5eb130 Mon Sep 17 00:00:00 2001 +From: David 'Digit' Turner <digit@google.com> +Date: Wed, 9 May 2012 17:53:13 +0200 +Subject: gcc-4.6: Disable sincos optimization + +Ensure that sincos optimization is disabled for NDK toolchain +builds. This ensures that NDK-generated code will always link +on legacy Android platforms that don't implement sincos() in +their /system/lib/libm.so. + +For the record, this optimization changes the following code: + + double c, s; + c = cos(angle); + s = sin(angle); + +Into machine code that does: + + double c, s; + sincos(angle, &s, &c); + +Change-Id: I332bf5788267dd56e93b8cdb0cefa04b970eca88 +--- + gcc-4.6/gcc/config/linux.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/gcc-4.6/gcc/config/linux.h b/gcc-4.6/gcc/config/linux.h +index a1711dc..8c9ec5f 100644 +--- a/gcc-4.6/gcc/config/linux.h ++++ b/gcc-4.6/gcc/config/linux.h +@@ -99,4 +99,4 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define TARGET_C99_FUNCTIONS (OPTION_GLIBC) + + /* Whether we have sincos that follows the GNU extension. */ +-#define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC) ++#define TARGET_HAS_SINCOS (OPTION_GLIBC) +-- +1.7.6.rc0 + |