Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 618390

Summary: =sys-devel/gcc-6.3.0 (and older) fails to build with gcc-7.1.0: gcc/ubsan.c: error: ISO C++ forbids comparison between pointer and integer
Product: Gentoo Linux Reporter: Sergei Trofimovich (RETIRED) <slyfox>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: anarchy, herrtimson, robink, tamiko
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: gcc-6.3.0-ubsan-on-gcc-7.patch

Description Sergei Trofimovich (RETIRED) gentoo-dev 2017-05-13 20:41:50 UTC
Created attachment 472510 [details, diff]
gcc-6.3.0-ubsan-on-gcc-7.patch

I've caught it when updated my cross-compilers:

  /tmp/portage-tmpdir/portage/cross-hppa-unknown-linux-gnu/gcc-6.3.0/work/gcc-6.3.0/gcc/ubsan.c: In function ‘bool ubsan_use_new_style_p(location_t)’:
  /tmp/portage-tmpdir/portage/cross-hppa-unknown-linux-gnu/gcc-6.3.0/work/gcc-6.3.0/gcc/ubsan.c:1474:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
       || xloc.file == '\0' || xloc.file[0] == '\xff'
                       ^~~~

Attached upstream patch. It fixes building cross-compiler for me. Tested as:

--- a/sys-devel/gcc/gcc-6.3.0.ebuild
+++ b/sys-devel/gcc/gcc-6.3.0.ebuild
@@ -21,4 +21,5 @@ fi

 src_prepare() {
        toolchain_src_prepare
+       epatch "${FILESDIR}"/6.3.0/gcc-6.3.0-ubsan-on-gcc-7.patch
 }
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2017-08-13 09:24:04 UTC
gcc-6.4.0 backported this patch upstream.
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2017-12-09 21:30:05 UTC
tested with gcc-7.2:

gcc-5.4.0-r3 builds fine, gcc-6.3.0 is gone, gcc-6.4.0 is fixed upstream. 
So closing as fixed.

[As per instituting the policy that you should be able to go two major versions back, and thus ignoring gcc-4.9.]