* [morty][PATCH] gcc-6.2: backport fix of check for empty string in ubsan.c
@ 2017-06-07 18:46 Cody P Schafer
2017-06-07 19:11 ` Cody P Schafer
2017-06-07 19:12 ` Khem Raj
0 siblings, 2 replies; 3+ messages in thread
From: Cody P Schafer @ 2017-06-07 18:46 UTC (permalink / raw)
To: openembedded-core; +Cc: Joshua Lock
From: Joshua Lock <joshua.g.lock@intel.com>
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)
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>
---
meta/recipes-devtools/gcc/gcc-6.2.inc | 5 ++--
.../gcc/gcc-6.2/ubsan-fix-check-empty-string.patch | 28 ++++++++++++++++++++++
2 files changed, 31 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch
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 = "\
file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
${BACKPORTS} \
"
-BACKPORTS = ""
-
+BACKPORTS = "\
+ file://ubsan-fix-check-empty-string.patch \
+"
SRC_URI[md5sum] = "9768625159663b300ae4de2f4745fcc4"
SRC_URI[sha256sum] = "9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5"
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 @@
+From 8db2cf6353c13f2a84cbe49b689654897906c499 Mon Sep 17 00:00:00 2001
+From: kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat, 3 Sep 2016 10:57:05 +0000
+Subject: [PATCH] gcc/ * ubsan.c (ubsan_use_new_style_p): Fix check for empty
+ string.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239971 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
+
+---
+ gcc/ubsan.c | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+Index: gcc-6.3.0/gcc/ubsan.c
+===================================================================
+--- gcc-6.3.0.orig/gcc/ubsan.c
++++ gcc-6.3.0/gcc/ubsan.c
+@@ -1471,7 +1471,7 @@ ubsan_use_new_style_p (location_t loc)
+
+ expanded_location xloc = expand_location (loc);
+ if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0
+- || xloc.file == '\0' || xloc.file[0] == '\xff'
++ || xloc.file[0] == '\0' || xloc.file[0] == '\xff'
+ || xloc.file[1] == '\xff')
+ return false;
+
--
2.13.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [morty][PATCH] gcc-6.2: backport fix of check for empty string in ubsan.c
2017-06-07 18:46 [morty][PATCH] gcc-6.2: backport fix of check for empty string in ubsan.c Cody P Schafer
@ 2017-06-07 19:11 ` Cody P Schafer
2017-06-07 19:12 ` Khem Raj
1 sibling, 0 replies; 3+ messages in thread
From: Cody P Schafer @ 2017-06-07 19:11 UTC (permalink / raw)
To: OE-core; +Cc: Joshua Lock
On Wed, Jun 7, 2017 at 2:46 PM, Cody P Schafer <dev@codyps.com> wrote:
> From: Joshua Lock <joshua.g.lock@intel.com>
>
> 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++:
The patch to oe-core master was for gcc 6.3, I've modified it to apply
to gcc 6.2 (which is in morty).
We probably also need to backport the CVE patch, and examine the
6.2..6.3 log to see if there are any other critical patches. Or just
put gcc 6.3 into morty.
This at just gets gcc building for me again.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [morty][PATCH] gcc-6.2: backport fix of check for empty string in ubsan.c
2017-06-07 18:46 [morty][PATCH] gcc-6.2: backport fix of check for empty string in ubsan.c Cody P Schafer
2017-06-07 19:11 ` Cody P Schafer
@ 2017-06-07 19:12 ` Khem Raj
1 sibling, 0 replies; 3+ messages in thread
From: Khem Raj @ 2017-06-07 19:12 UTC (permalink / raw)
To: Cody P Schafer
Cc: Joshua Lock, Patches and discussions about the oe-core layer
On Wed, Jun 7, 2017 at 11:46 AM, Cody P Schafer <dev@codyps.com> wrote:
> From: Joshua Lock <joshua.g.lock@intel.com>
>
> 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
>
this is fine
> (From OE-Core rev: 7a7fcbab0365b9501c737dbc02715be14dda72a3)
>
> 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>
> ---
> meta/recipes-devtools/gcc/gcc-6.2.inc | 5 ++--
> .../gcc/gcc-6.2/ubsan-fix-check-empty-string.patch | 28 ++++++++++++++++++++++
> 2 files changed, 31 insertions(+), 2 deletions(-)
> create mode 100644 meta/recipes-devtools/gcc/gcc-6.2/ubsan-fix-check-empty-string.patch
>
> 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 = "\
> file://0047-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
> ${BACKPORTS} \
> "
> -BACKPORTS = ""
> -
> +BACKPORTS = "\
> + file://ubsan-fix-check-empty-string.patch \
> +"
> SRC_URI[md5sum] = "9768625159663b300ae4de2f4745fcc4"
> SRC_URI[sha256sum] = "9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5"
>
> 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 @@
> +From 8db2cf6353c13f2a84cbe49b689654897906c499 Mon Sep 17 00:00:00 2001
> +From: kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>
> +Date: Sat, 3 Sep 2016 10:57:05 +0000
> +Subject: [PATCH] gcc/ * ubsan.c (ubsan_use_new_style_p): Fix check for empty
> + string.
> +
> +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239971 138bc75d-0d04-0410-961f-82ee72b054a4
> +
> +Upstream-Status: Backport
> +Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> +
> +---
> + gcc/ubsan.c | 2 +-
> + 2 files changed, 5 insertions(+), 1 deletion(-)
> +
> +Index: gcc-6.3.0/gcc/ubsan.c
> +===================================================================
> +--- gcc-6.3.0.orig/gcc/ubsan.c
> ++++ gcc-6.3.0/gcc/ubsan.c
> +@@ -1471,7 +1471,7 @@ ubsan_use_new_style_p (location_t loc)
> +
> + expanded_location xloc = expand_location (loc);
> + if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0
> +- || xloc.file == '\0' || xloc.file[0] == '\xff'
> ++ || xloc.file[0] == '\0' || xloc.file[0] == '\xff'
> + || xloc.file[1] == '\xff')
> + return false;
> +
> --
> 2.13.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-07 19:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-07 18:46 [morty][PATCH] gcc-6.2: backport fix of check for empty string in ubsan.c Cody P Schafer
2017-06-07 19:11 ` Cody P Schafer
2017-06-07 19:12 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox