diff options
| author | Joshua Lock <joshua.g.lock@intel.com> | 2017-06-07 14:46:21 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-29 16:50:52 +0100 |
| commit | 5f7d84821f7c53ce2250861c5e08da9eac928993 (patch) | |
| tree | 81b208155c0c71273fe7337ea4d1775e6da69149 /meta | |
| parent | 1188ce3e3fb6f70d9d5536e4d0e4a6ced651d8f0 (diff) | |
| download | poky-5f7d84821f7c53ce2250861c5e08da9eac928993.tar.gz | |
gcc-6.2: backport fix of check for empty string in ubsan.c
Building gcc-cross-initial with GCC7 on the host fails due to the
comparison of a pointer to an integer in ubsan_use_new_style_p, which
is forbidden by ISO C++:
ubsan.c:1474:23: error: ISO C++ forbids comparison between pointer and
integer [-fpermissive]
|| xloc.file == '\0' || xloc.file[0] == '\xff'
Backport the fix from upstream GCC to enable the build with GCC 7
(From OE-Core rev: 7a7fcbab0365b9501c737dbc02715be14dda72a3)
(From OE-Core rev: ad685600d52b2e8b6f4cdbf46baa9f14b51565dd)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Cody P Schafer <dev@codyps.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-6.2.inc | 5 | ||||
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch | 28 |
2 files changed, 31 insertions, 2 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-6.2.inc b/meta/recipes-devtools/gcc/gcc-6.2.inc index b118995e1d..39ae653805 100644 --- a/meta/recipes-devtools/gcc/gcc-6.2.inc +++ b/meta/recipes-devtools/gcc/gcc-6.2.inc | |||
| @@ -80,8 +80,9 @@ SRC_URI = "\ | |||
| 80 | file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \ | 80 | file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \ |
| 81 | ${BACKPORTS} \ | 81 | ${BACKPORTS} \ |
| 82 | " | 82 | " |
| 83 | BACKPORTS = "" | 83 | BACKPORTS = "\ |
| 84 | 84 | file://ubsan-fix-check-empty-string.patch \ | |
| 85 | " | ||
| 85 | SRC_URI[md5sum] = "9768625159663b300ae4de2f4745fcc4" | 86 | SRC_URI[md5sum] = "9768625159663b300ae4de2f4745fcc4" |
| 86 | SRC_URI[sha256sum] = "9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5" | 87 | SRC_URI[sha256sum] = "9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5" |
| 87 | 88 | ||
diff --git a/meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch b/meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch new file mode 100644 index 0000000000..c0127198e0 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | From 8db2cf6353c13f2a84cbe49b689654897906c499 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
| 3 | Date: Sat, 3 Sep 2016 10:57:05 +0000 | ||
| 4 | Subject: [PATCH] gcc/ * ubsan.c (ubsan_use_new_style_p): Fix check for empty | ||
| 5 | string. | ||
| 6 | |||
| 7 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239971 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
| 8 | |||
| 9 | Upstream-Status: Backport | ||
| 10 | Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> | ||
| 11 | |||
| 12 | --- | ||
| 13 | gcc/ubsan.c | 2 +- | ||
| 14 | 2 files changed, 5 insertions(+), 1 deletion(-) | ||
| 15 | |||
| 16 | Index: gcc-6.3.0/gcc/ubsan.c | ||
| 17 | =================================================================== | ||
| 18 | --- gcc-6.3.0.orig/gcc/ubsan.c | ||
| 19 | +++ gcc-6.3.0/gcc/ubsan.c | ||
| 20 | @@ -1471,7 +1471,7 @@ ubsan_use_new_style_p (location_t loc) | ||
| 21 | |||
| 22 | expanded_location xloc = expand_location (loc); | ||
| 23 | if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0 | ||
| 24 | - || xloc.file == '\0' || xloc.file[0] == '\xff' | ||
| 25 | + || xloc.file[0] == '\0' || xloc.file[0] == '\xff' | ||
| 26 | || xloc.file[1] == '\xff') | ||
| 27 | return false; | ||
| 28 | |||
