summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2016-02-18 16:25:27 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-02-19 16:39:10 +0100
commitea5df55429073dae8efc4d436db8f2890e051ecd (patch)
treeeab21aabaa9ee1340fb2fdf998c487dd2804dea2
parent1872f160ddb77f310e946e66ed0ef75c27c2075c (diff)
downloadOSELAS.Toolchain-ea5df55429073dae8efc4d436db8f2890e051ecd.tar.gz
gcc-4.7.2: add fix when building with newer host tools
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--patches/gcc-4.7.2/0052-ira_allocno_object_iter_cond-Avoid-out-of-bound-arra.patch36
-rw-r--r--patches/gcc-4.7.2/0103-cfns-fix-mismatch-in-gnu_inline-attributes.patch64
-rw-r--r--patches/gcc-4.7.2/series4
3 files changed, 103 insertions, 1 deletions
diff --git a/patches/gcc-4.7.2/0052-ira_allocno_object_iter_cond-Avoid-out-of-bound-arra.patch b/patches/gcc-4.7.2/0052-ira_allocno_object_iter_cond-Avoid-out-of-bound-arra.patch
new file mode 100644
index 0000000..87c0df6
--- /dev/null
+++ b/patches/gcc-4.7.2/0052-ira_allocno_object_iter_cond-Avoid-out-of-bound-arra.patch
@@ -0,0 +1,36 @@
+From: rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 19 Apr 2012 12:44:07 +0000
+Subject: [PATCH] ira_allocno_object_iter_cond: Avoid out-of-bound array
+ access.
+
+ 2012-04-19 Richard Guenther <rguenther@suse.de>
+
+ * ira-int.h (ira_allocno_object_iter_cond): Avoid out-of-bound
+ array access.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186590 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/ira-int.h | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/ira-int.h b/gcc/ira-int.h
+index 9faabb5..771a368 100644
+--- a/gcc/ira-int.h
++++ b/gcc/ira-int.h
+@@ -1138,8 +1138,13 @@ static inline bool
+ ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a,
+ ira_object_t *o)
+ {
+- *o = ALLOCNO_OBJECT (a, i->n);
+- return i->n++ < ALLOCNO_NUM_OBJECTS (a);
++ int n = i->n++;
++ if (n < ALLOCNO_NUM_OBJECTS (a))
++ {
++ *o = ALLOCNO_OBJECT (a, n);
++ return true;
++ }
++ return false;
+ }
+
+ /* Loop over all objects associated with allocno A. In each
diff --git a/patches/gcc-4.7.2/0103-cfns-fix-mismatch-in-gnu_inline-attributes.patch b/patches/gcc-4.7.2/0103-cfns-fix-mismatch-in-gnu_inline-attributes.patch
new file mode 100644
index 0000000..d4a1fb2
--- /dev/null
+++ b/patches/gcc-4.7.2/0103-cfns-fix-mismatch-in-gnu_inline-attributes.patch
@@ -0,0 +1,64 @@
+From: unknown author <unknown.author@example.com>
+Date: Thu, 6 Aug 2015 23:47:06 -0400
+Subject: [PATCH] cfns: fix mismatch in gnu_inline attributes
+
+Since the 3.0.3 release of gperf (made in May 2007), the generated func
+has had the gnu_inline attribute applied to it. The gcc source however
+has not been updated to include that which has lead to a mismatch.
+
+In practice, this hasn't been an issue for two reasons:
+(1) Before gcc-5, the default standard was (gnu) C89, and gcc does not
+warn or throw an error in this mode.
+(2) Starting with gcc-4.8, the compiler driver used to build gcc was
+changed to C++, and g++ does not warn or throw an error in this mode.
+
+This error does show up though when using gcc-5 to build gcc-4.7 or
+older as then the default is (gnu) C11 and the C compiler driver is
+used. That failure looks like:
+In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0:
+cfns.gperf: At top level:
+cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p'
+cfns.gperf:26:14: error: but not here
+
+Whether the compiler should always emit this error regardless of the
+active standard or compiler driver is debatable (I think it should be
+consistent -- either always do it or never do it).
+
+2015-08-06 Mike Frysinger <vapier@gentoo.org>
+
+ * cfns.gperf [__GNUC__, __GNUC_STDC_INLINE__]: Apply the
+ __gnu_inline__ attribute.
+ * cfns.h: Regenerated.
+---
+ gcc/cp/cfns.gperf | 3 +++
+ gcc/cp/cfns.h | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
+index ef1ed08..ba0c487 100644
+--- a/gcc/cp/cfns.gperf
++++ b/gcc/cp/cfns.gperf
+@@ -22,6 +22,9 @@ __inline
+ static unsigned int hash (const char *, unsigned int);
+ #ifdef __GNUC__
+ __inline
++#ifdef __GNUC_STDC_INLINE__
++__attribute__ ((__gnu_inline__))
++#endif
+ #endif
+ const char * libc_name_p (const char *, unsigned int);
+ %}
+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
+index 62cdfab..2fb9b46 100644
+--- a/gcc/cp/cfns.h
++++ b/gcc/cp/cfns.h
+@@ -53,6 +53,9 @@ __inline
+ static unsigned int hash (const char *, unsigned int);
+ #ifdef __GNUC__
+ __inline
++#ifdef __GNUC_STDC_INLINE__
++__attribute__ ((__gnu_inline__))
++#endif
+ #endif
+ const char * libc_name_p (const char *, unsigned int);
+ /* maximum key range = 391, duplicates = 0 */
diff --git a/patches/gcc-4.7.2/series b/patches/gcc-4.7.2/series
index 7951514..be21fb1 100644
--- a/patches/gcc-4.7.2/series
+++ b/patches/gcc-4.7.2/series
@@ -3,10 +3,12 @@
#tag:Upstream --start-number 050
0050-Backport-PR-target-55981-from-mainline.patch
0051-Backport-PR-target-56028-from-mainline.patch
+0052-ira_allocno_object_iter_cond-Avoid-out-of-bound-arra.patch
#tag:OSELAS.toolchain --start-number 100
0100-no-host-includes.patch
0101-gcc-i386-use-pure64-CLFS-patch.patch
0102-libgcc-reorder-tmake_file-for-arm-uclinux.patch
+0103-cfns-fix-mismatch-in-gnu_inline-attributes.patch
#tag:uclibc --start-number 200
0200-also-match-uclibc-when-checking-host-os.patch
0201-missing-execinfo.h.patch
@@ -21,4 +23,4 @@
0500-Fix-Argument-list-too-long-error.patch
#tag:Linaro --start-number 600
0600-Backport-the-change-to-the-hard-float-loader-path.-C.patch
-# ea3731c90748fd21a473c04e08e5f9f3 - git-ptx-patches magic
+# fb66b3b840ce25d370972759d68059b0 - git-ptx-patches magic