All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] gcc: add upstream patch to fix build of GCC6 with GCC7
@ 2017-06-01  7:37 Jörg Krause
  2017-06-05 10:08 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Jörg Krause @ 2017-06-01  7:37 UTC (permalink / raw)
  To: buildroot

Building host-gcc-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'

Backported from:
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=239971

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 .../6.3.0/942-ubsan-fix-check-empty-string.patch   | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 package/gcc/6.3.0/942-ubsan-fix-check-empty-string.patch

diff --git a/package/gcc/6.3.0/942-ubsan-fix-check-empty-string.patch b/package/gcc/6.3.0/942-ubsan-fix-check-empty-string.patch
new file mode 100644
index 000000000..98e627053
--- /dev/null
+++ b/package/gcc/6.3.0/942-ubsan-fix-check-empty-string.patch
@@ -0,0 +1,40 @@
+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: Fix check for empty string
+
+Building host-gcc-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.
+
+Backported from:
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=239971
+
+Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
+[Add commit log from [1]]
+Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
+
+[1] https://patchwork.openembedded.org/patch/138884/
+---
+ 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

* [Buildroot] [PATCH] gcc: add upstream patch to fix build of GCC6 with GCC7
  2017-06-01  7:37 [Buildroot] [PATCH] gcc: add upstream patch to fix build of GCC6 with GCC7 Jörg Krause
@ 2017-06-05 10:08 ` Thomas Petazzoni
  2017-06-06 15:08   ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2017-06-05 10:08 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu,  1 Jun 2017 09:37:58 +0200, J?rg Krause wrote:
> Building host-gcc-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'
> 
> Backported from:
> https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=239971
> 
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> ---
>  .../6.3.0/942-ubsan-fix-check-empty-string.patch   | 40 ++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
>  create mode 100644 package/gcc/6.3.0/942-ubsan-fix-check-empty-string.patch

Applied to master, thanks. Peter: do we want this patch in the LTS
branch? We already had gcc 6.x available in the LTS branch, do we want
to make sure it builds properly for people using gcc 7.x as their host
compiler?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] gcc: add upstream patch to fix build of GCC6 with GCC7
  2017-06-05 10:08 ` Thomas Petazzoni
@ 2017-06-06 15:08   ` Peter Korsgaard
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2017-06-06 15:08 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Hello,
 > On Thu,  1 Jun 2017 09:37:58 +0200, J?rg Krause wrote:
 >> Building host-gcc-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'
 >> 
 >> Backported from:
 >> https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=239971
 >> 
 >> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
 >> ---
 >> .../6.3.0/942-ubsan-fix-check-empty-string.patch   | 40 ++++++++++++++++++++++
 >> 1 file changed, 40 insertions(+)
 >> create mode 100644 package/gcc/6.3.0/942-ubsan-fix-check-empty-string.patch

 > Applied to master, thanks. Peter: do we want this patch in the LTS
 > branch? We already had gcc 6.x available in the LTS branch, do we want
 > to make sure it builds properly for people using gcc 7.x as their host
 > compiler?

Yes, I believe so. Committed to 2017.02.x and 2017.05.x, thanks!

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-06 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-01  7:37 [Buildroot] [PATCH] gcc: add upstream patch to fix build of GCC6 with GCC7 Jörg Krause
2017-06-05 10:08 ` Thomas Petazzoni
2017-06-06 15:08   ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.