Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 465046 - =dev-lang/go-1.0.3 fails to compile with gcc-4.8
Summary: =dev-lang/go-1.0.3 fails to compile with gcc-4.8
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: gcc-4.8
  Show dependency tree
 
Reported: 2013-04-08 08:21 UTC by Francisco J. Vazquez
Modified: 2013-12-23 13:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to compile go-1.0.3 with gcc-4.8 (go-1.0.3-gcc48.patch,311 bytes, patch)
2013-04-08 08:23 UTC, Francisco J. Vazquez
Details | Diff
Better patch. (go-1.0.3-no-Werror.patch,236 bytes, patch)
2013-04-09 02:27 UTC, Ryan Hill (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. :-)