aboutsummaryrefslogtreecommitdiff
path: root/build/tools/toolchain-patches/gcc
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-10-16 18:55:49 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2014-10-16 19:05:28 +0800
commit908851b0057493b16ddc6eb317a64ff9fce3d3f9 (patch)
tree3f22d2ae221704b2a7c314d82d2f6fea0451dc1f /build/tools/toolchain-patches/gcc
parent21de99500fb92afde05ccf7a6ad19df958cdcd78 (diff)
downloadndk-908851b0057493b16ddc6eb317a64ff9fce3d3f9.tar.gz
Update GCC NDK local patches
All patches shoule be pushed to aosp/toolchain/gcc. Put it here to document what's absent from aosp/toolchain/gcc for the GCC toolchain in coming r10c Change-Id: Iff025a58b4f950fe75e19677fa09d8163cee8de7
Diffstat (limited to 'build/tools/toolchain-patches/gcc')
-rw-r--r--build/tools/toolchain-patches/gcc/0004-Rename-libstdc++.so-to-libgnustl_shared.so.patch4
-rw-r--r--build/tools/toolchain-patches/gcc/0005-Simplify-gcc-BASE-VER-to-make-clang-easier-to-find-l.patch20
-rw-r--r--build/tools/toolchain-patches/gcc/0010-Fix-PR-target-63209.patch102
-rw-r--r--build/tools/toolchain-patches/gcc/0011-Enable-ifunc-for-bionic.patch26
-rw-r--r--build/tools/toolchain-patches/gcc/0012-Don-t-define-__fp16-for-clang.patch57
-rw-r--r--build/tools/toolchain-patches/gcc/0013-Fix-GCC4.9-segfaults-with-fauto-profile-and-Os.patch43
6 files changed, 250 insertions, 2 deletions
diff --git a/build/tools/toolchain-patches/gcc/0004-Rename-libstdc++.so-to-libgnustl_shared.so.patch b/build/tools/toolchain-patches/gcc/0004-Rename-libstdc++.so-to-libgnustl_shared.so.patch
index 411a330cb..25314de74 100644
--- a/build/tools/toolchain-patches/gcc/0004-Rename-libstdc++.so-to-libgnustl_shared.so.patch
+++ b/build/tools/toolchain-patches/gcc/0004-Rename-libstdc++.so-to-libgnustl_shared.so.patch
@@ -63,7 +63,7 @@ diff --git a/gcc-4.9/libstdc++-v3/src/Makefile.in b/gcc-4.9/libstdc++-v3/src/Mak
index cd3943b..ec04005 100644
--- a/gcc-4.9/libstdc++-v3/src/Makefile.in
+++ b/gcc-4.9/libstdc++-v3/src/Makefile.in
-@@ -342,7 +342,7 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
+@@ -343,7 +343,7 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
SUBDIRS = c++98 c++11
# Cross compiler support.
@@ -72,7 +72,7 @@ index cd3943b..ec04005 100644
@GLIBCXX_LDBL_COMPAT_FALSE@ldbl_compat_sources =
@GLIBCXX_LDBL_COMPAT_TRUE@ldbl_compat_sources = compatibility-ldbl.cc
parallel_compat_sources = \
-@@ -552,6 +552,9 @@ clean-toolexeclibLTLIBRARIES:
+@@ -554,6 +554,9 @@ clean-toolexeclibLTLIBRARIES:
libstdc++.la: $(libstdc___la_OBJECTS) $(libstdc___la_DEPENDENCIES)
$(libstdc___la_LINK) -rpath $(toolexeclibdir) $(libstdc___la_OBJECTS) $(libstdc___la_LIBADD) $(LIBS)
diff --git a/build/tools/toolchain-patches/gcc/0005-Simplify-gcc-BASE-VER-to-make-clang-easier-to-find-l.patch b/build/tools/toolchain-patches/gcc/0005-Simplify-gcc-BASE-VER-to-make-clang-easier-to-find-l.patch
new file mode 100644
index 000000000..55861c2b0
--- /dev/null
+++ b/build/tools/toolchain-patches/gcc/0005-Simplify-gcc-BASE-VER-to-make-clang-easier-to-find-l.patch
@@ -0,0 +1,20 @@
+From fbb61793b1ea06b4061f1e45007b96a0e1c2717c Mon Sep 17 00:00:00 2001
+From: Andrew Hsieh <andrewhsieh@google.com>
+Date: Tue, 22 Jul 2014 15:24:53 +0800
+Subject: [PATCH] Simplify gcc BASE-VER to make clang easier to find ld/as/libs
+
+Change-Id: Iebb74b6cd2b276bd9865ac980bf8cdcdecdb88ea
+---
+ gcc-4.9/gcc/BASE-VER | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc-4.9/gcc/BASE-VER b/gcc-4.9/gcc/BASE-VER
+index d81d21c..86a9588 100644
+--- a/gcc-4.9/gcc/BASE-VER
++++ b/gcc-4.9/gcc/BASE-VER
+@@ -1 +1 @@
+-4.9.x-google
++4.9
+--
+2.0.0.526.g5318336
+
diff --git a/build/tools/toolchain-patches/gcc/0010-Fix-PR-target-63209.patch b/build/tools/toolchain-patches/gcc/0010-Fix-PR-target-63209.patch
new file mode 100644
index 000000000..3aadd7836
--- /dev/null
+++ b/build/tools/toolchain-patches/gcc/0010-Fix-PR-target-63209.patch
@@ -0,0 +1,102 @@
+From 97f802983fe49576b40c3505d80ac3f8131b34b3 Mon Sep 17 00:00:00 2001
+From: davidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 8 Oct 2014 15:08:53 +0800
+Subject: [PATCH] Fix PR target/63209
+
+Change-Id: I1ff0bdad04222c41e3486121c5580808c364d3b1
+---
+ gcc-4.9/gcc/ChangeLog | 7 ++++++
+ gcc-4.9/gcc/config/arm/arm.md | 10 ++++++--
+ gcc-4.9/gcc/testsuite/ChangeLog | 6 +++++
+ .../gcc/testsuite/gcc.c-torture/execute/pr63209.c | 27 ++++++++++++++++++++++
+ 4 files changed, 48 insertions(+), 2 deletions(-)
+ create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr63209.c
+
+diff --git a/gcc-4.9/gcc/ChangeLog b/gcc-4.9/gcc/ChangeLog
+index 473fceb..1d9248b 100644
+--- a/gcc-4.9/gcc/ChangeLog
++++ b/gcc-4.9/gcc/ChangeLog
+@@ -1,3 +1,10 @@
++2014-09-10 Xinliang David Li <davidxl@google.com>
++
++ Backport from mainline
++ PR target/63209
++ * config/arm/arm.md (movcond_addsi): Handle case where source
++ and target operands are the same.
++
+ 2014-08-27 Guozhi Wei <carrot@google.com>
+
+ PR target/62262
+diff --git a/gcc-4.9/gcc/config/arm/arm.md b/gcc-4.9/gcc/config/arm/arm.md
+index 467f9ce..13c9b37 100644
+--- a/gcc-4.9/gcc/config/arm/arm.md
++++ b/gcc-4.9/gcc/config/arm/arm.md
+@@ -10944,10 +10944,16 @@
+ enum machine_mode mode = SELECT_CC_MODE (GET_CODE (operands[5]),
+ operands[3], operands[4]);
+ enum rtx_code rc = GET_CODE (operands[5]);
+-
+ operands[6] = gen_rtx_REG (mode, CC_REGNUM);
+ gcc_assert (!(mode == CCFPmode || mode == CCFPEmode));
+- rc = reverse_condition (rc);
++ if (REGNO (operands[2]) != REGNO (operands[0]))
++ rc = reverse_condition (rc);
++ else
++ {
++ rtx tmp = operands[1];
++ operands[1] = operands[2];
++ operands[2] = tmp;
++ }
+
+ operands[6] = gen_rtx_fmt_ee (rc, VOIDmode, operands[6], const0_rtx);
+ }
+diff --git a/gcc-4.9/gcc/testsuite/ChangeLog b/gcc-4.9/gcc/testsuite/ChangeLog
+index 51626c3..1a04681 100644
+--- a/gcc-4.9/gcc/testsuite/ChangeLog
++++ b/gcc-4.9/gcc/testsuite/ChangeLog
+@@ -1,3 +1,9 @@
+++2014-09-10 Xinliang David Li <davidxl@google.com>
++
++ Backport from mainline
++ PR target/63209
++ * gcc.c-torture/execute/pr63209.c: New test.
++
+ 2014-09-04 Guozhi Wei <carrot@google.com>
+
+ PR target/62040
+diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr63209.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr63209.c
+new file mode 100644
+index 0000000..9bcb587
+--- /dev/null
++++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr63209.c
+@@ -0,0 +1,27 @@
++static int Sub(int a, int b) {
++ return b -a;
++}
++
++static unsigned Select(unsigned a, unsigned b, unsigned c) {
++ const int pa_minus_pb =
++ Sub((a >> 8) & 0xff, (b >> 8) & 0xff) +
++ Sub((a >> 0) & 0xff, (b >> 0) & 0xff);
++ return (pa_minus_pb <= 0) ? a : b;
++}
++
++__attribute__((noinline)) unsigned Predictor(unsigned left, const unsigned* const top) {
++ const unsigned pred = Select(top[1], left, top[0]);
++ return pred;
++}
++
++int main(void) {
++ const unsigned top[2] = {0xff7a7a7a, 0xff7a7a7a};
++ const unsigned left = 0xff7b7b7b;
++ const unsigned pred = Predictor(left, top /*+ 1*/);
++ if (pred == left)
++ return 0;
++ return 1;
++}
++
++
++
+--
+2.1.0.rc2.206.gedb03e5
+
diff --git a/build/tools/toolchain-patches/gcc/0011-Enable-ifunc-for-bionic.patch b/build/tools/toolchain-patches/gcc/0011-Enable-ifunc-for-bionic.patch
new file mode 100644
index 000000000..62996bc23
--- /dev/null
+++ b/build/tools/toolchain-patches/gcc/0011-Enable-ifunc-for-bionic.patch
@@ -0,0 +1,26 @@
+From 6be63d84382212d54396d5420021b673056b6cd1 Mon Sep 17 00:00:00 2001
+From: Andrew Hsieh <andrewhsieh@google.com>
+Date: Tue, 22 Jul 2014 12:19:10 +0800
+Subject: [PATCH 1/2] Enable ifunc for bionic
+
+Change-Id: I35d41e06fd683f14f81a887de6461f31f3ebf35e
+---
+ gcc-4.9/gcc/config/linux.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc-4.9/gcc/config/linux.c b/gcc-4.9/gcc/config/linux.c
+index 6162675..1a5ec63 100644
+--- a/gcc-4.9/gcc/config/linux.c
++++ b/gcc-4.9/gcc/config/linux.c
+@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see
+ bool
+ linux_has_ifunc_p (void)
+ {
+- return OPTION_BIONIC ? false : HAVE_GNU_INDIRECT_FUNCTION;
++ return HAVE_GNU_INDIRECT_FUNCTION;
+ }
+
+ bool
+--
+2.0.0.526.g5318336
+
diff --git a/build/tools/toolchain-patches/gcc/0012-Don-t-define-__fp16-for-clang.patch b/build/tools/toolchain-patches/gcc/0012-Don-t-define-__fp16-for-clang.patch
new file mode 100644
index 000000000..0cf541e05
--- /dev/null
+++ b/build/tools/toolchain-patches/gcc/0012-Don-t-define-__fp16-for-clang.patch
@@ -0,0 +1,57 @@
+From c0ab21746a436d57b0d8a819319e2b4785b08d74 Mon Sep 17 00:00:00 2001
+From: Andrew Hsieh <andrewhsieh@google.com>
+Date: Tue, 22 Jul 2014 12:20:01 +0800
+Subject: [PATCH 2/2] Don't define __fp16 for clang
+
+Change-Id: Ie0131eb5d2158d678d82aaf3e46f78bf8fdd1c7a
+---
+ gcc-4.6/gcc/config/i386/arm_neon.h | 2 ++
+ gcc-4.8/gcc/config/i386/arm_neon.h | 2 ++
+ gcc-4.9/gcc/config/i386/arm_neon.h | 2 ++
+ 3 files changed, 6 insertions(+)
+
+diff --git a/gcc-4.6/gcc/config/i386/arm_neon.h b/gcc-4.6/gcc/config/i386/arm_neon.h
+index 5f56cbd..873b7d6 100644
+--- a/gcc-4.6/gcc/config/i386/arm_neon.h
++++ b/gcc-4.6/gcc/config/i386/arm_neon.h
+@@ -159,7 +159,9 @@ typedef unsigned long long uint64_t;
+ #endif
+
+ typedef float float32_t;
++#if !defined(__clang__)
+ typedef float __fp16;
++#endif
+
+ typedef uint8_t poly8_t;
+ typedef uint16_t poly16_t;
+diff --git a/gcc-4.8/gcc/config/i386/arm_neon.h b/gcc-4.8/gcc/config/i386/arm_neon.h
+index 5f56cbd..873b7d6 100644
+--- a/gcc-4.8/gcc/config/i386/arm_neon.h
++++ b/gcc-4.8/gcc/config/i386/arm_neon.h
+@@ -159,7 +159,9 @@ typedef unsigned long long uint64_t;
+ #endif
+
+ typedef float float32_t;
++#if !defined(__clang__)
+ typedef float __fp16;
++#endif
+
+ typedef uint8_t poly8_t;
+ typedef uint16_t poly16_t;
+diff --git a/gcc-4.9/gcc/config/i386/arm_neon.h b/gcc-4.9/gcc/config/i386/arm_neon.h
+index 5f56cbd..873b7d6 100644
+--- a/gcc-4.9/gcc/config/i386/arm_neon.h
++++ b/gcc-4.9/gcc/config/i386/arm_neon.h
+@@ -159,7 +159,9 @@ typedef unsigned long long uint64_t;
+ #endif
+
+ typedef float float32_t;
++#if !defined(__clang__)
+ typedef float __fp16;
++#endif
+
+ typedef uint8_t poly8_t;
+ typedef uint16_t poly16_t;
+--
+2.0.0.526.g5318336
+
diff --git a/build/tools/toolchain-patches/gcc/0013-Fix-GCC4.9-segfaults-with-fauto-profile-and-Os.patch b/build/tools/toolchain-patches/gcc/0013-Fix-GCC4.9-segfaults-with-fauto-profile-and-Os.patch
new file mode 100644
index 000000000..7bbba037d
--- /dev/null
+++ b/build/tools/toolchain-patches/gcc/0013-Fix-GCC4.9-segfaults-with-fauto-profile-and-Os.patch
@@ -0,0 +1,43 @@
+From 6eb7414701d509174dd5e1b6966277463a820534 Mon Sep 17 00:00:00 2001
+From: Dehao Chen <dehao@google.com>
+Date: Thu, 16 Oct 2014 16:23:00 +0800
+Subject: [PATCH] Fix GCC4.9 segfaults with -fauto-profile and -Os
+
+BUG=17997360
+
+Change-Id: I0ccae39cb1399e6f058d524141ede990d2645927
+---
+ gcc-4.9/gcc/auto-profile.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/gcc-4.9/gcc/auto-profile.c b/gcc-4.9/gcc/auto-profile.c
+index 11c2016..c69c1e6 100644
+--- a/gcc-4.9/gcc/auto-profile.c
++++ b/gcc-4.9/gcc/auto-profile.c
+@@ -1674,7 +1674,14 @@ afdo_annotate_cfg (const stmt_set &promoted_stmts)
+ counts_to_freqs ();
+ }
+ if (flag_value_profile_transformations)
+- gimple_value_profile_transformations ();
++ {
++ gimple_value_profile_transformations ();
++ free_dominance_info (CDI_DOMINATORS);
++ free_dominance_info (CDI_POST_DOMINATORS);
++ calculate_dominance_info (CDI_POST_DOMINATORS);
++ calculate_dominance_info (CDI_DOMINATORS);
++ update_ssa (TODO_update_ssa);
++ }
+ }
+
+ /* Wrapper function to invoke early inliner. */
+@@ -1756,7 +1763,6 @@ auto_profile (void)
+ early_inline ();
+ autofdo::afdo_annotate_cfg (promoted_stmts);
+ compute_function_frequency ();
+- update_ssa (TODO_update_ssa);
+
+ /* Local pure-const may imply need to fixup the cfg. */
+ if (execute_fixup_cfg () & TODO_cleanup_cfg)
+--
+2.1.0.rc2.206.gedb03e5
+