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

Bug 465046

Summary: =dev-lang/go-1.0.3 fails to compile with gcc-4.8
Product: Gentoo Linux Reporter: Francisco J. Vazquez <dv>
Component: [OLD] DevelopmentAssignee: William Hubbs <williamh>
Status: RESOLVED FIXED    
Severity: normal CC: const
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 461954    
Attachments: patch to compile go-1.0.3 with gcc-4.8
Better patch.

Description Francisco J. Vazquez 2013-04-08 08:21:57 UTC
Compiling go with gcc-4.8 fails with:

cmd/cc
/var/tmp/portage/dev-lang/go-1.0.3/work/go/src/cmd/cc/funct.c: In function 'dclfunct':
/var/tmp/portage/dev-lang/go-1.0.3/work/go/src/cmd/cc/funct.c:273:13: error: iteration 94u invokes undefined behavior [-Werror=aggressive-loop-optimizations]
   f->sym[o] = S;
             ^
/var/tmp/portage/dev-lang/go-1.0.3/work/go/src/cmd/cc/funct.c:272:2: note: containing loop
  for(o=0; o<sizeof(f->sym); o++)
  ^
cc1: all warnings being treated as errors

Trivial patch:

--- src/cmd/dist/build.c.orig	2013-04-08 10:17:46.454167764 +0200
+++ src/cmd/dist/build.c	2013-04-08 10:16:59.797104639 +0200
@@ -380,6 +380,7 @@
 	"-Wall",
 	"-Wno-sign-compare",
 	"-Wno-missing-braces",
+	"-Wno-aggressive-loop-optimizations",
 	"-Wno-parentheses",
 	"-Wno-unknown-pragmas",
 	"-Wno-switch",

also attached in the next comment.

Reproducible: Always
Comment 1 Francisco J. Vazquez 2013-04-08 08:23:01 UTC
Created attachment 344798 [details, diff]
patch to compile go-1.0.3 with gcc-4.8
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2013-04-09 02:27:26 UTC
Created attachment 344906 [details, diff]
Better patch.
Comment 3 William Hubbs gentoo-dev 2013-04-16 06:35:51 UTC
The patch to remove -Werror was applied; this should be fixed.
Thanks for the report, and thanks, Ryan, for the patch. :-)