go: fix build of 1.0.3
This commit is contained in:
parent
ba2a7d4755
commit
aa0179744a
19
pkgs/development/compilers/go/1_0-gcc-bug.patch
Normal file
19
pkgs/development/compilers/go/1_0-gcc-bug.patch
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
http://code.google.com/p/go/source/detail?r=8b13b2ec6b18
|
||||||
|
--- a/src/cmd/cgo/gcc.go 2014-07-02 12:00:12.171796197 +0200
|
||||||
|
+++ b/src/cmd/cgo/gcc.go 2014-07-02 12:01:57.844472754 +0200
|
||||||
|
@@ -840,6 +840,15 @@
|
||||||
|
func (p *Package) gccErrors(stdin []byte) string {
|
||||||
|
// TODO(rsc): require failure
|
||||||
|
args := p.gccCmd()
|
||||||
|
+
|
||||||
|
+ // GCC 4.8.0 has a bug: it sometimes does not apply
|
||||||
|
+ // -Wunused-value to values that are macros defined in system
|
||||||
|
+ // headers. See issue 5118. Adding -Wsystem-headers avoids
|
||||||
|
+ // that problem. This will produce additional errors, but it
|
||||||
|
+ // doesn't matter because we will ignore all errors that are
|
||||||
|
+ // not marked for the cgo-test file.
|
||||||
|
+ args = append(args, "-Wsystem-headers")
|
||||||
|
+
|
||||||
|
if *debugGcc {
|
||||||
|
fmt.Fprintf(os.Stderr, "$ %s <<EOF\n", strings.Join(args, " "))
|
||||||
|
os.Stderr.Write(stdin)
|
12
pkgs/development/compilers/go/1_0-opt-error.patch
Normal file
12
pkgs/development/compilers/go/1_0-opt-error.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
https://code.google.com/p/go-wiki/wiki/OlderVersions
|
||||||
|
--- a/src/cmd/cc/funct.c 2014-07-02 11:54:42.230663598 +0200
|
||||||
|
+++ b/src/cmd/cc/funct.c 2014-07-02 11:55:01.653790128 +0200
|
||||||
|
@@ -269,7 +269,7 @@
|
||||||
|
goto bad;
|
||||||
|
|
||||||
|
f = alloc(sizeof(*f));
|
||||||
|
- for(o=0; o<sizeof(f->sym); o++)
|
||||||
|
+ for(o=0; o<nelem(f->sym); o++)
|
||||||
|
f->sym[o] = S;
|
||||||
|
|
||||||
|
t->funct = f;
|
@ -51,7 +51,7 @@ stdenv.mkDerivation {
|
|||||||
sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
|
sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
|
||||||
'';
|
'';
|
||||||
|
|
||||||
patches = [ ./cacert.patch ];
|
patches = [ ./cacert.patch ./1_0-opt-error.patch ./1_0-gcc-bug.patch ];
|
||||||
|
|
||||||
GOOS = "linux";
|
GOOS = "linux";
|
||||||
GOARCH = if stdenv.system == "i686-linux" then "386"
|
GOARCH = if stdenv.system == "i686-linux" then "386"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user