From 7dc03d11016e238efc432c9205dacddd1e929886 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 17 Jun 2015 09:16:23 +0000 Subject: [PATCH 01/25] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 33cff31..b16a518 100644 --- a/golang.spec +++ b/golang.spec @@ -40,7 +40,7 @@ Name: golang Version: 1.4.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Go Programming Language License: BSD @@ -739,6 +739,9 @@ fi %changelog +* Wed Jun 17 2015 Fedora Release Engineering - 1.4.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Wed Mar 18 2015 Vincent Batts - 1.4.2-2 - obsoleting deprecated packages From 8d165dfe1919054f25ec8a30aeafe489ece083be Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 16 Jul 2015 14:36:06 -0400 Subject: [PATCH 02/25] updating go1.5beta1 * updating existing patches * adding a couple of test patches needed for beta1 * TODO enable %check again * SO MUCH CLEANUP now that OS and ARCH bootstrapping is not needed --- .gitignore | 2 + go1.5beta1-disable-TestGdbPython.patch | 13 + go1.5beta1-fix-TestVendorRun.patch | 29 ++ golang-1.2-BSD-SVID-SOURCE.patch | 19 - golang-1.2-remove-ECC-p224.patch | 172 ------- golang-1.2-verbose-build.patch | 12 +- golang-1.5-bootstrap-binary-path.patch | 53 +++ golang.spec | 610 ++++++------------------- 8 files changed, 244 insertions(+), 666 deletions(-) create mode 100644 go1.5beta1-disable-TestGdbPython.patch create mode 100644 go1.5beta1-fix-TestVendorRun.patch delete mode 100644 golang-1.2-BSD-SVID-SOURCE.patch create mode 100644 golang-1.5-bootstrap-binary-path.patch diff --git a/.gitignore b/.gitignore index 415af81..4c2608c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.rpm /go1.1.1.src.tar.gz /go1.1.2.src.tar.gz /go1.2.1.src.tar.gz @@ -16,4 +17,5 @@ /go1.4beta1.src.tar.gz /go1.4rc1.src.tar.gz /go1.4rc2.src.tar.gz +/go1.5beta1.src.tar.gz /golang-19087:a15f344a9efa-xattrs.tar diff --git a/go1.5beta1-disable-TestGdbPython.patch b/go1.5beta1-disable-TestGdbPython.patch new file mode 100644 index 0000000..8e0491f --- /dev/null +++ b/go1.5beta1-disable-TestGdbPython.patch @@ -0,0 +1,13 @@ +diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go +index f4014b2..2c09441 100644 +--- a/src/runtime/runtime-gdb_test.go ++++ b/src/runtime/runtime-gdb_test.go +@@ -38,7 +38,7 @@ func main() { + } + ` + +-func TestGdbPython(t *testing.T) { ++func testGdbPython(t *testing.T) { + if runtime.GOOS == "darwin" { + t.Skip("gdb does not work on darwin") + } diff --git a/go1.5beta1-fix-TestVendorRun.patch b/go1.5beta1-fix-TestVendorRun.patch new file mode 100644 index 0000000..41f985d --- /dev/null +++ b/go1.5beta1-fix-TestVendorRun.patch @@ -0,0 +1,29 @@ +commit 9adf684686bad7c6319080d0b1da8308a77b08c9 +Author: Russ Cox +Date: Tue Jul 14 15:15:37 2015 -0400 + + cmd/go: fix TestVendorRun when $GOROOT is inside a symlinked path + + Fixes #11305. + + Change-Id: Icaa3a009aa4ab214c9aaf74f52c3e622fa266a9d + Reviewed-on: https://go-review.googlesource.com/12194 + Reviewed-by: David Crawshaw + Reviewed-by: Ian Lance Taylor + +diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go +index 98486c5..af54396 100644 +--- a/src/cmd/go/go_test.go ++++ b/src/cmd/go/go_test.go +@@ -188,7 +188,11 @@ func (tg *testgoData) cd(dir string) { + if tg.wd == "" { + tg.wd = tg.pwd() + } ++ abs, err := filepath.Abs(dir) + tg.must(os.Chdir(dir)) ++ if err == nil { ++ tg.setenv("PWD", abs) ++ } + } + + // sleep sleeps for one tick, where a tick is a conservative estimate diff --git a/golang-1.2-BSD-SVID-SOURCE.patch b/golang-1.2-BSD-SVID-SOURCE.patch deleted file mode 100644 index f4927b6..0000000 --- a/golang-1.2-BSD-SVID-SOURCE.patch +++ /dev/null @@ -1,19 +0,0 @@ -Index: go/include/u.h -=================================================================== ---- go.orig/include/u.h -+++ go/include/u.h -@@ -38,10 +38,13 @@ extern "C" { - # define __MAKECONTEXT_V2_SOURCE 1 - # endif - #endif -+#if defined __linux__ || defined __GNU__ || defined __GLIBC__ -+#define _DEFAULT_SOURCE 1 -+#else - #define _BSD_SOURCE 1 - #define _NETBSD_SOURCE 1 /* NetBSD */ --#define _DEFAULT_SOURCE 1 /* glibc > 2.19 */ - #define _SVID_SOURCE 1 -+#endif - #if !defined(__APPLE__) && !defined(__OpenBSD__) - # define _XOPEN_SOURCE 1000 - # define _XOPEN_SOURCE_EXTENDED 1 diff --git a/golang-1.2-remove-ECC-p224.patch b/golang-1.2-remove-ECC-p224.patch index ef5a4a6..e69de29 100644 --- a/golang-1.2-remove-ECC-p224.patch +++ b/golang-1.2-remove-ECC-p224.patch @@ -1,172 +0,0 @@ -Index: go/api/go1.txt -=================================================================== ---- go.orig/api/go1.txt -+++ go/api/go1.txt -@@ -412,7 +412,6 @@ pkg crypto/ecdsa, type PublicKey struct, - pkg crypto/ecdsa, type PublicKey struct, embedded elliptic.Curve - pkg crypto/elliptic, func GenerateKey(Curve, io.Reader) ([]uint8, *big.Int, *big.Int, error) - pkg crypto/elliptic, func Marshal(Curve, *big.Int, *big.Int) []uint8 --pkg crypto/elliptic, func P224() Curve - pkg crypto/elliptic, func P256() Curve - pkg crypto/elliptic, func P384() Curve - pkg crypto/elliptic, func P521() Curve -Index: go/src/crypto/ecdsa/ecdsa_test.go -=================================================================== ---- go.orig/src/crypto/ecdsa/ecdsa_test.go -+++ go/src/crypto/ecdsa/ecdsa_test.go -@@ -33,7 +33,6 @@ func testKeyGeneration(t *testing.T, c e - } - - func TestKeyGeneration(t *testing.T) { -- testKeyGeneration(t, elliptic.P224(), "p224") - if testing.Short() { - return - } -@@ -63,7 +62,6 @@ func testSignAndVerify(t *testing.T, c e - } - - func TestSignAndVerify(t *testing.T) { -- testSignAndVerify(t, elliptic.P224(), "p224") - if testing.Short() { - return - } -@@ -129,8 +127,6 @@ func TestVectors(t *testing.T) { - parts := strings.SplitN(line, ",", 2) - - switch parts[0] { -- case "P-224": -- pub.Curve = elliptic.P224() - case "P-256": - pub.Curve = elliptic.P256() - case "P-384": -Index: go/src/crypto/elliptic/bottombits.go -=================================================================== ---- /dev/null -+++ go/src/crypto/elliptic/bottombits.go -@@ -0,0 +1,14 @@ -+ -+// Copyright 2012 The Go Authors. All rights reserved. -+// Use of this source code is governed by a BSD-style -+// license that can be found in the LICENSE file. -+ -+package elliptic -+ -+const bottom12Bits = 0xfff -+const bottom28Bits = 0xfffffff -+ -+const two31p3 = 1<<31 + 1<<3 -+const two31m3 = 1<<31 - 1<<3 -+const two31m15m3 = 1<<31 - 1<<15 - 1<<3 -+ -Index: go/src/crypto/elliptic/elliptic.go -=================================================================== ---- go.orig/src/crypto/elliptic/elliptic.go -+++ go/src/crypto/elliptic/elliptic.go -@@ -326,7 +326,6 @@ var p384 *CurveParams - var p521 *CurveParams - - func initAll() { -- initP224() - initP256() - initP384() - initP521() -Index: go/src/crypto/elliptic/elliptic_test.go -=================================================================== ---- go.orig/src/crypto/elliptic/elliptic_test.go -+++ go/src/crypto/elliptic/elliptic_test.go -@@ -1,3 +1,5 @@ -+// +build ignore -+ - // Copyright 2010 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. -Index: go/src/crypto/elliptic/p224.go -=================================================================== ---- go.orig/src/crypto/elliptic/p224.go -+++ go/src/crypto/elliptic/p224.go -@@ -1,3 +1,5 @@ -+// +build ignore -+ - // Copyright 2012 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. -@@ -183,10 +185,6 @@ func p224Add(out, a, b *p224FieldElement - } - } - --const two31p3 = 1<<31 + 1<<3 --const two31m3 = 1<<31 - 1<<3 --const two31m15m3 = 1<<31 - 1<<15 - 1<<3 -- - // p224ZeroModP31 is 0 mod p where bit 31 is set in all limbs so that we can - // subtract smaller amounts without underflow. See the section "Subtraction" in - // [1] for reasoning. -@@ -215,9 +213,6 @@ const two63m35m19 = 1<<63 - 1<<35 - 1<<1 - // "Subtraction" in [1] for why. - var p224ZeroModP63 = [8]uint64{two63p35, two63m35, two63m35, two63m35, two63m35m19, two63m35, two63m35, two63m35} - --const bottom12Bits = 0xfff --const bottom28Bits = 0xfffffff -- - // p224Mul computes *out = a*b - // - // a[i] < 2**29, b[i] < 2**30 (or vice versa) -Index: go/src/crypto/elliptic/p224_test.go -=================================================================== ---- go.orig/src/crypto/elliptic/p224_test.go -+++ go/src/crypto/elliptic/p224_test.go -@@ -1,3 +1,5 @@ -+// +build ignore -+ - // Copyright 2012 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. -Index: go/src/crypto/x509/x509.go -=================================================================== ---- go.orig/src/crypto/x509/x509.go -+++ go/src/crypto/x509/x509.go -@@ -306,9 +306,6 @@ func getPublicKeyAlgorithmFromOID(oid as - - // RFC 5480, 2.1.1.1. Named Curve - // --// secp224r1 OBJECT IDENTIFIER ::= { --// iso(1) identified-organization(3) certicom(132) curve(0) 33 } --// - // secp256r1 OBJECT IDENTIFIER ::= { - // iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) - // prime(1) 7 } -@@ -321,7 +318,6 @@ func getPublicKeyAlgorithmFromOID(oid as - // - // NB: secp256r1 is equivalent to prime256v1 - var ( -- oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33} - oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7} - oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34} - oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35} -@@ -329,8 +325,6 @@ var ( - - func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { - switch { -- case oid.Equal(oidNamedCurveP224): -- return elliptic.P224() - case oid.Equal(oidNamedCurveP256): - return elliptic.P256() - case oid.Equal(oidNamedCurveP384): -@@ -343,8 +337,6 @@ func namedCurveFromOID(oid asn1.ObjectId - - func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) { - switch curve { -- case elliptic.P224(): -- return oidNamedCurveP224, true - case elliptic.P256(): - return oidNamedCurveP256, true - case elliptic.P384(): -@@ -1371,7 +1363,7 @@ func signingParamsForPrivateKey(priv int - pubType = ECDSA - - switch priv.Curve { -- case elliptic.P224(), elliptic.P256(): -+ case elliptic.P256(): - hashFunc = crypto.SHA256 - sigAlgo.Algorithm = oidSignatureECDSAWithSHA256 - case elliptic.P384(): diff --git a/golang-1.2-verbose-build.patch b/golang-1.2-verbose-build.patch index 1698d82..e9c5edf 100644 --- a/golang-1.2-verbose-build.patch +++ b/golang-1.2-verbose-build.patch @@ -2,18 +2,18 @@ Index: go/src/make.bash =================================================================== --- go.orig/src/make.bash +++ go/src/make.bash -@@ -161,12 +161,12 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH +@@ -153,12 +153,12 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however, # use the host compiler, CC, from `cmd/dist/dist env` instead. CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \ -- "$GOTOOLDIR"/go_bootstrap install -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std -+ "$GOTOOLDIR"/go_bootstrap install -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std +- "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd ++ "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std cmd echo fi - echo "# Building packages and commands for $GOOS/$GOARCH." --CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std -+CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std + echo "##### Building packages and commands for $GOOS/$GOARCH." +-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd ++CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std cmd echo rm -f "$GOTOOLDIR"/go_bootstrap diff --git a/golang-1.5-bootstrap-binary-path.patch b/golang-1.5-bootstrap-binary-path.patch new file mode 100644 index 0000000..8444727 --- /dev/null +++ b/golang-1.5-bootstrap-binary-path.patch @@ -0,0 +1,53 @@ +diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go +index be54ac4..6744fbdc 100644 +--- a/src/cmd/dist/buildtool.go ++++ b/src/cmd/dist/buildtool.go +@@ -108,12 +108,20 @@ func bootstrapBuildTools() { + os.Setenv("GOBIN", "") + + os.Setenv("GOOS", "") +- os.Setenv("GOHOSTOS", "") + os.Setenv("GOARCH", "") ++ ++ hostos := os.Getenv("GOHOSTOS") ++ hostarch := os.Getenv("GOHOSTARCH") ++ os.Setenv("GOHOSTOS", "") + os.Setenv("GOHOSTARCH", "") + ++ bingopath := pathf("%s/bin/%s_%s/go", goroot_bootstrap, hostos, hostarch) ++ if _, err := os.Stat(bingopath); os.IsNotExist(err) { ++ bingopath = pathf("%s/bin/go", goroot_bootstrap) ++ } ++ + // Run Go 1.4 to build binaries. +- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-v", "bootstrap/...") ++ run(workspace, ShowOutput|CheckExit, bingopath, "install", "-v", "bootstrap/...") + + // Copy binaries into tool binary directory. + for _, name := range bootstrapDirs { +diff --git a/src/make.bash b/src/make.bash +index f17648a..77f463c 100755 +--- a/src/make.bash ++++ b/src/make.bash +@@ -113,12 +113,17 @@ echo '##### Building Go bootstrap tool.' + echo cmd/dist + export GOROOT="$(cd .. && pwd)" + GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4} +-if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then +- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2 ++if [ -x "$GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go" ]; then ++ rm -f cmd/dist/dist ++ GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go" build -o cmd/dist/dist ./cmd/dist ++elif [ -x "$GOROOT_BOOTSTRAP/bin/go" ]; then ++ rm -f cmd/dist/dist ++ GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist ++else ++ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go." >&2 ++ echo "ERROR: or $GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go." >&2 + echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 + fi +-rm -f cmd/dist/dist +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist + + # -e doesn't propagate out of eval, so check success by hand. + eval $(./cmd/dist/dist env -p || echo FAIL=true) diff --git a/golang.spec b/golang.spec index b16a518..08fb4a3 100644 --- a/golang.spec +++ b/golang.spec @@ -36,38 +36,49 @@ %global gohostarch arm %endif -%global go_api 1.4 +%global go_api 1.5 +%global go_version 1.5beta1 Name: golang -Version: 1.4.2 -Release: 3%{?dist} +Version: 1.4.99 +Release: 1.%{go_version}%{?dist} Summary: The Go Programming Language License: BSD URL: http://golang.org/ -Source0: https://storage.googleapis.com/golang/go%{version}.src.tar.gz +Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz + +# go1.5 bootstrapping. The compiler is written in golang. +BuildRequires: golang > 1.4 +# use the arch dependent path in the bootstrap +Patch212: ./golang-1.5-bootstrap-binary-path.patch # this command moved places %if 0%{?fedora} >= 21 BuildRequires: /usr/bin/hostname Patch210: golang-f21-hostname.patch - -# Patch211 - F21+ has glibc 2.19.90 (2.20 devel)+ which deprecates -# _BSD_SOURCE and _SVID_SOURCE -Patch211: golang-1.2-BSD-SVID-SOURCE.patch %else BuildRequires: /bin/hostname %endif Provides: go = %{version}-%{release} -Requires: golang-bin -Requires: golang-src = %{version}-%{release} +Requires: %{name}-bin +Requires: %{name}-src = %{version}-%{release} Patch0: golang-1.2-verbose-build.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Patch1: golang-1.2-remove-ECC-p224.patch +# disable TestGdbPython +# https://github.com/golang/go/issues/11214 +Patch213: go1.5beta1-disable-TestGdbPython.patch + +# disable TestVendorRun and TestVendorGOPATH +# https://github.com/golang/go/commit/9adf684686bad7c6319080d0b1da8308a77b08c9 +Patch214: go1.5beta1-fix-TestVendorRun.patch + + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -99,6 +110,30 @@ Source102: macros.golang #%description data #%{summary}. +%package docs +Summary: Golang compiler docs +Requires: %{name} = %{version}-%{release} +BuildArch: noarch +Obsoletes: %{name}-docs < 1.1-4 + +%description docs +%{summary}. + +%package misc +Summary: Golang compiler miscellaneous sources +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description misc +%{summary}. + +%package tests +Summary: Golang compiler tests for stdlib +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description tests +%{summary}. ## # the source tree @@ -108,196 +143,43 @@ BuildArch: noarch %description src %{summary} -## -# This is the only architecture specific binary -%ifarch %{ix86} -%package pkg-bin-linux-386 -Summary: Golang compiler tool for linux 386 +%package bin +Summary: Golang core compiler tools Requires: go = %{version}-%{release} -Requires: golang-pkg-linux-386 = %{version}-%{release} -Requires(post): golang-pkg-linux-386 = %{version}-%{release} -Provides: golang-bin = 386 -Provides: go(API)(go) = %{go_api} +# Pre-go1.5, all arches had to be bootstrapped individually, before usable, and +# env variables to compile for the target os-arch. +# Now the host compiler needs only the GOOS and GOARCH environment variables +# set to compile for the target os-arch. +Obsoletes: %{name}-pkg-bin-linux-386 < 1.4.99 +Obsoletes: %{name}-pkg-bin-linux-amd64 < 1.4.99 +Obsoletes: %{name}-pkg-bin-linux-arm < 1.4.99 +Obsoletes: %{name}-pkg-linux-386 < 1.4.99 +Obsoletes: %{name}-pkg-linux-amd64 < 1.4.99 +Obsoletes: %{name}-pkg-linux-arm < 1.4.99 +Obsoletes: %{name}-pkg-darwin-386 < 1.4.99 +Obsoletes: %{name}-pkg-darwin-amd64 < 1.4.99 +Obsoletes: %{name}-pkg-windows-386 < 1.4.99 +Obsoletes: %{name}-pkg-windows-amd64 < 1.4.99 +Obsoletes: %{name}-pkg-plan9-386 < 1.4.99 +Obsoletes: %{name}-pkg-plan9-amd64 < 1.4.99 +Obsoletes: %{name}-pkg-freebsd-386 < 1.4.99 +Obsoletes: %{name}-pkg-freebsd-amd64 < 1.4.99 +Obsoletes: %{name}-pkg-freebsd-arm < 1.4.99 +Obsoletes: %{name}-pkg-netbsd-386 < 1.4.99 +Obsoletes: %{name}-pkg-netbsd-amd64 < 1.4.99 +Obsoletes: %{name}-pkg-netbsd-arm < 1.4.99 +Obsoletes: %{name}-pkg-openbsd-386 < 1.4.99 +Obsoletes: %{name}-pkg-openbsd-amd64 < 1.4.99 + +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives + # We strip the meta dependency, but go does require glibc. # This is an odd issue, still looking for a better fix. Requires: glibc Requires: gcc -Requires(post): %{_sbindir}/update-alternatives -Requires(postun): %{_sbindir}/update-alternatives -%description pkg-bin-linux-386 +%description bin %{summary} -%endif - -%ifarch x86_64 -%package pkg-bin-linux-amd64 -Summary: Golang compiler tool for linux amd64 -Requires: go = %{version}-%{release} -Requires: golang-pkg-linux-amd64 = %{version}-%{release} -Requires(post): golang-pkg-linux-amd64 = %{version}-%{release} -Provides: golang-bin = amd64 -Provides: go(API)(go) = %{go_api} -# We strip the meta dependency, but go does require glibc. -# This is an odd issue, still looking for a better fix. -Requires: glibc -Requires: gcc -Requires(post): %{_sbindir}/update-alternatives -Requires(postun): %{_sbindir}/update-alternatives -%description pkg-bin-linux-amd64 -%{summary} -%endif - -%ifarch %{arm} -%package pkg-bin-linux-arm -Summary: Golang compiler tool for linux arm -Requires: go = %{version}-%{release} -Requires: golang-pkg-linux-arm = %{version}-%{release} -Requires(post): golang-pkg-linux-arm = %{version}-%{release} -Provides: golang-bin = arm -Provides: go(API)(go) = %{go_api} -# We strip the meta dependency, but go does require glibc. -# This is an odd issue, still looking for a better fix. -Requires: glibc -Requires: gcc -Requires(post): %{_sbindir}/update-alternatives -Requires(postun): %{_sbindir}/update-alternatives -%description pkg-bin-linux-arm -%{summary} -%endif - -## -# architecture independent go tooling, that allows for cross -# compiling on golang supported architectures -# http://golang.org/doc/install/source#environment -%package pkg-linux-386 -Summary: Golang compiler toolchain to compile for linux 386 -Requires: go = %{version}-%{release} -Provides: go(API)(cgo) = %{go_api} -BuildArch: noarch -%description pkg-linux-386 -%{summary} - -%package pkg-linux-amd64 -Summary: Golang compiler toolchain to compile for linux amd64 -Requires: go = %{version}-%{release} -Provides: go(API)(cgo) = %{go_api} -BuildArch: noarch -%description pkg-linux-amd64 -%{summary} - -%package pkg-linux-arm -Summary: Golang compiler toolchain to compile for linux arm -Requires: go = %{version}-%{release} -Provides: go(API)(cgo) = %{go_api} -BuildArch: noarch -%description pkg-linux-arm -%{summary} - -%package pkg-darwin-386 -Summary: Golang compiler toolchain to compile for darwin 386 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-darwin-386 -%{summary} - -%package pkg-darwin-amd64 -Summary: Golang compiler toolchain to compile for darwin amd64 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-darwin-amd64 -%{summary} - -%package pkg-windows-386 -Summary: Golang compiler toolchain to compile for windows 386 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-windows-386 -%{summary} - -%package pkg-windows-amd64 -Summary: Golang compiler toolchain to compile for windows amd64 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-windows-amd64 -%{summary} - -%package pkg-plan9-386 -Summary: Golang compiler toolchain to compile for plan9 386 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-plan9-386 -%{summary} - -%package pkg-plan9-amd64 -Summary: Golang compiler toolchain to compile for plan9 amd64 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-plan9-amd64 -%{summary} - -%package pkg-freebsd-386 -Summary: Golang compiler toolchain to compile for freebsd 386 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-freebsd-386 -%{summary} - -%package pkg-freebsd-amd64 -Summary: Golang compiler toolchain to compile for freebsd amd64 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-freebsd-amd64 -%{summary} - -%package pkg-freebsd-arm -Summary: Golang compiler toolchain to compile for freebsd arm -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-freebsd-arm -%{summary} - -%package pkg-netbsd-386 -Summary: Golang compiler toolchain to compile for netbsd 386 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-netbsd-386 -%{summary} - -%package pkg-netbsd-amd64 -Summary: Golang compiler toolchain to compile for netbsd amd64 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-netbsd-amd64 -%{summary} - -%package pkg-netbsd-arm -Summary: Golang compiler toolchain to compile for netbsd arm -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-netbsd-arm -%{summary} - -%package pkg-openbsd-386 -Summary: Golang compiler toolchain to compile for openbsd 386 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-openbsd-386 -%{summary} - -%package pkg-openbsd-amd64 -Summary: Golang compiler toolchain to compile for openbsd amd64 -Requires: go = %{version}-%{release} -BuildArch: noarch -%description pkg-openbsd-amd64 -%{summary} - -## missing ./go/src/runtime/defs_openbsd_arm.h -## we'll skip this bundle for now -#%package pkg-openbsd-arm -#Summary: Golang compiler toolchain to compile for openbsd arm -#Requires: go = %{version}-%{release} -#BuildArch: noarch -#%description pkg-openbsd-arm -#%{summary} # Workaround old RPM bug of symlink-replaced-with-dir failure %pretrans -p @@ -315,7 +197,6 @@ end %if 0%{?fedora} >= 21 %patch210 -p0 -%patch211 -p1 %endif # increase verbosity of build @@ -324,7 +205,19 @@ end # remove the P224 curve %patch1 -p1 +# use the arch dependent path in the bootstrap +%patch212 -p1 + +# disable TestGdbPython +%patch213 -p1 + +# disable TestVendorRun and TestVendorGOPATH +%patch214 -p1 + %build +# go1.5 bootstrapping. The compiler is written in golang. +export GOROOT_BOOTSTRAP=%{goroot} + # set up final install location export GOROOT_FINAL=%{goroot} @@ -335,23 +228,13 @@ export GOROOT_FINAL=%{goroot} export GOHOSTOS=linux export GOHOSTARCH=%{gohostarch} -# build for all (see http://golang.org/doc/install/source#environment) pushd src - for goos in darwin freebsd linux netbsd openbsd plan9 windows ; do - for goarch in 386 amd64 arm ; do - if [ "${goarch}" = "arm" ] ; then - if [ "${goos}" = "darwin" -o "${goos}" = "windows" -o "${goos}" = "plan9" -o "${goos}" = "openbsd" ] ;then - continue - fi - fi - # use our gcc options for this build, but store gcc as default for compiler - CC="gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS" \ - CC_FOR_TARGET="gcc" \ - GOOS=${goos} \ - GOARCH=${goarch} \ - ./make.bash --no-clean - done - done +# use our gcc options for this build, but store gcc as default for compiler +CC="gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS" \ +CC_FOR_TARGET="gcc" \ +GOOS=linux \ +GOARCH=%{gohostarch} \ + ./make.bash --no-clean popd %install @@ -363,7 +246,7 @@ mkdir -p $RPM_BUILD_ROOT%{goroot} # install everything into libdir (until symlink problems are fixed) # https://code.google.com/p/go/issues/detail?id=5830 -cp -apv api bin doc favicon.ico include lib pkg robots.txt src misc VERSION \ +cp -apv api bin doc favicon.ico lib pkg robots.txt src misc VERSION \ $RPM_BUILD_ROOT%{goroot} # bz1099206 @@ -374,27 +257,27 @@ find $RPM_BUILD_ROOT%{goroot}/pkg -exec touch -r $RPM_BUILD_ROOT%{goroot}/pkg "{ # generate the spec file ownership of this source tree and packages cwd=$(pwd) src_list=$cwd/go-src.list -rm -f $src_list -touch $src_list +pkg_list=$cwd/go-pkg.list +misc_list=$cwd/go-misc.list +docs_list=$cwd/go-docs.list +tests_list=$cwd/go-tests.list +rm -f $src_list $pkg_list $docs_list $misc_list $tests_list +touch $src_list $pkg_list $docs_list $misc_list $tests_list pushd $RPM_BUILD_ROOT%{goroot} - find src/ -type d -printf '%%%dir %{goroot}/%p\n' >> $src_list - find src/ ! -type d -printf '%{goroot}/%p\n' >> $src_list + find src/ -type d ! -ipath '*/testdata/*' -printf '%%%dir %{goroot}/%p\n' >> $src_list + find src/ ! -type d ! -ipath '*/testdata/*' ! -name '*_test.go' -printf '%{goroot}/%p\n' >> $src_list + find bin/ pkg/ -type d -printf '%%%dir %{goroot}/%p\n' >> $pkg_list + find bin/ pkg/ ! -type d -printf '%{goroot}/%p\n' >> $pkg_list - for goos in darwin freebsd linux netbsd openbsd plan9 windows ; do - for goarch in 386 amd64 arm ; do - if [ "${goarch}" = "arm" ] ; then - if [ "${goos}" = "darwin" -o "${goos}" = "windows" -o "${goos}" = "plan9" -o "${goos}" = "openbsd" ] ;then - continue - fi - fi - file_list=${cwd}/pkg-${goos}-${goarch}.list - rm -f $file_list - touch $file_list - find pkg/${goos}_${goarch}/ -type d -printf '%%%dir %{goroot}/%p\n' >> $file_list - find pkg/${goos}_${goarch}/ ! -type d -printf '%{goroot}/%p\n' >> $file_list - done - done + find doc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $docs_list + find doc/ ! -type d -printf '%{goroot}/%p\n' >> $docs_list + + find misc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $misc_list + find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list + + find src/ -type d -ipath '*/testdata/*' -printf '%%%dir %{goroot}/%p\n' >> $tests_list + find src/ ! -type d -ipath '*/testdata/*' -o -name '*_test.go' -printf '%{goroot}/%p\n' >> $tests_list popd # remove the unnecessary zoneinfo file (Go will always use the system one first) @@ -406,8 +289,8 @@ rm -rfv $RPM_BUILD_ROOT%{goroot}/doc/Makefile # put binaries to bindir, linked to the arch we're building, # leave the arch independent pieces in %{goroot} mkdir -p $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch} -mv $RPM_BUILD_ROOT%{goroot}/bin/go $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/go -mv $RPM_BUILD_ROOT%{goroot}/bin/gofmt $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/gofmt +ln -sf %{goroot}/bin/go $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/go +ln -sf %{goroot}/bin/gofmt $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/gofmt # ensure these exist and are owned mkdir -p $RPM_BUILD_ROOT%{gopath}/src/github.com/ @@ -415,19 +298,6 @@ mkdir -p $RPM_BUILD_ROOT%{gopath}/src/bitbucket.org/ mkdir -p $RPM_BUILD_ROOT%{gopath}/src/code.google.com/ mkdir -p $RPM_BUILD_ROOT%{gopath}/src/code.google.com/p/ -# remove the go and gofmt for other platforms (not used in the compile) -pushd $RPM_BUILD_ROOT%{goroot}/bin/ - rm -rf darwin_* windows_* freebsd_* netbsd_* openbsd_* plan9_* - case "%{gohostarch}" in - amd64) - rm -rf linux_386 linux_arm ;; - 386) - rm -rf linux_arm linux_amd64 ;; - arm) - rm -rf linux_386 linux_amd64 ;; - esac -popd - # make sure these files exist and point to alternatives rm -f $RPM_BUILD_ROOT%{_bindir}/go ln -sf /etc/alternatives/go $RPM_BUILD_ROOT%{_bindir}/go @@ -455,7 +325,7 @@ cp -av %{SOURCE102} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.golang %check export GOROOT=$(pwd -P) -export PATH="$PATH":"$GOROOT"/bin +export PATH="$GOROOT"/bin:"$PATH" cd src # skip using CGO for test. causes a SIGABRT on fc21 (bz1086900) # until this test/issue is fixed @@ -465,74 +335,42 @@ cd src # not using our 'gcc' since the CFLAGS fails crash_cgo_test.go due to unused variables # https://code.google.com/p/go/issues/detail?id=6883 -CGO_ENABLED=0 ./run.bash --no-rebuild + +# XXX reenable. likely go1.5beta2 https://github.com/golang/go/commit/9adf684686bad7c6319080d0b1da8308a77b08c9 +#CGO_ENABLED=0 ./run.bash --no-rebuild +#CC="gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS" \ +CC="gcc $RPM_LD_FLAGS" \ +CC_FOR_TARGET="gcc" \ + #./run.bash --no-rebuild cd .. -if [ $(go list -json std | grep Stale | wc -l) -gt 2 ] ; then - # cmd/go and cmd/gofmt show like they are stale. we can ignore - exit 1 -fi - - -%ifarch %{ix86} -%post pkg-bin-linux-386 -# since the cgo.a packaged in this rpm will be older than the other archives likely built on the ARM builder, -touch -r %{goroot}/pkg/linux_386/runtime.a %{goroot}/pkg/linux_386/runtime/cgo.a +%post bin %{_sbindir}/update-alternatives --install %{_bindir}/go \ - go %{goroot}/bin/linux_386/go 90 \ - --slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_386/gofmt + go %{goroot}/bin/go 90 \ + --slave %{_bindir}/gofmt gofmt %{goroot}/bin/gofmt -%preun pkg-bin-linux-386 +%preun bin if [ $1 = 0 ]; then - %{_sbindir}/update-alternatives --remove go %{goroot}/bin/linux_386/go + %{_sbindir}/update-alternatives --remove go %{goroot}/bin/go fi -%endif - -%ifarch x86_64 -%post pkg-bin-linux-amd64 -# since the cgo.a packaged in this rpm will be older than the other archives likely built on the ARM builder, -touch -r %{goroot}/pkg/linux_amd64/runtime.a %{goroot}/pkg/linux_amd64/runtime/cgo.a - -%{_sbindir}/update-alternatives --install %{_bindir}/go \ - go %{goroot}/bin/linux_amd64/go 90 \ - --slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_amd64/gofmt - -%preun pkg-bin-linux-amd64 -if [ $1 = 0 ]; then - %{_sbindir}/update-alternatives --remove go %{goroot}/bin/linux_amd64/go -fi -%endif - -%ifarch %{arm} -%post pkg-bin-linux-arm -# since the cgo.a packaged in this rpm will be older than the other archives likely built on the ARM builder, -touch -r %{goroot}/pkg/linux_arm/runtime.a %{goroot}/pkg/linux_arm/runtime/cgo.a - -%{_sbindir}/update-alternatives --install %{_bindir}/go \ - go %{goroot}/bin/linux_arm/go 90 \ - --slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_arm/gofmt - -%preun pkg-bin-linux-arm -if [ $1 = 0 ]; then - %{_sbindir}/update-alternatives --remove go %{goroot}/bin/linux_arm/go -fi -%endif %files %doc AUTHORS CONTRIBUTORS LICENSE PATENTS # VERSION has to be present in the GOROOT, for `go install std` to work %doc %{goroot}/VERSION +%dir %{goroot}/doc %doc %{goroot}/doc/* # go files %dir %{goroot} -%{goroot}/* -%exclude %{goroot}/VERSION %exclude %{goroot}/bin/ %exclude %{goroot}/pkg/ %exclude %{goroot}/src/ +%exclude %{goroot}/doc/ +%exclude %{goroot}/misc/ +%{goroot}/* # ensure directory ownership, so they are cleaned up if empty %dir %{gopath} @@ -558,187 +396,21 @@ fi %files -f go-src.list src +%files -f go-docs.list docs -%ifarch %{ix86} -%files pkg-bin-linux-386 -%{goroot}/bin/linux_386/ -# binary executables +%files -f go-misc.list misc + +%files -f go-tests.list tests + +%files -f go-pkg.list bin %{_bindir}/go %{_bindir}/gofmt -%dir %{goroot}/pkg/obj/linux_386 -%{goroot}/pkg/obj/linux_386/* -%{goroot}/pkg/linux_386/runtime/cgo.a -%dir %{goroot}/pkg/tool/linux_386 -%{goroot}/pkg/tool/linux_386/5a -%{goroot}/pkg/tool/linux_386/5c -%{goroot}/pkg/tool/linux_386/5g -%{goroot}/pkg/tool/linux_386/5l -%{goroot}/pkg/tool/linux_386/6a -%{goroot}/pkg/tool/linux_386/6c -%{goroot}/pkg/tool/linux_386/6g -%{goroot}/pkg/tool/linux_386/6l -%{goroot}/pkg/tool/linux_386/8a -%{goroot}/pkg/tool/linux_386/8c -%{goroot}/pkg/tool/linux_386/8g -%{goroot}/pkg/tool/linux_386/8l -%{goroot}/pkg/tool/linux_386/addr2line -%{goroot}/pkg/tool/linux_386/dist -%{goroot}/pkg/tool/linux_386/nm -%{goroot}/pkg/tool/linux_386/objdump -%{goroot}/pkg/tool/linux_386/pack -%{goroot}/pkg/tool/linux_386/pprof -%endif - -%ifarch x86_64 -%files pkg-bin-linux-amd64 -%{goroot}/bin/linux_amd64/ -# binary executables -%{_bindir}/go -%{_bindir}/gofmt -%dir %{goroot}/pkg/obj/linux_amd64 -%{goroot}/pkg/obj/linux_amd64/* -%{goroot}/pkg/linux_amd64/runtime/cgo.a -%dir %{goroot}/pkg/tool/linux_amd64 -%{goroot}/pkg/tool/linux_amd64/5a -%{goroot}/pkg/tool/linux_amd64/5c -%{goroot}/pkg/tool/linux_amd64/5g -%{goroot}/pkg/tool/linux_amd64/5l -%{goroot}/pkg/tool/linux_amd64/6a -%{goroot}/pkg/tool/linux_amd64/6c -%{goroot}/pkg/tool/linux_amd64/6g -%{goroot}/pkg/tool/linux_amd64/6l -%{goroot}/pkg/tool/linux_amd64/8a -%{goroot}/pkg/tool/linux_amd64/8c -%{goroot}/pkg/tool/linux_amd64/8g -%{goroot}/pkg/tool/linux_amd64/8l -%{goroot}/pkg/tool/linux_amd64/addr2line -%{goroot}/pkg/tool/linux_amd64/dist -%{goroot}/pkg/tool/linux_amd64/nm -%{goroot}/pkg/tool/linux_amd64/objdump -%{goroot}/pkg/tool/linux_amd64/pack -%{goroot}/pkg/tool/linux_amd64/pprof -%endif - -%ifarch %{arm} -%files pkg-bin-linux-arm -%{goroot}/bin/linux_arm/ -# binary executables -%{_bindir}/go -%{_bindir}/gofmt -%dir %{goroot}/pkg/obj/linux_arm -%{goroot}/pkg/obj/linux_arm/* -%{goroot}/pkg/linux_arm/runtime/cgo.a -%dir %{goroot}/pkg/tool/linux_arm -%{goroot}/pkg/tool/linux_arm/5a -%{goroot}/pkg/tool/linux_arm/5c -%{goroot}/pkg/tool/linux_arm/5g -%{goroot}/pkg/tool/linux_arm/5l -%{goroot}/pkg/tool/linux_arm/6a -%{goroot}/pkg/tool/linux_arm/6c -%{goroot}/pkg/tool/linux_arm/6g -%{goroot}/pkg/tool/linux_arm/6l -%{goroot}/pkg/tool/linux_arm/8a -%{goroot}/pkg/tool/linux_arm/8c -%{goroot}/pkg/tool/linux_arm/8g -%{goroot}/pkg/tool/linux_arm/8l -%{goroot}/pkg/tool/linux_arm/addr2line -%{goroot}/pkg/tool/linux_arm/dist -%{goroot}/pkg/tool/linux_arm/nm -%{goroot}/pkg/tool/linux_arm/objdump -%{goroot}/pkg/tool/linux_arm/pack -%{goroot}/pkg/tool/linux_arm/pprof -%endif - -%files pkg-linux-386 -f pkg-linux-386.list -%{goroot}/pkg/linux_386/ -%ifarch %{ix86} -%exclude %{goroot}/pkg/linux_386/runtime/cgo.a -%endif -%{goroot}/pkg/tool/linux_386/cgo -%{goroot}/pkg/tool/linux_386/fix -%{goroot}/pkg/tool/linux_386/yacc - -%files pkg-linux-amd64 -f pkg-linux-amd64.list -%{goroot}/pkg/linux_amd64/ -%ifarch x86_64 -%exclude %{goroot}/pkg/linux_amd64/runtime/cgo.a -%endif -%{goroot}/pkg/tool/linux_amd64/cgo -%{goroot}/pkg/tool/linux_amd64/fix -%{goroot}/pkg/tool/linux_amd64/yacc - -%files pkg-linux-arm -f pkg-linux-arm.list -%{goroot}/pkg/linux_arm/ -%ifarch %{arm} -%exclude %{goroot}/pkg/linux_arm/runtime/cgo.a -%endif -%{goroot}/pkg/tool/linux_arm/cgo -%{goroot}/pkg/tool/linux_arm/fix -%{goroot}/pkg/tool/linux_arm/yacc - -%files pkg-darwin-386 -f pkg-darwin-386.list -%{goroot}/pkg/darwin_386/ -%{goroot}/pkg/tool/darwin_386/ - -%files pkg-darwin-amd64 -f pkg-darwin-amd64.list -%{goroot}/pkg/darwin_amd64/ -%{goroot}/pkg/tool/darwin_amd64/ - -%files pkg-windows-386 -f pkg-windows-386.list -%{goroot}/pkg/windows_386/ -%{goroot}/pkg/tool/windows_386/ - -%files pkg-windows-amd64 -f pkg-windows-amd64.list -%{goroot}/pkg/windows_amd64/ -%{goroot}/pkg/tool/windows_amd64/ - -%files pkg-plan9-386 -f pkg-plan9-386.list -%{goroot}/pkg/plan9_386/ -%{goroot}/pkg/tool/plan9_386/ - -%files pkg-plan9-amd64 -f pkg-plan9-amd64.list -%{goroot}/pkg/plan9_amd64/ -%{goroot}/pkg/tool/plan9_amd64/ - -%files pkg-freebsd-386 -f pkg-freebsd-386.list -%{goroot}/pkg/freebsd_386/ -%{goroot}/pkg/tool/freebsd_386/ - -%files pkg-freebsd-amd64 -f pkg-freebsd-amd64.list -%{goroot}/pkg/freebsd_amd64/ -%{goroot}/pkg/tool/freebsd_amd64/ - -%files pkg-freebsd-arm -f pkg-freebsd-arm.list -%{goroot}/pkg/freebsd_arm/ -%{goroot}/pkg/tool/freebsd_arm/ - -%files pkg-netbsd-386 -f pkg-netbsd-386.list -%{goroot}/pkg/netbsd_386/ -%{goroot}/pkg/tool/netbsd_386/ - -%files pkg-netbsd-amd64 -f pkg-netbsd-amd64.list -%{goroot}/pkg/netbsd_amd64/ -%{goroot}/pkg/tool/netbsd_amd64/ - -%files pkg-netbsd-arm -f pkg-netbsd-arm.list -%{goroot}/pkg/netbsd_arm/ -%{goroot}/pkg/tool/netbsd_arm/ - -%files pkg-openbsd-386 -f pkg-openbsd-386.list -%{goroot}/pkg/openbsd_386/ -%{goroot}/pkg/tool/openbsd_386/ - -%files pkg-openbsd-amd64 -f pkg-openbsd-amd64.list -%{goroot}/pkg/openbsd_amd64/ -%{goroot}/pkg/tool/openbsd_amd64/ - -## skipping for now -#%files pkg-openbsd-arm -#%{goroot}/pkg/openbsd_arm/ -#%{goroot}/pkg/tool/openbsd_arm/ %changelog +* Fri Jul 10 2015 Vincent Batts - 1.4.99-1.1.5beta1 +- updating to go1.5beta1 + * Wed Jun 17 2015 Fedora Release Engineering - 1.4.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild From beda57247513aceedd14702216c55b1da1fcd470 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 17 Jul 2015 09:39:21 -0400 Subject: [PATCH 03/25] fixes missed on initial push of 1.5beta1 --- golang-1.2-remove-ECC-p224.patch | 1165 ++++++++++++++++++++++++++++++ golang.spec | 5 +- sources | 2 +- 3 files changed, 1170 insertions(+), 2 deletions(-) diff --git a/golang-1.2-remove-ECC-p224.patch b/golang-1.2-remove-ECC-p224.patch index e69de29..a1dc26d 100644 --- a/golang-1.2-remove-ECC-p224.patch +++ b/golang-1.2-remove-ECC-p224.patch @@ -0,0 +1,1165 @@ +diff --git a/api/go1.txt b/api/go1.txt +index 5e3dea5..1a1ee83 100644 +--- a/api/go1.txt ++++ b/api/go1.txt +@@ -412,7 +412,6 @@ pkg crypto/ecdsa, type PublicKey struct, Y *big.Int + pkg crypto/ecdsa, type PublicKey struct, embedded elliptic.Curve + pkg crypto/elliptic, func GenerateKey(Curve, io.Reader) ([]uint8, *big.Int, *big.Int, error) + pkg crypto/elliptic, func Marshal(Curve, *big.Int, *big.Int) []uint8 +-pkg crypto/elliptic, func P224() Curve + pkg crypto/elliptic, func P256() Curve + pkg crypto/elliptic, func P384() Curve + pkg crypto/elliptic, func P521() Curve +diff --git a/src/crypto/ecdsa/ecdsa_test.go b/src/crypto/ecdsa/ecdsa_test.go +index 169944d..c653464 100644 +--- a/src/crypto/ecdsa/ecdsa_test.go ++++ b/src/crypto/ecdsa/ecdsa_test.go +@@ -33,11 +33,10 @@ func testKeyGeneration(t *testing.T, c elliptic.Curve, tag string) { + } + + func TestKeyGeneration(t *testing.T) { +- testKeyGeneration(t, elliptic.P224(), "p224") ++ testKeyGeneration(t, elliptic.P256(), "p256") + if testing.Short() { + return + } +- testKeyGeneration(t, elliptic.P256(), "p256") + testKeyGeneration(t, elliptic.P384(), "p384") + testKeyGeneration(t, elliptic.P521(), "p521") + } +@@ -63,11 +62,10 @@ func testSignAndVerify(t *testing.T, c elliptic.Curve, tag string) { + } + + func TestSignAndVerify(t *testing.T) { +- testSignAndVerify(t, elliptic.P224(), "p224") ++ testSignAndVerify(t, elliptic.P256(), "p256") + if testing.Short() { + return + } +- testSignAndVerify(t, elliptic.P256(), "p256") + testSignAndVerify(t, elliptic.P384(), "p384") + testSignAndVerify(t, elliptic.P521(), "p521") + } +@@ -100,11 +98,10 @@ func testNonceSafety(t *testing.T, c elliptic.Curve, tag string) { + } + + func TestNonceSafety(t *testing.T) { +- testNonceSafety(t, elliptic.P224(), "p224") ++ testNonceSafety(t, elliptic.P256(), "p256") + if testing.Short() { + return + } +- testNonceSafety(t, elliptic.P256(), "p256") + testNonceSafety(t, elliptic.P384(), "p384") + testNonceSafety(t, elliptic.P521(), "p521") + } +@@ -135,11 +132,10 @@ func testINDCCA(t *testing.T, c elliptic.Curve, tag string) { + } + + func TestINDCCA(t *testing.T) { +- testINDCCA(t, elliptic.P224(), "p224") ++ testINDCCA(t, elliptic.P256(), "p256") + if testing.Short() { + return + } +- testINDCCA(t, elliptic.P256(), "p256") + testINDCCA(t, elliptic.P384(), "p384") + testINDCCA(t, elliptic.P521(), "p521") + } +@@ -201,8 +197,6 @@ func TestVectors(t *testing.T) { + parts := strings.SplitN(line, ",", 2) + + switch parts[0] { +- case "P-224": +- pub.Curve = elliptic.P224() + case "P-256": + pub.Curve = elliptic.P256() + case "P-384": +diff --git a/src/crypto/elliptic/bottombits.go b/src/crypto/elliptic/bottombits.go +new file mode 100644 +index 0000000..4544722 +--- /dev/null ++++ b/src/crypto/elliptic/bottombits.go +@@ -0,0 +1,4 @@ ++package elliptic ++ ++const bottom28Bits = 0xfffffff ++const two31m3 = 1<<31 - 1<<3 +diff --git a/src/crypto/elliptic/elliptic.go b/src/crypto/elliptic/elliptic.go +index f3b84e1..ca0b7cf 100644 +--- a/src/crypto/elliptic/elliptic.go ++++ b/src/crypto/elliptic/elliptic.go +@@ -331,7 +331,6 @@ var p384 *CurveParams + var p521 *CurveParams + + func initAll() { +- initP224() + initP256() + initP384() + initP521() +diff --git a/src/crypto/elliptic/elliptic_test.go b/src/crypto/elliptic/elliptic_test.go +index 7e27913..0051d53 100644 +--- a/src/crypto/elliptic/elliptic_test.go ++++ b/src/crypto/elliptic/elliptic_test.go +@@ -6,27 +6,25 @@ package elliptic + + import ( + "crypto/rand" +- "encoding/hex" +- "fmt" + "math/big" + "testing" + ) + + func TestOnCurve(t *testing.T) { +- p224 := P224() +- if !p224.IsOnCurve(p224.Params().Gx, p224.Params().Gy) { ++ p256 := P256() ++ if !p256.IsOnCurve(p256.Params().Gx, p256.Params().Gy) { + t.Errorf("FAIL") + } + } + + func TestOffCurve(t *testing.T) { +- p224 := P224() ++ p256 := P256() + x, y := new(big.Int).SetInt64(1), new(big.Int).SetInt64(1) +- if p224.IsOnCurve(x, y) { ++ if p256.IsOnCurve(x, y) { + t.Errorf("FAIL: point off curve is claimed to be on the curve") + } +- b := Marshal(p224, x, y) +- x1, y1 := Unmarshal(p224, b) ++ b := Marshal(p256, x, y) ++ x1, y1 := Unmarshal(p256, b) + if x1 != nil || y1 != nil { + t.Errorf("FAIL: unmarshalling a point not on the curve succeeded") + } +@@ -37,7 +35,7 @@ type baseMultTest struct { + x, y string + } + +-var p224BaseMultTests = []baseMultTest{ ++var p256BaseMultTests = []baseMultTest{ + { + "1", + "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", +@@ -300,47 +298,12 @@ var p224BaseMultTests = []baseMultTest{ + }, + } + +-func TestBaseMult(t *testing.T) { +- p224 := P224() +- for i, e := range p224BaseMultTests { +- k, ok := new(big.Int).SetString(e.k, 10) +- if !ok { +- t.Errorf("%d: bad value for k: %s", i, e.k) +- } +- x, y := p224.ScalarBaseMult(k.Bytes()) +- if fmt.Sprintf("%x", x) != e.x || fmt.Sprintf("%x", y) != e.y { +- t.Errorf("%d: bad output for k=%s: got (%x, %x), want (%s, %s)", i, e.k, x, y, e.x, e.y) +- } +- if testing.Short() && i > 5 { +- break +- } +- } +-} +- +-func TestGenericBaseMult(t *testing.T) { +- // We use the P224 CurveParams directly in order to test the generic implementation. +- p224 := P224().Params() +- for i, e := range p224BaseMultTests { +- k, ok := new(big.Int).SetString(e.k, 10) +- if !ok { +- t.Errorf("%d: bad value for k: %s", i, e.k) +- } +- x, y := p224.ScalarBaseMult(k.Bytes()) +- if fmt.Sprintf("%x", x) != e.x || fmt.Sprintf("%x", y) != e.y { +- t.Errorf("%d: bad output for k=%s: got (%x, %x), want (%s, %s)", i, e.k, x, y, e.x, e.y) +- } +- if testing.Short() && i > 5 { +- break +- } +- } +-} +- + func TestP256BaseMult(t *testing.T) { + p256 := P256() + p256Generic := p256.Params() + +- scalars := make([]*big.Int, 0, len(p224BaseMultTests)+1) +- for _, e := range p224BaseMultTests { ++ scalars := make([]*big.Int, 0, len(p256BaseMultTests)+1) ++ for _, e := range p256BaseMultTests { + k, _ := new(big.Int).SetString(e.k, 10) + scalars = append(scalars, k) + } +@@ -365,7 +328,7 @@ func TestP256Mult(t *testing.T) { + p256 := P256() + p256Generic := p256.Params() + +- for i, e := range p224BaseMultTests { ++ for i, e := range p256BaseMultTests { + x, _ := new(big.Int).SetString(e.x, 16) + y, _ := new(big.Int).SetString(e.y, 16) + k, _ := new(big.Int).SetString(e.k, 10) +@@ -386,7 +349,6 @@ func TestInfinity(t *testing.T) { + name string + curve Curve + }{ +- {"p224", P224()}, + {"p256", P256()}, + } + +@@ -419,21 +381,10 @@ func TestInfinity(t *testing.T) { + } + } + +-func BenchmarkBaseMult(b *testing.B) { +- b.ResetTimer() +- p224 := P224() +- e := p224BaseMultTests[25] +- k, _ := new(big.Int).SetString(e.k, 10) +- b.StartTimer() +- for i := 0; i < b.N; i++ { +- p224.ScalarBaseMult(k.Bytes()) +- } +-} +- + func BenchmarkBaseMultP256(b *testing.B) { + b.ResetTimer() + p256 := P256() +- e := p224BaseMultTests[25] ++ e := p256BaseMultTests[25] + k, _ := new(big.Int).SetString(e.k, 10) + b.StartTimer() + for i := 0; i < b.N; i++ { +@@ -442,14 +393,14 @@ func BenchmarkBaseMultP256(b *testing.B) { + } + + func TestMarshal(t *testing.T) { +- p224 := P224() +- _, x, y, err := GenerateKey(p224, rand.Reader) ++ p254 := P254() ++ _, x, y, err := GenerateKey(p254, rand.Reader) + if err != nil { + t.Error(err) + return + } +- serialized := Marshal(p224, x, y) +- xx, yy := Unmarshal(p224, serialized) ++ serialized := Marshal(p254, x, y) ++ xx, yy := Unmarshal(p254, serialized) + if xx == nil { + t.Error("failed to unmarshal") + return +@@ -459,13 +410,3 @@ func TestMarshal(t *testing.T) { + return + } + } +- +-func TestP224Overflow(t *testing.T) { +- // This tests for a specific bug in the P224 implementation. +- p224 := P224() +- pointData, _ := hex.DecodeString("049B535B45FB0A2072398A6831834624C7E32CCFD5A4B933BCEAF77F1DD945E08BBE5178F5EDF5E733388F196D2A631D2E075BB16CBFEEA15B") +- x, y := Unmarshal(p224, pointData) +- if !p224.IsOnCurve(x, y) { +- t.Error("P224 failed to validate a correct point") +- } +-} +diff --git a/src/crypto/elliptic/p224.go b/src/crypto/elliptic/p224.go +deleted file mode 100644 +index 2d3fac7..0000000 +--- a/src/crypto/elliptic/p224.go ++++ /dev/null +@@ -1,765 +0,0 @@ +-// Copyright 2012 The Go Authors. All rights reserved. +-// Use of this source code is governed by a BSD-style +-// license that can be found in the LICENSE file. +- +-package elliptic +- +-// This is a constant-time, 32-bit implementation of P224. See FIPS 186-3, +-// section D.2.2. +-// +-// See http://www.imperialviolet.org/2010/12/04/ecc.html ([1]) for background. +- +-import ( +- "math/big" +-) +- +-var p224 p224Curve +- +-type p224Curve struct { +- *CurveParams +- gx, gy, b p224FieldElement +-} +- +-func initP224() { +- // See FIPS 186-3, section D.2.2 +- p224.CurveParams = &CurveParams{Name: "P-224"} +- p224.P, _ = new(big.Int).SetString("26959946667150639794667015087019630673557916260026308143510066298881", 10) +- p224.N, _ = new(big.Int).SetString("26959946667150639794667015087019625940457807714424391721682722368061", 10) +- p224.B, _ = new(big.Int).SetString("b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4", 16) +- p224.Gx, _ = new(big.Int).SetString("b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", 16) +- p224.Gy, _ = new(big.Int).SetString("bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34", 16) +- p224.BitSize = 224 +- +- p224FromBig(&p224.gx, p224.Gx) +- p224FromBig(&p224.gy, p224.Gy) +- p224FromBig(&p224.b, p224.B) +-} +- +-// P224 returns a Curve which implements P-224 (see FIPS 186-3, section D.2.2) +-func P224() Curve { +- initonce.Do(initAll) +- return p224 +-} +- +-func (curve p224Curve) Params() *CurveParams { +- return curve.CurveParams +-} +- +-func (curve p224Curve) IsOnCurve(bigX, bigY *big.Int) bool { +- var x, y p224FieldElement +- p224FromBig(&x, bigX) +- p224FromBig(&y, bigY) +- +- // y² = x³ - 3x + b +- var tmp p224LargeFieldElement +- var x3 p224FieldElement +- p224Square(&x3, &x, &tmp) +- p224Mul(&x3, &x3, &x, &tmp) +- +- for i := 0; i < 8; i++ { +- x[i] *= 3 +- } +- p224Sub(&x3, &x3, &x) +- p224Reduce(&x3) +- p224Add(&x3, &x3, &curve.b) +- p224Contract(&x3, &x3) +- +- p224Square(&y, &y, &tmp) +- p224Contract(&y, &y) +- +- for i := 0; i < 8; i++ { +- if y[i] != x3[i] { +- return false +- } +- } +- return true +-} +- +-func (p224Curve) Add(bigX1, bigY1, bigX2, bigY2 *big.Int) (x, y *big.Int) { +- var x1, y1, z1, x2, y2, z2, x3, y3, z3 p224FieldElement +- +- p224FromBig(&x1, bigX1) +- p224FromBig(&y1, bigY1) +- if bigX1.Sign() != 0 || bigY1.Sign() != 0 { +- z1[0] = 1 +- } +- p224FromBig(&x2, bigX2) +- p224FromBig(&y2, bigY2) +- if bigX2.Sign() != 0 || bigY2.Sign() != 0 { +- z2[0] = 1 +- } +- +- p224AddJacobian(&x3, &y3, &z3, &x1, &y1, &z1, &x2, &y2, &z2) +- return p224ToAffine(&x3, &y3, &z3) +-} +- +-func (p224Curve) Double(bigX1, bigY1 *big.Int) (x, y *big.Int) { +- var x1, y1, z1, x2, y2, z2 p224FieldElement +- +- p224FromBig(&x1, bigX1) +- p224FromBig(&y1, bigY1) +- z1[0] = 1 +- +- p224DoubleJacobian(&x2, &y2, &z2, &x1, &y1, &z1) +- return p224ToAffine(&x2, &y2, &z2) +-} +- +-func (p224Curve) ScalarMult(bigX1, bigY1 *big.Int, scalar []byte) (x, y *big.Int) { +- var x1, y1, z1, x2, y2, z2 p224FieldElement +- +- p224FromBig(&x1, bigX1) +- p224FromBig(&y1, bigY1) +- z1[0] = 1 +- +- p224ScalarMult(&x2, &y2, &z2, &x1, &y1, &z1, scalar) +- return p224ToAffine(&x2, &y2, &z2) +-} +- +-func (curve p224Curve) ScalarBaseMult(scalar []byte) (x, y *big.Int) { +- var z1, x2, y2, z2 p224FieldElement +- +- z1[0] = 1 +- p224ScalarMult(&x2, &y2, &z2, &curve.gx, &curve.gy, &z1, scalar) +- return p224ToAffine(&x2, &y2, &z2) +-} +- +-// Field element functions. +-// +-// The field that we're dealing with is ℤ/pℤ where p = 2**224 - 2**96 + 1. +-// +-// Field elements are represented by a FieldElement, which is a typedef to an +-// array of 8 uint32's. The value of a FieldElement, a, is: +-// a[0] + 2**28·a[1] + 2**56·a[1] + ... + 2**196·a[7] +-// +-// Using 28-bit limbs means that there's only 4 bits of headroom, which is less +-// than we would really like. But it has the useful feature that we hit 2**224 +-// exactly, making the reflections during a reduce much nicer. +-type p224FieldElement [8]uint32 +- +-// p224P is the order of the field, represented as a p224FieldElement. +-var p224P = [8]uint32{1, 0, 0, 0xffff000, 0xfffffff, 0xfffffff, 0xfffffff, 0xfffffff} +- +-// p224IsZero returns 1 if a == 0 mod p and 0 otherwise. +-// +-// a[i] < 2**29 +-func p224IsZero(a *p224FieldElement) uint32 { +- // Since a p224FieldElement contains 224 bits there are two possible +- // representations of 0: 0 and p. +- var minimal p224FieldElement +- p224Contract(&minimal, a) +- +- var isZero, isP uint32 +- for i, v := range minimal { +- isZero |= v +- isP |= v - p224P[i] +- } +- +- // If either isZero or isP is 0, then we should return 1. +- isZero |= isZero >> 16 +- isZero |= isZero >> 8 +- isZero |= isZero >> 4 +- isZero |= isZero >> 2 +- isZero |= isZero >> 1 +- +- isP |= isP >> 16 +- isP |= isP >> 8 +- isP |= isP >> 4 +- isP |= isP >> 2 +- isP |= isP >> 1 +- +- // For isZero and isP, the LSB is 0 iff all the bits are zero. +- result := isZero & isP +- result = (^result) & 1 +- +- return result +-} +- +-// p224Add computes *out = a+b +-// +-// a[i] + b[i] < 2**32 +-func p224Add(out, a, b *p224FieldElement) { +- for i := 0; i < 8; i++ { +- out[i] = a[i] + b[i] +- } +-} +- +-const two31p3 = 1<<31 + 1<<3 +-const two31m3 = 1<<31 - 1<<3 +-const two31m15m3 = 1<<31 - 1<<15 - 1<<3 +- +-// p224ZeroModP31 is 0 mod p where bit 31 is set in all limbs so that we can +-// subtract smaller amounts without underflow. See the section "Subtraction" in +-// [1] for reasoning. +-var p224ZeroModP31 = []uint32{two31p3, two31m3, two31m3, two31m15m3, two31m3, two31m3, two31m3, two31m3} +- +-// p224Sub computes *out = a-b +-// +-// a[i], b[i] < 2**30 +-// out[i] < 2**32 +-func p224Sub(out, a, b *p224FieldElement) { +- for i := 0; i < 8; i++ { +- out[i] = a[i] + p224ZeroModP31[i] - b[i] +- } +-} +- +-// LargeFieldElement also represents an element of the field. The limbs are +-// still spaced 28-bits apart and in little-endian order. So the limbs are at +-// 0, 28, 56, ..., 392 bits, each 64-bits wide. +-type p224LargeFieldElement [15]uint64 +- +-const two63p35 = 1<<63 + 1<<35 +-const two63m35 = 1<<63 - 1<<35 +-const two63m35m19 = 1<<63 - 1<<35 - 1<<19 +- +-// p224ZeroModP63 is 0 mod p where bit 63 is set in all limbs. See the section +-// "Subtraction" in [1] for why. +-var p224ZeroModP63 = [8]uint64{two63p35, two63m35, two63m35, two63m35, two63m35m19, two63m35, two63m35, two63m35} +- +-const bottom12Bits = 0xfff +-const bottom28Bits = 0xfffffff +- +-// p224Mul computes *out = a*b +-// +-// a[i] < 2**29, b[i] < 2**30 (or vice versa) +-// out[i] < 2**29 +-func p224Mul(out, a, b *p224FieldElement, tmp *p224LargeFieldElement) { +- for i := 0; i < 15; i++ { +- tmp[i] = 0 +- } +- +- for i := 0; i < 8; i++ { +- for j := 0; j < 8; j++ { +- tmp[i+j] += uint64(a[i]) * uint64(b[j]) +- } +- } +- +- p224ReduceLarge(out, tmp) +-} +- +-// Square computes *out = a*a +-// +-// a[i] < 2**29 +-// out[i] < 2**29 +-func p224Square(out, a *p224FieldElement, tmp *p224LargeFieldElement) { +- for i := 0; i < 15; i++ { +- tmp[i] = 0 +- } +- +- for i := 0; i < 8; i++ { +- for j := 0; j <= i; j++ { +- r := uint64(a[i]) * uint64(a[j]) +- if i == j { +- tmp[i+j] += r +- } else { +- tmp[i+j] += r << 1 +- } +- } +- } +- +- p224ReduceLarge(out, tmp) +-} +- +-// ReduceLarge converts a p224LargeFieldElement to a p224FieldElement. +-// +-// in[i] < 2**62 +-func p224ReduceLarge(out *p224FieldElement, in *p224LargeFieldElement) { +- for i := 0; i < 8; i++ { +- in[i] += p224ZeroModP63[i] +- } +- +- // Eliminate the coefficients at 2**224 and greater. +- for i := 14; i >= 8; i-- { +- in[i-8] -= in[i] +- in[i-5] += (in[i] & 0xffff) << 12 +- in[i-4] += in[i] >> 16 +- } +- in[8] = 0 +- // in[0..8] < 2**64 +- +- // As the values become small enough, we start to store them in |out| +- // and use 32-bit operations. +- for i := 1; i < 8; i++ { +- in[i+1] += in[i] >> 28 +- out[i] = uint32(in[i] & bottom28Bits) +- } +- in[0] -= in[8] +- out[3] += uint32(in[8]&0xffff) << 12 +- out[4] += uint32(in[8] >> 16) +- // in[0] < 2**64 +- // out[3] < 2**29 +- // out[4] < 2**29 +- // out[1,2,5..7] < 2**28 +- +- out[0] = uint32(in[0] & bottom28Bits) +- out[1] += uint32((in[0] >> 28) & bottom28Bits) +- out[2] += uint32(in[0] >> 56) +- // out[0] < 2**28 +- // out[1..4] < 2**29 +- // out[5..7] < 2**28 +-} +- +-// Reduce reduces the coefficients of a to smaller bounds. +-// +-// On entry: a[i] < 2**31 + 2**30 +-// On exit: a[i] < 2**29 +-func p224Reduce(a *p224FieldElement) { +- for i := 0; i < 7; i++ { +- a[i+1] += a[i] >> 28 +- a[i] &= bottom28Bits +- } +- top := a[7] >> 28 +- a[7] &= bottom28Bits +- +- // top < 2**4 +- mask := top +- mask |= mask >> 2 +- mask |= mask >> 1 +- mask <<= 31 +- mask = uint32(int32(mask) >> 31) +- // Mask is all ones if top != 0, all zero otherwise +- +- a[0] -= top +- a[3] += top << 12 +- +- // We may have just made a[0] negative but, if we did, then we must +- // have added something to a[3], this it's > 2**12. Therefore we can +- // carry down to a[0]. +- a[3] -= 1 & mask +- a[2] += mask & (1<<28 - 1) +- a[1] += mask & (1<<28 - 1) +- a[0] += mask & (1 << 28) +-} +- +-// p224Invert calculates *out = in**-1 by computing in**(2**224 - 2**96 - 1), +-// i.e. Fermat's little theorem. +-func p224Invert(out, in *p224FieldElement) { +- var f1, f2, f3, f4 p224FieldElement +- var c p224LargeFieldElement +- +- p224Square(&f1, in, &c) // 2 +- p224Mul(&f1, &f1, in, &c) // 2**2 - 1 +- p224Square(&f1, &f1, &c) // 2**3 - 2 +- p224Mul(&f1, &f1, in, &c) // 2**3 - 1 +- p224Square(&f2, &f1, &c) // 2**4 - 2 +- p224Square(&f2, &f2, &c) // 2**5 - 4 +- p224Square(&f2, &f2, &c) // 2**6 - 8 +- p224Mul(&f1, &f1, &f2, &c) // 2**6 - 1 +- p224Square(&f2, &f1, &c) // 2**7 - 2 +- for i := 0; i < 5; i++ { // 2**12 - 2**6 +- p224Square(&f2, &f2, &c) +- } +- p224Mul(&f2, &f2, &f1, &c) // 2**12 - 1 +- p224Square(&f3, &f2, &c) // 2**13 - 2 +- for i := 0; i < 11; i++ { // 2**24 - 2**12 +- p224Square(&f3, &f3, &c) +- } +- p224Mul(&f2, &f3, &f2, &c) // 2**24 - 1 +- p224Square(&f3, &f2, &c) // 2**25 - 2 +- for i := 0; i < 23; i++ { // 2**48 - 2**24 +- p224Square(&f3, &f3, &c) +- } +- p224Mul(&f3, &f3, &f2, &c) // 2**48 - 1 +- p224Square(&f4, &f3, &c) // 2**49 - 2 +- for i := 0; i < 47; i++ { // 2**96 - 2**48 +- p224Square(&f4, &f4, &c) +- } +- p224Mul(&f3, &f3, &f4, &c) // 2**96 - 1 +- p224Square(&f4, &f3, &c) // 2**97 - 2 +- for i := 0; i < 23; i++ { // 2**120 - 2**24 +- p224Square(&f4, &f4, &c) +- } +- p224Mul(&f2, &f4, &f2, &c) // 2**120 - 1 +- for i := 0; i < 6; i++ { // 2**126 - 2**6 +- p224Square(&f2, &f2, &c) +- } +- p224Mul(&f1, &f1, &f2, &c) // 2**126 - 1 +- p224Square(&f1, &f1, &c) // 2**127 - 2 +- p224Mul(&f1, &f1, in, &c) // 2**127 - 1 +- for i := 0; i < 97; i++ { // 2**224 - 2**97 +- p224Square(&f1, &f1, &c) +- } +- p224Mul(out, &f1, &f3, &c) // 2**224 - 2**96 - 1 +-} +- +-// p224Contract converts a FieldElement to its unique, minimal form. +-// +-// On entry, in[i] < 2**29 +-// On exit, in[i] < 2**28 +-func p224Contract(out, in *p224FieldElement) { +- copy(out[:], in[:]) +- +- for i := 0; i < 7; i++ { +- out[i+1] += out[i] >> 28 +- out[i] &= bottom28Bits +- } +- top := out[7] >> 28 +- out[7] &= bottom28Bits +- +- out[0] -= top +- out[3] += top << 12 +- +- // We may just have made out[i] negative. So we carry down. If we made +- // out[0] negative then we know that out[3] is sufficiently positive +- // because we just added to it. +- for i := 0; i < 3; i++ { +- mask := uint32(int32(out[i]) >> 31) +- out[i] += (1 << 28) & mask +- out[i+1] -= 1 & mask +- } +- +- // We might have pushed out[3] over 2**28 so we perform another, partial, +- // carry chain. +- for i := 3; i < 7; i++ { +- out[i+1] += out[i] >> 28 +- out[i] &= bottom28Bits +- } +- top = out[7] >> 28 +- out[7] &= bottom28Bits +- +- // Eliminate top while maintaining the same value mod p. +- out[0] -= top +- out[3] += top << 12 +- +- // There are two cases to consider for out[3]: +- // 1) The first time that we eliminated top, we didn't push out[3] over +- // 2**28. In this case, the partial carry chain didn't change any values +- // and top is zero. +- // 2) We did push out[3] over 2**28 the first time that we eliminated top. +- // The first value of top was in [0..16), therefore, prior to eliminating +- // the first top, 0xfff1000 <= out[3] <= 0xfffffff. Therefore, after +- // overflowing and being reduced by the second carry chain, out[3] <= +- // 0xf000. Thus it cannot have overflowed when we eliminated top for the +- // second time. +- +- // Again, we may just have made out[0] negative, so do the same carry down. +- // As before, if we made out[0] negative then we know that out[3] is +- // sufficiently positive. +- for i := 0; i < 3; i++ { +- mask := uint32(int32(out[i]) >> 31) +- out[i] += (1 << 28) & mask +- out[i+1] -= 1 & mask +- } +- +- // Now we see if the value is >= p and, if so, subtract p. +- +- // First we build a mask from the top four limbs, which must all be +- // equal to bottom28Bits if the whole value is >= p. If top4AllOnes +- // ends up with any zero bits in the bottom 28 bits, then this wasn't +- // true. +- top4AllOnes := uint32(0xffffffff) +- for i := 4; i < 8; i++ { +- top4AllOnes &= out[i] +- } +- top4AllOnes |= 0xf0000000 +- // Now we replicate any zero bits to all the bits in top4AllOnes. +- top4AllOnes &= top4AllOnes >> 16 +- top4AllOnes &= top4AllOnes >> 8 +- top4AllOnes &= top4AllOnes >> 4 +- top4AllOnes &= top4AllOnes >> 2 +- top4AllOnes &= top4AllOnes >> 1 +- top4AllOnes = uint32(int32(top4AllOnes<<31) >> 31) +- +- // Now we test whether the bottom three limbs are non-zero. +- bottom3NonZero := out[0] | out[1] | out[2] +- bottom3NonZero |= bottom3NonZero >> 16 +- bottom3NonZero |= bottom3NonZero >> 8 +- bottom3NonZero |= bottom3NonZero >> 4 +- bottom3NonZero |= bottom3NonZero >> 2 +- bottom3NonZero |= bottom3NonZero >> 1 +- bottom3NonZero = uint32(int32(bottom3NonZero<<31) >> 31) +- +- // Everything depends on the value of out[3]. +- // If it's > 0xffff000 and top4AllOnes != 0 then the whole value is >= p +- // If it's = 0xffff000 and top4AllOnes != 0 and bottom3NonZero != 0, +- // then the whole value is >= p +- // If it's < 0xffff000, then the whole value is < p +- n := out[3] - 0xffff000 +- out3Equal := n +- out3Equal |= out3Equal >> 16 +- out3Equal |= out3Equal >> 8 +- out3Equal |= out3Equal >> 4 +- out3Equal |= out3Equal >> 2 +- out3Equal |= out3Equal >> 1 +- out3Equal = ^uint32(int32(out3Equal<<31) >> 31) +- +- // If out[3] > 0xffff000 then n's MSB will be zero. +- out3GT := ^uint32(int32(n) >> 31) +- +- mask := top4AllOnes & ((out3Equal & bottom3NonZero) | out3GT) +- out[0] -= 1 & mask +- out[3] -= 0xffff000 & mask +- out[4] -= 0xfffffff & mask +- out[5] -= 0xfffffff & mask +- out[6] -= 0xfffffff & mask +- out[7] -= 0xfffffff & mask +-} +- +-// Group element functions. +-// +-// These functions deal with group elements. The group is an elliptic curve +-// group with a = -3 defined in FIPS 186-3, section D.2.2. +- +-// p224AddJacobian computes *out = a+b where a != b. +-func p224AddJacobian(x3, y3, z3, x1, y1, z1, x2, y2, z2 *p224FieldElement) { +- // See http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-p224Add-2007-bl +- var z1z1, z2z2, u1, u2, s1, s2, h, i, j, r, v p224FieldElement +- var c p224LargeFieldElement +- +- z1IsZero := p224IsZero(z1) +- z2IsZero := p224IsZero(z2) +- +- // Z1Z1 = Z1² +- p224Square(&z1z1, z1, &c) +- // Z2Z2 = Z2² +- p224Square(&z2z2, z2, &c) +- // U1 = X1*Z2Z2 +- p224Mul(&u1, x1, &z2z2, &c) +- // U2 = X2*Z1Z1 +- p224Mul(&u2, x2, &z1z1, &c) +- // S1 = Y1*Z2*Z2Z2 +- p224Mul(&s1, z2, &z2z2, &c) +- p224Mul(&s1, y1, &s1, &c) +- // S2 = Y2*Z1*Z1Z1 +- p224Mul(&s2, z1, &z1z1, &c) +- p224Mul(&s2, y2, &s2, &c) +- // H = U2-U1 +- p224Sub(&h, &u2, &u1) +- p224Reduce(&h) +- xEqual := p224IsZero(&h) +- // I = (2*H)² +- for j := 0; j < 8; j++ { +- i[j] = h[j] << 1 +- } +- p224Reduce(&i) +- p224Square(&i, &i, &c) +- // J = H*I +- p224Mul(&j, &h, &i, &c) +- // r = 2*(S2-S1) +- p224Sub(&r, &s2, &s1) +- p224Reduce(&r) +- yEqual := p224IsZero(&r) +- if xEqual == 1 && yEqual == 1 && z1IsZero == 0 && z2IsZero == 0 { +- p224DoubleJacobian(x3, y3, z3, x1, y1, z1) +- return +- } +- for i := 0; i < 8; i++ { +- r[i] <<= 1 +- } +- p224Reduce(&r) +- // V = U1*I +- p224Mul(&v, &u1, &i, &c) +- // Z3 = ((Z1+Z2)²-Z1Z1-Z2Z2)*H +- p224Add(&z1z1, &z1z1, &z2z2) +- p224Add(&z2z2, z1, z2) +- p224Reduce(&z2z2) +- p224Square(&z2z2, &z2z2, &c) +- p224Sub(z3, &z2z2, &z1z1) +- p224Reduce(z3) +- p224Mul(z3, z3, &h, &c) +- // X3 = r²-J-2*V +- for i := 0; i < 8; i++ { +- z1z1[i] = v[i] << 1 +- } +- p224Add(&z1z1, &j, &z1z1) +- p224Reduce(&z1z1) +- p224Square(x3, &r, &c) +- p224Sub(x3, x3, &z1z1) +- p224Reduce(x3) +- // Y3 = r*(V-X3)-2*S1*J +- for i := 0; i < 8; i++ { +- s1[i] <<= 1 +- } +- p224Mul(&s1, &s1, &j, &c) +- p224Sub(&z1z1, &v, x3) +- p224Reduce(&z1z1) +- p224Mul(&z1z1, &z1z1, &r, &c) +- p224Sub(y3, &z1z1, &s1) +- p224Reduce(y3) +- +- p224CopyConditional(x3, x2, z1IsZero) +- p224CopyConditional(x3, x1, z2IsZero) +- p224CopyConditional(y3, y2, z1IsZero) +- p224CopyConditional(y3, y1, z2IsZero) +- p224CopyConditional(z3, z2, z1IsZero) +- p224CopyConditional(z3, z1, z2IsZero) +-} +- +-// p224DoubleJacobian computes *out = a+a. +-func p224DoubleJacobian(x3, y3, z3, x1, y1, z1 *p224FieldElement) { +- var delta, gamma, beta, alpha, t p224FieldElement +- var c p224LargeFieldElement +- +- p224Square(&delta, z1, &c) +- p224Square(&gamma, y1, &c) +- p224Mul(&beta, x1, &gamma, &c) +- +- // alpha = 3*(X1-delta)*(X1+delta) +- p224Add(&t, x1, &delta) +- for i := 0; i < 8; i++ { +- t[i] += t[i] << 1 +- } +- p224Reduce(&t) +- p224Sub(&alpha, x1, &delta) +- p224Reduce(&alpha) +- p224Mul(&alpha, &alpha, &t, &c) +- +- // Z3 = (Y1+Z1)²-gamma-delta +- p224Add(z3, y1, z1) +- p224Reduce(z3) +- p224Square(z3, z3, &c) +- p224Sub(z3, z3, &gamma) +- p224Reduce(z3) +- p224Sub(z3, z3, &delta) +- p224Reduce(z3) +- +- // X3 = alpha²-8*beta +- for i := 0; i < 8; i++ { +- delta[i] = beta[i] << 3 +- } +- p224Reduce(&delta) +- p224Square(x3, &alpha, &c) +- p224Sub(x3, x3, &delta) +- p224Reduce(x3) +- +- // Y3 = alpha*(4*beta-X3)-8*gamma² +- for i := 0; i < 8; i++ { +- beta[i] <<= 2 +- } +- p224Sub(&beta, &beta, x3) +- p224Reduce(&beta) +- p224Square(&gamma, &gamma, &c) +- for i := 0; i < 8; i++ { +- gamma[i] <<= 3 +- } +- p224Reduce(&gamma) +- p224Mul(y3, &alpha, &beta, &c) +- p224Sub(y3, y3, &gamma) +- p224Reduce(y3) +-} +- +-// p224CopyConditional sets *out = *in iff the least-significant-bit of control +-// is true, and it runs in constant time. +-func p224CopyConditional(out, in *p224FieldElement, control uint32) { +- control <<= 31 +- control = uint32(int32(control) >> 31) +- +- for i := 0; i < 8; i++ { +- out[i] ^= (out[i] ^ in[i]) & control +- } +-} +- +-func p224ScalarMult(outX, outY, outZ, inX, inY, inZ *p224FieldElement, scalar []byte) { +- var xx, yy, zz p224FieldElement +- for i := 0; i < 8; i++ { +- outX[i] = 0 +- outY[i] = 0 +- outZ[i] = 0 +- } +- +- for _, byte := range scalar { +- for bitNum := uint(0); bitNum < 8; bitNum++ { +- p224DoubleJacobian(outX, outY, outZ, outX, outY, outZ) +- bit := uint32((byte >> (7 - bitNum)) & 1) +- p224AddJacobian(&xx, &yy, &zz, inX, inY, inZ, outX, outY, outZ) +- p224CopyConditional(outX, &xx, bit) +- p224CopyConditional(outY, &yy, bit) +- p224CopyConditional(outZ, &zz, bit) +- } +- } +-} +- +-// p224ToAffine converts from Jacobian to affine form. +-func p224ToAffine(x, y, z *p224FieldElement) (*big.Int, *big.Int) { +- var zinv, zinvsq, outx, outy p224FieldElement +- var tmp p224LargeFieldElement +- +- if isPointAtInfinity := p224IsZero(z); isPointAtInfinity == 1 { +- return new(big.Int), new(big.Int) +- } +- +- p224Invert(&zinv, z) +- p224Square(&zinvsq, &zinv, &tmp) +- p224Mul(x, x, &zinvsq, &tmp) +- p224Mul(&zinvsq, &zinvsq, &zinv, &tmp) +- p224Mul(y, y, &zinvsq, &tmp) +- +- p224Contract(&outx, x) +- p224Contract(&outy, y) +- return p224ToBig(&outx), p224ToBig(&outy) +-} +- +-// get28BitsFromEnd returns the least-significant 28 bits from buf>>shift, +-// where buf is interpreted as a big-endian number. +-func get28BitsFromEnd(buf []byte, shift uint) (uint32, []byte) { +- var ret uint32 +- +- for i := uint(0); i < 4; i++ { +- var b byte +- if l := len(buf); l > 0 { +- b = buf[l-1] +- // We don't remove the byte if we're about to return and we're not +- // reading all of it. +- if i != 3 || shift == 4 { +- buf = buf[:l-1] +- } +- } +- ret |= uint32(b) << (8 * i) >> shift +- } +- ret &= bottom28Bits +- return ret, buf +-} +- +-// p224FromBig sets *out = *in. +-func p224FromBig(out *p224FieldElement, in *big.Int) { +- bytes := in.Bytes() +- out[0], bytes = get28BitsFromEnd(bytes, 0) +- out[1], bytes = get28BitsFromEnd(bytes, 4) +- out[2], bytes = get28BitsFromEnd(bytes, 0) +- out[3], bytes = get28BitsFromEnd(bytes, 4) +- out[4], bytes = get28BitsFromEnd(bytes, 0) +- out[5], bytes = get28BitsFromEnd(bytes, 4) +- out[6], bytes = get28BitsFromEnd(bytes, 0) +- out[7], bytes = get28BitsFromEnd(bytes, 4) +-} +- +-// p224ToBig returns in as a big.Int. +-func p224ToBig(in *p224FieldElement) *big.Int { +- var buf [28]byte +- buf[27] = byte(in[0]) +- buf[26] = byte(in[0] >> 8) +- buf[25] = byte(in[0] >> 16) +- buf[24] = byte(((in[0] >> 24) & 0x0f) | (in[1]<<4)&0xf0) +- +- buf[23] = byte(in[1] >> 4) +- buf[22] = byte(in[1] >> 12) +- buf[21] = byte(in[1] >> 20) +- +- buf[20] = byte(in[2]) +- buf[19] = byte(in[2] >> 8) +- buf[18] = byte(in[2] >> 16) +- buf[17] = byte(((in[2] >> 24) & 0x0f) | (in[3]<<4)&0xf0) +- +- buf[16] = byte(in[3] >> 4) +- buf[15] = byte(in[3] >> 12) +- buf[14] = byte(in[3] >> 20) +- +- buf[13] = byte(in[4]) +- buf[12] = byte(in[4] >> 8) +- buf[11] = byte(in[4] >> 16) +- buf[10] = byte(((in[4] >> 24) & 0x0f) | (in[5]<<4)&0xf0) +- +- buf[9] = byte(in[5] >> 4) +- buf[8] = byte(in[5] >> 12) +- buf[7] = byte(in[5] >> 20) +- +- buf[6] = byte(in[6]) +- buf[5] = byte(in[6] >> 8) +- buf[4] = byte(in[6] >> 16) +- buf[3] = byte(((in[6] >> 24) & 0x0f) | (in[7]<<4)&0xf0) +- +- buf[2] = byte(in[7] >> 4) +- buf[1] = byte(in[7] >> 12) +- buf[0] = byte(in[7] >> 20) +- +- return new(big.Int).SetBytes(buf[:]) +-} +diff --git a/src/crypto/elliptic/p224_test.go b/src/crypto/elliptic/p224_test.go +deleted file mode 100644 +index 4b26d16..0000000 +--- a/src/crypto/elliptic/p224_test.go ++++ /dev/null +@@ -1,47 +0,0 @@ +-// Copyright 2012 The Go Authors. All rights reserved. +-// Use of this source code is governed by a BSD-style +-// license that can be found in the LICENSE file. +- +-package elliptic +- +-import ( +- "math/big" +- "testing" +-) +- +-var toFromBigTests = []string{ +- "0", +- "1", +- "23", +- "b70e0cb46bb4bf7f321390b94a03c1d356c01122343280d6105c1d21", +- "706a46d476dcb76798e6046d89474788d164c18032d268fd10704fa6", +-} +- +-func p224AlternativeToBig(in *p224FieldElement) *big.Int { +- ret := new(big.Int) +- tmp := new(big.Int) +- +- for i := uint(0); i < 8; i++ { +- tmp.SetInt64(int64(in[i])) +- tmp.Lsh(tmp, 28*i) +- ret.Add(ret, tmp) +- } +- ret.Mod(ret, p224.P) +- return ret +-} +- +-func TestToFromBig(t *testing.T) { +- for i, test := range toFromBigTests { +- n, _ := new(big.Int).SetString(test, 16) +- var x p224FieldElement +- p224FromBig(&x, n) +- m := p224ToBig(&x) +- if n.Cmp(m) != 0 { +- t.Errorf("#%d: %x != %x", i, n, m) +- } +- q := p224AlternativeToBig(&x) +- if n.Cmp(q) != 0 { +- t.Errorf("#%d: %x != %x (alternative)", i, n, m) +- } +- } +-} +diff --git a/src/crypto/tls/generate_cert.go b/src/crypto/tls/generate_cert.go +index 83f9916..dea8589 100644 +--- a/src/crypto/tls/generate_cert.go ++++ b/src/crypto/tls/generate_cert.go +@@ -33,7 +33,7 @@ var ( + validFor = flag.Duration("duration", 365*24*time.Hour, "Duration that certificate is valid for") + isCA = flag.Bool("ca", false, "whether this cert should be its own Certificate Authority") + rsaBits = flag.Int("rsa-bits", 2048, "Size of RSA key to generate. Ignored if --ecdsa-curve is set") +- ecdsaCurve = flag.String("ecdsa-curve", "", "ECDSA curve to use to generate a key. Valid values are P224, P256, P384, P521") ++ ecdsaCurve = flag.String("ecdsa-curve", "", "ECDSA curve to use to generate a key. Valid values are P256, P384, P521") + ) + + func publicKey(priv interface{}) interface{} { +@@ -75,8 +75,6 @@ func main() { + switch *ecdsaCurve { + case "": + priv, err = rsa.GenerateKey(rand.Reader, *rsaBits) +- case "P224": +- priv, err = ecdsa.GenerateKey(elliptic.P224(), rand.Reader) + case "P256": + priv, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + case "P384": +diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go +index be6c013..aa55f55 100644 +--- a/src/crypto/x509/x509.go ++++ b/src/crypto/x509/x509.go +@@ -308,9 +308,6 @@ func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm + + // RFC 5480, 2.1.1.1. Named Curve + // +-// secp224r1 OBJECT IDENTIFIER ::= { +-// iso(1) identified-organization(3) certicom(132) curve(0) 33 } +-// + // secp256r1 OBJECT IDENTIFIER ::= { + // iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) + // prime(1) 7 } +@@ -323,7 +320,6 @@ func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm + // + // NB: secp256r1 is equivalent to prime256v1 + var ( +- oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33} + oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7} + oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34} + oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35} +@@ -331,8 +327,6 @@ var ( + + func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { + switch { +- case oid.Equal(oidNamedCurveP224): +- return elliptic.P224() + case oid.Equal(oidNamedCurveP256): + return elliptic.P256() + case oid.Equal(oidNamedCurveP384): +@@ -345,8 +339,6 @@ func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { + + func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) { + switch curve { +- case elliptic.P224(): +- return oidNamedCurveP224, true + case elliptic.P256(): + return oidNamedCurveP256, true + case elliptic.P384(): +@@ -1466,9 +1458,6 @@ func signingParamsForPublicKey(pub interface{}, requestedSigAlgo SignatureAlgori + pubType = ECDSA + + switch pub.Curve { +- case elliptic.P224(), elliptic.P256(): +- hashFunc = crypto.SHA256 +- sigAlgo.Algorithm = oidSignatureECDSAWithSHA256 + case elliptic.P384(): + hashFunc = crypto.SHA384 + sigAlgo.Algorithm = oidSignatureECDSAWithSHA384 diff --git a/golang.spec b/golang.spec index 08fb4a3..a9bdda2 100644 --- a/golang.spec +++ b/golang.spec @@ -41,7 +41,7 @@ Name: golang Version: 1.4.99 -Release: 1.%{go_version}%{?dist} +Release: 2.%{go_version}%{?dist} Summary: The Go Programming Language License: BSD @@ -408,6 +408,9 @@ fi %changelog +* Fri Jul 10 2015 Vincent Batts - 1.4.99-2.1.5beta1 +- add checksum to sources and fixed one patch + * Fri Jul 10 2015 Vincent Batts - 1.4.99-1.1.5beta1 - updating to go1.5beta1 diff --git a/sources b/sources index c9c38e8..b580140 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar -907f85c8fa765d31f7f955836fec4049 go1.4.2.src.tar.gz +aa82b90515edd1fa814e5ecb4ee771a4 go1.5beta1.src.tar.gz From 2ecad653a520047a4d6a1c0acecb0eef086a657c Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 17 Jul 2015 11:02:40 -0400 Subject: [PATCH 04/25] update to go1.5beta2 --- .gitignore | 1 + go1.5beta1-fix-TestVendorRun.patch | 29 ------------------ ...EWUSERAndRemapNoRootDisableSetgroups.patch | 13 ++++++++ golang-1.2-remove-ECC-p224.patch | 27 ++++++++++------- golang.spec | 30 +++++++++++-------- sources | 1 + 6 files changed, 49 insertions(+), 52 deletions(-) delete mode 100644 go1.5beta1-fix-TestVendorRun.patch create mode 100644 go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch diff --git a/.gitignore b/.gitignore index 4c2608c..4e43c07 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /go1.4rc2.src.tar.gz /go1.5beta1.src.tar.gz /golang-19087:a15f344a9efa-xattrs.tar +/go1.5beta2.src.tar.gz diff --git a/go1.5beta1-fix-TestVendorRun.patch b/go1.5beta1-fix-TestVendorRun.patch deleted file mode 100644 index 41f985d..0000000 --- a/go1.5beta1-fix-TestVendorRun.patch +++ /dev/null @@ -1,29 +0,0 @@ -commit 9adf684686bad7c6319080d0b1da8308a77b08c9 -Author: Russ Cox -Date: Tue Jul 14 15:15:37 2015 -0400 - - cmd/go: fix TestVendorRun when $GOROOT is inside a symlinked path - - Fixes #11305. - - Change-Id: Icaa3a009aa4ab214c9aaf74f52c3e622fa266a9d - Reviewed-on: https://go-review.googlesource.com/12194 - Reviewed-by: David Crawshaw - Reviewed-by: Ian Lance Taylor - -diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go -index 98486c5..af54396 100644 ---- a/src/cmd/go/go_test.go -+++ b/src/cmd/go/go_test.go -@@ -188,7 +188,11 @@ func (tg *testgoData) cd(dir string) { - if tg.wd == "" { - tg.wd = tg.pwd() - } -+ abs, err := filepath.Abs(dir) - tg.must(os.Chdir(dir)) -+ if err == nil { -+ tg.setenv("PWD", abs) -+ } - } - - // sleep sleeps for one tick, where a tick is a conservative estimate diff --git a/go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch b/go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch new file mode 100644 index 0000000..9b348ad --- /dev/null +++ b/go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch @@ -0,0 +1,13 @@ +diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go +index 60d2734..b16540f 100644 +--- a/src/syscall/exec_linux_test.go ++++ b/src/syscall/exec_linux_test.go +@@ -89,7 +89,7 @@ func kernelVersion(t *testing.T) (int, int) { + return major, minor + } + +-func TestCloneNEWUSERAndRemapNoRootDisableSetgroups(t *testing.T) { ++func testCloneNEWUSERAndRemapNoRootDisableSetgroups(t *testing.T) { + if os.Getuid() == 0 { + t.Skip("skipping unprivileged user only test") + } diff --git a/golang-1.2-remove-ECC-p224.patch b/golang-1.2-remove-ECC-p224.patch index a1dc26d..85abbb3 100644 --- a/golang-1.2-remove-ECC-p224.patch +++ b/golang-1.2-remove-ECC-p224.patch @@ -1,3 +1,9 @@ +commit f8eb1e50541c8a9e55545d7470dbeab96073a632 +Author: Vincent Batts +Date: Thu Jul 16 11:38:45 2015 -0400 + + p224 + diff --git a/api/go1.txt b/api/go1.txt index 5e3dea5..1a1ee83 100644 --- a/api/go1.txt @@ -98,7 +104,7 @@ index f3b84e1..ca0b7cf 100644 initP384() initP521() diff --git a/src/crypto/elliptic/elliptic_test.go b/src/crypto/elliptic/elliptic_test.go -index 7e27913..0051d53 100644 +index 7e27913..e0034fc 100644 --- a/src/crypto/elliptic/elliptic_test.go +++ b/src/crypto/elliptic/elliptic_test.go @@ -6,27 +6,25 @@ package elliptic @@ -240,16 +246,16 @@ index 7e27913..0051d53 100644 func TestMarshal(t *testing.T) { - p224 := P224() - _, x, y, err := GenerateKey(p224, rand.Reader) -+ p254 := P254() -+ _, x, y, err := GenerateKey(p254, rand.Reader) ++ p256 := P256() ++ _, x, y, err := GenerateKey(p256, rand.Reader) if err != nil { t.Error(err) return } - serialized := Marshal(p224, x, y) - xx, yy := Unmarshal(p224, serialized) -+ serialized := Marshal(p254, x, y) -+ xx, yy := Unmarshal(p254, serialized) ++ serialized := Marshal(p256, x, y) ++ xx, yy := Unmarshal(p256, serialized) if xx == nil { t.Error("failed to unmarshal") return @@ -1114,7 +1120,7 @@ index 83f9916..dea8589 100644 priv, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) case "P384": diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go -index be6c013..aa55f55 100644 +index be6c013..428053a 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go @@ -308,9 +308,6 @@ func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm @@ -1153,13 +1159,12 @@ index be6c013..aa55f55 100644 case elliptic.P256(): return oidNamedCurveP256, true case elliptic.P384(): -@@ -1466,9 +1458,6 @@ func signingParamsForPublicKey(pub interface{}, requestedSigAlgo SignatureAlgori +@@ -1466,7 +1458,7 @@ func signingParamsForPublicKey(pub interface{}, requestedSigAlgo SignatureAlgori pubType = ECDSA switch pub.Curve { - case elliptic.P224(), elliptic.P256(): -- hashFunc = crypto.SHA256 -- sigAlgo.Algorithm = oidSignatureECDSAWithSHA256 ++ case elliptic.P256(): + hashFunc = crypto.SHA256 + sigAlgo.Algorithm = oidSignatureECDSAWithSHA256 case elliptic.P384(): - hashFunc = crypto.SHA384 - sigAlgo.Algorithm = oidSignatureECDSAWithSHA384 diff --git a/golang.spec b/golang.spec index a9bdda2..e3e3cde 100644 --- a/golang.spec +++ b/golang.spec @@ -37,11 +37,11 @@ %endif %global go_api 1.5 -%global go_version 1.5beta1 +%global go_version 1.5beta2 Name: golang Version: 1.4.99 -Release: 2.%{go_version}%{?dist} +Release: 3.%{go_version}%{?dist} Summary: The Go Programming Language License: BSD @@ -74,10 +74,9 @@ Patch1: golang-1.2-remove-ECC-p224.patch # https://github.com/golang/go/issues/11214 Patch213: go1.5beta1-disable-TestGdbPython.patch -# disable TestVendorRun and TestVendorGOPATH -# https://github.com/golang/go/commit/9adf684686bad7c6319080d0b1da8308a77b08c9 -Patch214: go1.5beta1-fix-TestVendorRun.patch - +# disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups +# this is not possible in the limitied build chroot +Patch214: go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -211,7 +210,7 @@ end # disable TestGdbPython %patch213 -p1 -# disable TestVendorRun and TestVendorGOPATH +# disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups %patch214 -p1 %build @@ -230,7 +229,9 @@ export GOHOSTARCH=%{gohostarch} pushd src # use our gcc options for this build, but store gcc as default for compiler -CC="gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS" \ +CFLAGS="$RPM_OPT_FLAGS" \ +LDFLAGS="$RPM_LD_FLAGS" \ +CC="gcc" \ CC_FOR_TARGET="gcc" \ GOOS=linux \ GOARCH=%{gohostarch} \ @@ -338,10 +339,12 @@ cd src # XXX reenable. likely go1.5beta2 https://github.com/golang/go/commit/9adf684686bad7c6319080d0b1da8308a77b08c9 #CGO_ENABLED=0 ./run.bash --no-rebuild -#CC="gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS" \ -CC="gcc $RPM_LD_FLAGS" \ -CC_FOR_TARGET="gcc" \ - #./run.bash --no-rebuild + +#CFLAGS="$RPM_OPT_FLAGS" \ +#LDFLAGS="$RPM_LD_FLAGS" \ +#CC="gcc" \ +#CC_FOR_TARGET="gcc" \ +#./run.bash --no-rebuild cd .. @@ -408,6 +411,9 @@ fi %changelog +* Fri Jul 10 2015 Vincent Batts - 1.4.99-3.1.5beta2 +- updating to go1.5beta2 + * Fri Jul 10 2015 Vincent Batts - 1.4.99-2.1.5beta1 - add checksum to sources and fixed one patch diff --git a/sources b/sources index b580140..10af7ac 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar aa82b90515edd1fa814e5ecb4ee771a4 go1.5beta1.src.tar.gz +a1389a16aeecd934fc175e4a57f59417 go1.5beta2.src.tar.gz From 0eec149c76ce18eb4082e5820a064224b50b0c23 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 17 Jul 2015 16:45:01 -0400 Subject: [PATCH 05/25] adding test output, but not failing on it for now --- golang.spec | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/golang.spec b/golang.spec index e3e3cde..c138c24 100644 --- a/golang.spec +++ b/golang.spec @@ -340,11 +340,10 @@ cd src # XXX reenable. likely go1.5beta2 https://github.com/golang/go/commit/9adf684686bad7c6319080d0b1da8308a77b08c9 #CGO_ENABLED=0 ./run.bash --no-rebuild -#CFLAGS="$RPM_OPT_FLAGS" \ -#LDFLAGS="$RPM_LD_FLAGS" \ -#CC="gcc" \ -#CC_FOR_TARGET="gcc" \ -#./run.bash --no-rebuild +CC="gcc" \ +CFLAGS="$RPM_OPT_FLAGS" \ +LDFLAGS="$RPM_LD_FLAGS" \ +./run.bash --no-rebuild -v -k ||: cd .. From 6da96f97165a165927ec1488ef35f2215409c308 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 17 Jul 2015 16:46:03 -0400 Subject: [PATCH 06/25] bump release --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index c138c24..7c68a82 100644 --- a/golang.spec +++ b/golang.spec @@ -41,7 +41,7 @@ Name: golang Version: 1.4.99 -Release: 3.%{go_version}%{?dist} +Release: 4.%{go_version}%{?dist} Summary: The Go Programming Language License: BSD @@ -410,6 +410,9 @@ fi %changelog +* Fri Jul 17 2015 Vincent Batts - 1.4.99-4.1.5beta2 +- adding test output, for visibility + * Fri Jul 10 2015 Vincent Batts - 1.4.99-3.1.5beta2 - updating to go1.5beta2 From bb5db89cf5b2a6664b5685e23ec2014f36069506 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 29 Jul 2015 10:48:47 -0400 Subject: [PATCH 07/25] fix the prerelease versioning --- golang.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/golang.spec b/golang.spec index 7c68a82..d289d44 100644 --- a/golang.spec +++ b/golang.spec @@ -40,8 +40,8 @@ %global go_version 1.5beta2 Name: golang -Version: 1.4.99 -Release: 4.%{go_version}%{?dist} +Version: 1.5 +Release: 0.5.beta2%{?dist} Summary: The Go Programming Language License: BSD @@ -410,6 +410,9 @@ fi %changelog +* Tue Jul 28 2015 Lokesh Mandvekar - 1.5-0.5.beta2 +- correct package version and release tags as per naming guidelines + * Fri Jul 17 2015 Vincent Batts - 1.4.99-4.1.5beta2 - adding test output, for visibility From c1bee09f56aeaf5b41769a5106ed0267dbf812ad Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 30 Jul 2015 10:47:32 -0400 Subject: [PATCH 08/25] increase ELFRESERVE (bz1248071) --- golang.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index d289d44..8947113 100644 --- a/golang.spec +++ b/golang.spec @@ -41,7 +41,7 @@ Name: golang Version: 1.5 -Release: 0.5.beta2%{?dist} +Release: 0.6.beta2%{?dist} Summary: The Go Programming Language License: BSD @@ -78,6 +78,10 @@ Patch213: go1.5beta1-disable-TestGdbPython.patch # this is not possible in the limitied build chroot Patch214: go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch +# debuginfo doesn't fit in the 3072 reserved space for ELF headers +# https://bugzilla.redhat.com/show_bug.cgi?id=1248071 +Patch215: golang/go1.5beta2-increase-elfreserve-for-debug.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -213,6 +217,9 @@ end # disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups %patch214 -p1 +# ELFRESERVE +%patch215 -p1 + %build # go1.5 bootstrapping. The compiler is written in golang. export GOROOT_BOOTSTRAP=%{goroot} @@ -410,6 +417,9 @@ fi %changelog +* Thu Jul 30 2015 Vincent Batts - 1.5-0.6.beta2 +- increase ELFRESERVE (bz1248071) + * Tue Jul 28 2015 Lokesh Mandvekar - 1.5-0.5.beta2 - correct package version and release tags as per naming guidelines From 78d9b3d3acdc079f0948dd6e6a3102db2509a76d Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 30 Jul 2015 11:01:17 -0400 Subject: [PATCH 09/25] add the patch .. --- go1.5beta2-increase-elfreserve-for-debug.patch | 13 +++++++++++++ golang.spec | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 go1.5beta2-increase-elfreserve-for-debug.patch diff --git a/go1.5beta2-increase-elfreserve-for-debug.patch b/go1.5beta2-increase-elfreserve-for-debug.patch new file mode 100644 index 0000000..55027df --- /dev/null +++ b/go1.5beta2-increase-elfreserve-for-debug.patch @@ -0,0 +1,13 @@ +diff --git a/src/cmd/link/internal/ld/elf.go b/src/cmd/link/internal/ld/elf.go +index cf52f2e..7cdb8c4 100644 +--- a/src/cmd/link/internal/ld/elf.go ++++ b/src/cmd/link/internal/ld/elf.go +@@ -713,7 +713,7 @@ var Elfstrdat []byte + * On FreeBSD, cannot be larger than a page. + */ + const ( +- ELFRESERVE = 3072 ++ ELFRESERVE = 3104 + ) + + /* diff --git a/golang.spec b/golang.spec index 8947113..5f37641 100644 --- a/golang.spec +++ b/golang.spec @@ -41,7 +41,7 @@ Name: golang Version: 1.5 -Release: 0.6.beta2%{?dist} +Release: 0.7.beta2%{?dist} Summary: The Go Programming Language License: BSD @@ -417,6 +417,9 @@ fi %changelog +* Thu Jul 30 2015 Vincent Batts - 1.5-0.7.beta2 +- add the patch .. + * Thu Jul 30 2015 Vincent Batts - 1.5-0.6.beta2 - increase ELFRESERVE (bz1248071) From 9fc0bc41c872e50c24a983da4fb45616ce750392 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 30 Jul 2015 11:27:23 -0400 Subject: [PATCH 10/25] updating to go1.5beta3 --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4e43c07..487a064 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /go1.5beta1.src.tar.gz /golang-19087:a15f344a9efa-xattrs.tar /go1.5beta2.src.tar.gz +/go1.5beta3.src.tar.gz diff --git a/golang.spec b/golang.spec index 5f37641..0ab66a7 100644 --- a/golang.spec +++ b/golang.spec @@ -37,11 +37,11 @@ %endif %global go_api 1.5 -%global go_version 1.5beta2 +%global go_version 1.5beta3 Name: golang Version: 1.5 -Release: 0.7.beta2%{?dist} +Release: 0.8.beta3%{?dist} Summary: The Go Programming Language License: BSD @@ -417,6 +417,9 @@ fi %changelog +* Thu Jul 30 2015 Vincent Batts - 1.5-0.8.beta3 +- updating to go1.5beta3 + * Thu Jul 30 2015 Vincent Batts - 1.5-0.7.beta2 - add the patch .. diff --git a/sources b/sources index 10af7ac..af9ef51 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar aa82b90515edd1fa814e5ecb4ee771a4 go1.5beta1.src.tar.gz a1389a16aeecd934fc175e4a57f59417 go1.5beta2.src.tar.gz +0020be59b7711307ebd37ac116a6ee34 go1.5beta3.src.tar.gz From f2f58b5244dc3f22fa7801ba752ab567712aa699 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 4 Aug 2015 15:51:06 -0400 Subject: [PATCH 11/25] tar fix from upstream --- go1.3beta3-tar-hardlink-fix.patch | 33 +++++++++++++++++++++++++++++++ golang.spec | 12 ++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 go1.3beta3-tar-hardlink-fix.patch diff --git a/go1.3beta3-tar-hardlink-fix.patch b/go1.3beta3-tar-hardlink-fix.patch new file mode 100644 index 0000000..a1b0bbd --- /dev/null +++ b/go1.3beta3-tar-hardlink-fix.patch @@ -0,0 +1,33 @@ +commit a1d093d95dfb888e55f960943bd3ad3d181ec743 +Author: Vincent Batts +Date: Mon Aug 3 12:26:38 2015 -0400 + + archive/tar: don't treat multiple file system links as a tar hardlink + + Do not assume that if stat shows multiple links that we should mark the + file as a hardlink in the tar format. If the hardlink link was not + referenced, this caused a link to "/". On an overlay file system, all + files have multiple links. + + The caller must keep the inode references and set TypeLink, Size = 0, + and LinkName themselves. + + Change-Id: I873b8a235bc8f8fbb271db74ee54232da36ca013 + Reviewed-on: https://go-review.googlesource.com/13045 + Reviewed-by: Ian Lance Taylor + +diff --git a/src/archive/tar/stat_unix.go b/src/archive/tar/stat_unix.go +index 27d112f..cb843db 100644 +--- a/src/archive/tar/stat_unix.go ++++ b/src/archive/tar/stat_unix.go +@@ -28,10 +28,5 @@ func statUnix(fi os.FileInfo, h *Header) error { + h.AccessTime = statAtime(sys) + h.ChangeTime = statCtime(sys) + // TODO(bradfitz): major/minor device numbers? +- if fi.Mode().IsRegular() && sys.Nlink > 1 { +- h.Typeflag = TypeLink +- h.Size = 0 +- // TODO(vbatts): Linkname? +- } + return nil + } diff --git a/golang.spec b/golang.spec index 0ab66a7..3641f87 100644 --- a/golang.spec +++ b/golang.spec @@ -41,7 +41,7 @@ Name: golang Version: 1.5 -Release: 0.8.beta3%{?dist} +Release: 0.9.beta3%{?dist} Summary: The Go Programming Language License: BSD @@ -82,6 +82,10 @@ Patch214: go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroup # https://bugzilla.redhat.com/show_bug.cgi?id=1248071 Patch215: golang/go1.5beta2-increase-elfreserve-for-debug.patch +# upstream commit that fixes hardlinks in archive/tar +# should be included in go1.5 +Patch216: go1.3beta3-tar-hardlink-fix.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -220,6 +224,9 @@ end # ELFRESERVE %patch215 -p1 +# archive/tar hardlinks +%patch216 -p1 + %build # go1.5 bootstrapping. The compiler is written in golang. export GOROOT_BOOTSTRAP=%{goroot} @@ -417,6 +424,9 @@ fi %changelog +* Tue Aug 04 2015 Vincent Batts - 1.5-0.9.beta3 +- pull in upstream archive/tar fix + * Thu Jul 30 2015 Vincent Batts - 1.5-0.8.beta3 - updating to go1.5beta3 From 831ba34f7437b279e27e486bf80ec3c5b2b95244 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 6 Aug 2015 15:48:15 -0400 Subject: [PATCH 12/25] updating to go1.5rc1 --- go1.3beta3-tar-hardlink-fix.patch | 33 ------------------- ...5beta2-increase-elfreserve-for-debug.patch | 13 -------- golang.spec | 24 ++++---------- 3 files changed, 7 insertions(+), 63 deletions(-) delete mode 100644 go1.3beta3-tar-hardlink-fix.patch delete mode 100644 go1.5beta2-increase-elfreserve-for-debug.patch diff --git a/go1.3beta3-tar-hardlink-fix.patch b/go1.3beta3-tar-hardlink-fix.patch deleted file mode 100644 index a1b0bbd..0000000 --- a/go1.3beta3-tar-hardlink-fix.patch +++ /dev/null @@ -1,33 +0,0 @@ -commit a1d093d95dfb888e55f960943bd3ad3d181ec743 -Author: Vincent Batts -Date: Mon Aug 3 12:26:38 2015 -0400 - - archive/tar: don't treat multiple file system links as a tar hardlink - - Do not assume that if stat shows multiple links that we should mark the - file as a hardlink in the tar format. If the hardlink link was not - referenced, this caused a link to "/". On an overlay file system, all - files have multiple links. - - The caller must keep the inode references and set TypeLink, Size = 0, - and LinkName themselves. - - Change-Id: I873b8a235bc8f8fbb271db74ee54232da36ca013 - Reviewed-on: https://go-review.googlesource.com/13045 - Reviewed-by: Ian Lance Taylor - -diff --git a/src/archive/tar/stat_unix.go b/src/archive/tar/stat_unix.go -index 27d112f..cb843db 100644 ---- a/src/archive/tar/stat_unix.go -+++ b/src/archive/tar/stat_unix.go -@@ -28,10 +28,5 @@ func statUnix(fi os.FileInfo, h *Header) error { - h.AccessTime = statAtime(sys) - h.ChangeTime = statCtime(sys) - // TODO(bradfitz): major/minor device numbers? -- if fi.Mode().IsRegular() && sys.Nlink > 1 { -- h.Typeflag = TypeLink -- h.Size = 0 -- // TODO(vbatts): Linkname? -- } - return nil - } diff --git a/go1.5beta2-increase-elfreserve-for-debug.patch b/go1.5beta2-increase-elfreserve-for-debug.patch deleted file mode 100644 index 55027df..0000000 --- a/go1.5beta2-increase-elfreserve-for-debug.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/cmd/link/internal/ld/elf.go b/src/cmd/link/internal/ld/elf.go -index cf52f2e..7cdb8c4 100644 ---- a/src/cmd/link/internal/ld/elf.go -+++ b/src/cmd/link/internal/ld/elf.go -@@ -713,7 +713,7 @@ var Elfstrdat []byte - * On FreeBSD, cannot be larger than a page. - */ - const ( -- ELFRESERVE = 3072 -+ ELFRESERVE = 3104 - ) - - /* diff --git a/golang.spec b/golang.spec index 3641f87..ecfc1f8 100644 --- a/golang.spec +++ b/golang.spec @@ -37,11 +37,11 @@ %endif %global go_api 1.5 -%global go_version 1.5beta3 +%global go_version 1.5rc1 Name: golang Version: 1.5 -Release: 0.9.beta3%{?dist} +Release: 0.10.rc1%{?dist} Summary: The Go Programming Language License: BSD @@ -78,14 +78,6 @@ Patch213: go1.5beta1-disable-TestGdbPython.patch # this is not possible in the limitied build chroot Patch214: go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch -# debuginfo doesn't fit in the 3072 reserved space for ELF headers -# https://bugzilla.redhat.com/show_bug.cgi?id=1248071 -Patch215: golang/go1.5beta2-increase-elfreserve-for-debug.patch - -# upstream commit that fixes hardlinks in archive/tar -# should be included in go1.5 -Patch216: go1.3beta3-tar-hardlink-fix.patch - # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -221,12 +213,6 @@ end # disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups %patch214 -p1 -# ELFRESERVE -%patch215 -p1 - -# archive/tar hardlinks -%patch216 -p1 - %build # go1.5 bootstrapping. The compiler is written in golang. export GOROOT_BOOTSTRAP=%{goroot} @@ -357,7 +343,7 @@ cd src CC="gcc" \ CFLAGS="$RPM_OPT_FLAGS" \ LDFLAGS="$RPM_LD_FLAGS" \ -./run.bash --no-rebuild -v -k ||: +./run.bash --no-rebuild -v -k cd .. @@ -424,6 +410,10 @@ fi %changelog +* Thu Aug 06 2015 Vincent Batts - 1.5-0.10.rc1 +- updating to go1.5rc1 +- checks are back in place + * Tue Aug 04 2015 Vincent Batts - 1.5-0.9.beta3 - pull in upstream archive/tar fix From 03b73e2ea51ca9028ad2e88757003f7fdffd452d Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 6 Aug 2015 17:22:56 -0400 Subject: [PATCH 13/25] fixing sources reference --- .gitignore | 1 + golang.spec | 5 ++++- sources | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 487a064..1b2ab81 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /golang-19087:a15f344a9efa-xattrs.tar /go1.5beta2.src.tar.gz /go1.5beta3.src.tar.gz +/go1.5rc1.src.tar.gz diff --git a/golang.spec b/golang.spec index ecfc1f8..8ea0170 100644 --- a/golang.spec +++ b/golang.spec @@ -41,7 +41,7 @@ Name: golang Version: 1.5 -Release: 0.10.rc1%{?dist} +Release: 0.11.rc1%{?dist} Summary: The Go Programming Language License: BSD @@ -410,6 +410,9 @@ fi %changelog +* Thu Aug 06 2015 Vincent Batts - 1.5-0.11.rc1 +- fixing the sources reference + * Thu Aug 06 2015 Vincent Batts - 1.5-0.10.rc1 - updating to go1.5rc1 - checks are back in place diff --git a/sources b/sources index af9ef51..b72cabf 100644 --- a/sources +++ b/sources @@ -2,3 +2,4 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar aa82b90515edd1fa814e5ecb4ee771a4 go1.5beta1.src.tar.gz a1389a16aeecd934fc175e4a57f59417 go1.5beta2.src.tar.gz 0020be59b7711307ebd37ac116a6ee34 go1.5beta3.src.tar.gz +778f51addfb8ddaf61ed0165a534d4e3 go1.5rc1.src.tar.gz From 0d13e2d9047cb7de2d64f95f0bc5c013f4cc3257 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 20 Aug 2015 22:05:16 +0000 Subject: [PATCH 14/25] update to go1.5 --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1b2ab81..7995a4a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ /go1.5beta2.src.tar.gz /go1.5beta3.src.tar.gz /go1.5rc1.src.tar.gz +/go1.5.src.tar.gz diff --git a/golang.spec b/golang.spec index 8ea0170..54dbf83 100644 --- a/golang.spec +++ b/golang.spec @@ -37,11 +37,11 @@ %endif %global go_api 1.5 -%global go_version 1.5rc1 +%global go_version 1.5 Name: golang Version: 1.5 -Release: 0.11.rc1%{?dist} +Release: 1%{?dist} Summary: The Go Programming Language License: BSD @@ -410,6 +410,9 @@ fi %changelog +* Thu Aug 20 2015 Vincent Batts - 1.5-1 +- updating to go1.5 + * Thu Aug 06 2015 Vincent Batts - 1.5-0.11.rc1 - fixing the sources reference diff --git a/sources b/sources index b72cabf..426a154 100644 --- a/sources +++ b/sources @@ -3,3 +3,4 @@ aa82b90515edd1fa814e5ecb4ee771a4 go1.5beta1.src.tar.gz a1389a16aeecd934fc175e4a57f59417 go1.5beta2.src.tar.gz 0020be59b7711307ebd37ac116a6ee34 go1.5beta3.src.tar.gz 778f51addfb8ddaf61ed0165a534d4e3 go1.5rc1.src.tar.gz +3f072baece07fa42d18376419afad323 go1.5.src.tar.gz From 19dca7ffd347374cf4b6520333a87832cc45b40a Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 23 Aug 2015 19:58:43 +0100 Subject: [PATCH 15/25] Drop incorrect change for hostname location. The hostname binary moved place in Fedora 17 as part of the usr move feature and /bin is symlinked to /usr/bin. Just specify the actualy proper package name instead of a specific binary path. Cleanup sources file just to include the current source. Please use "fedpkg new-sources" command to properly upload sources. Otherwise each time a build is done, or even "fedpra srpm" or "fedpkg prep" it downloads all the sources specified in the file --- golang-f21-hostname.patch | 11 ----------- golang.spec | 15 ++------------- sources | 5 ----- 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 golang-f21-hostname.patch diff --git a/golang-f21-hostname.patch b/golang-f21-hostname.patch deleted file mode 100644 index 730e8a8..0000000 --- a/golang-f21-hostname.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/os/os_test.go.orig 2014-02-20 13:14:45.543644182 -0600 -+++ src/os/os_test.go 2014-02-20 13:14:55.934813622 -0600 -@@ -854,7 +854,7 @@ - t.Fatal(err) - } - defer r.Close() -- p, err := StartProcess("/bin/hostname", []string{"hostname"}, &ProcAttr{Files: []*File{nil, w, Stderr}}) -+ p, err := StartProcess("/usr/bin/hostname", []string{"hostname"}, &ProcAttr{Files: []*File{nil, w, Stderr}}) - if err != nil { - t.Fatal(err) - } diff --git a/golang.spec b/golang.spec index 54dbf83..a3b0a62 100644 --- a/golang.spec +++ b/golang.spec @@ -50,16 +50,9 @@ Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz # go1.5 bootstrapping. The compiler is written in golang. BuildRequires: golang > 1.4 +BuildRequires: hostname # use the arch dependent path in the bootstrap -Patch212: ./golang-1.5-bootstrap-binary-path.patch - -# this command moved places -%if 0%{?fedora} >= 21 -BuildRequires: /usr/bin/hostname -Patch210: golang-f21-hostname.patch -%else -BuildRequires: /bin/hostname -%endif +Patch212: golang-1.5-bootstrap-binary-path.patch Provides: go = %{version}-%{release} Requires: %{name}-bin @@ -194,10 +187,6 @@ end %prep %setup -q -n go -%if 0%{?fedora} >= 21 -%patch210 -p0 -%endif - # increase verbosity of build %patch0 -p1 diff --git a/sources b/sources index 426a154..259d362 100644 --- a/sources +++ b/sources @@ -1,6 +1 @@ -d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar -aa82b90515edd1fa814e5ecb4ee771a4 go1.5beta1.src.tar.gz -a1389a16aeecd934fc175e4a57f59417 go1.5beta2.src.tar.gz -0020be59b7711307ebd37ac116a6ee34 go1.5beta3.src.tar.gz -778f51addfb8ddaf61ed0165a534d4e3 go1.5rc1.src.tar.gz 3f072baece07fa42d18376419afad323 go1.5.src.tar.gz From 79fd860ddc450ca46f6b5c233d8e1da7736ce831 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 23 Aug 2015 20:26:31 +0100 Subject: [PATCH 16/25] Add pcre-devel for tests fannkuch-parallel Package libpcre was not found in the pkg-config search path. Perhaps you should add the directory containing `libpcre.pc' to the PKG_CONFIG_PATH environment variable No package 'libpcre' found --- golang.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/golang.spec b/golang.spec index a3b0a62..0e496d0 100644 --- a/golang.spec +++ b/golang.spec @@ -50,6 +50,7 @@ Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz # go1.5 bootstrapping. The compiler is written in golang. BuildRequires: golang > 1.4 +BuildRequires: pcre-devel BuildRequires: hostname # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch From b869aad6293478564047d9a377419576d886f499 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 23 Aug 2015 20:49:44 +0100 Subject: [PATCH 17/25] Enable aarch64 --- golang.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/golang.spec b/golang.spec index 0e496d0..a39f62f 100644 --- a/golang.spec +++ b/golang.spec @@ -25,7 +25,7 @@ # let this match the macros in macros.golang %global goroot /usr/lib/%{name} %global gopath %{_datadir}/gocode -%global go_arches %{ix86} x86_64 %{arm} +%global go_arches %{ix86} x86_64 %{arm} aarch64 %ifarch x86_64 %global gohostarch amd64 %endif @@ -35,13 +35,16 @@ %ifarch %{arm} %global gohostarch arm %endif +%ifarch aarch64 +%global gohostarch arm64 +%endif %global go_api 1.5 %global go_version 1.5 Name: golang Version: 1.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language License: BSD @@ -400,6 +403,10 @@ fi %changelog +* Sun Aug 23 2015 Peter Robinson 1.5-2 +- Enable aarch64 +- Minor cleanups + * Thu Aug 20 2015 Vincent Batts - 1.5-1 - updating to go1.5 From 9297305de11b8633fb9e3e07e7d3a705ba2bc1aa Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 25 Aug 2015 13:50:08 -0400 Subject: [PATCH 18/25] go1.5 supports shared objects Now we'll provide the libstd.so for all of golang's stdlib. This way, libraries and binaries can link against it and have a better security update story. --- golang.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/golang.spec b/golang.spec index a39f62f..7b18172 100644 --- a/golang.spec +++ b/golang.spec @@ -231,6 +231,9 @@ GOARCH=%{gohostarch} \ ./make.bash --no-clean popd +# golang shared objects for stdlib +GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std + %install rm -rf $RPM_BUILD_ROOT From 01341969cc9c67ad3e2609b8c05f44ad1ddc2a56 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 25 Aug 2015 14:03:03 -0400 Subject: [PATCH 19/25] adding first class gopath URL bz1166611 --- golang.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/golang.spec b/golang.spec index 7b18172..e8914e5 100644 --- a/golang.spec +++ b/golang.spec @@ -290,10 +290,10 @@ ln -sf %{goroot}/bin/go $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/go ln -sf %{goroot}/bin/gofmt $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch}/gofmt # ensure these exist and are owned -mkdir -p $RPM_BUILD_ROOT%{gopath}/src/github.com/ -mkdir -p $RPM_BUILD_ROOT%{gopath}/src/bitbucket.org/ -mkdir -p $RPM_BUILD_ROOT%{gopath}/src/code.google.com/ -mkdir -p $RPM_BUILD_ROOT%{gopath}/src/code.google.com/p/ +mkdir -p $RPM_BUILD_ROOT%{gopath}/src/github.com +mkdir -p $RPM_BUILD_ROOT%{gopath}/src/bitbucket.org +mkdir -p $RPM_BUILD_ROOT%{gopath}/src/code.google.com/p +mkdir -p $RPM_BUILD_ROOT%{gopath}/src/golang.org/x # make sure these files exist and point to alternatives rm -f $RPM_BUILD_ROOT%{_bindir}/go @@ -377,6 +377,8 @@ fi %dir %{gopath}/src/bitbucket.org/ %dir %{gopath}/src/code.google.com/ %dir %{gopath}/src/code.google.com/p/ +%dir %{gopath}/src/golang.org +%dir %{gopath}/src/golang.org/x # gdbinit (for gdb debugging) From 3cb3b22c16cadf3ccce18cd726df16c53711d391 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 25 Aug 2015 14:10:59 -0400 Subject: [PATCH 20/25] fix zoneinfo test and cleanup others the find for tests files needed improving. Also fix the hostname // net-tools requirement --- go1.5-zoneinfo_testing_only.patch | 21 +++++++++++++++++++++ golang.spec | 27 +++++++++++++++++++-------- 2 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 go1.5-zoneinfo_testing_only.patch diff --git a/go1.5-zoneinfo_testing_only.patch b/go1.5-zoneinfo_testing_only.patch new file mode 100644 index 0000000..3e9cb5f --- /dev/null +++ b/go1.5-zoneinfo_testing_only.patch @@ -0,0 +1,21 @@ +diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go +index ed9502d..c2569e7 100644 +--- a/src/time/zoneinfo_unix.go ++++ b/src/time/zoneinfo_unix.go +@@ -32,14 +32,14 @@ var zoneDirs = []string{ + "/usr/share/zoneinfo/", + "/usr/share/lib/zoneinfo/", + "/usr/lib/locale/TZ/", +- runtime.GOROOT() + "/lib/time/zoneinfo.zip", + } + + var origZoneDirs = zoneDirs + + func forceZipFileForTesting(zipOnly bool) { +- zoneDirs = make([]string, len(origZoneDirs)) ++ zoneDirs = make([]string, len(origZoneDirs)+1) + copy(zoneDirs, origZoneDirs) ++ zoneDirs = append(zoneDirs, runtime.GOROOT()+"/lib/time/zoneinfo.zip") + if zipOnly { + for i := 0; i < len(zoneDirs)-1; i++ { + zoneDirs[i] = "/XXXNOEXIST" diff --git a/golang.spec b/golang.spec index a39f62f..db669e5 100644 --- a/golang.spec +++ b/golang.spec @@ -44,7 +44,7 @@ Name: golang Version: 1.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Go Programming Language License: BSD @@ -54,7 +54,11 @@ Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz # go1.5 bootstrapping. The compiler is written in golang. BuildRequires: golang > 1.4 BuildRequires: pcre-devel +%if 0%{?rhel} == 6 || 0%{?fedora} < 23 +BuildRequires: net-tools +%else BuildRequires: hostname +%endif # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch @@ -75,6 +79,10 @@ Patch213: go1.5beta1-disable-TestGdbPython.patch # this is not possible in the limitied build chroot Patch214: go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch +# we had been just removing the zoneinfo.zip, but that caused tests to fail for users that +# later run `go test -a std`. This makes it only use the zoneinfo.zip where needed in tests. +Patch215: ./go1.5-zoneinfo_testing_only.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -258,8 +266,8 @@ tests_list=$cwd/go-tests.list rm -f $src_list $pkg_list $docs_list $misc_list $tests_list touch $src_list $pkg_list $docs_list $misc_list $tests_list pushd $RPM_BUILD_ROOT%{goroot} - find src/ -type d ! -ipath '*/testdata/*' -printf '%%%dir %{goroot}/%p\n' >> $src_list - find src/ ! -type d ! -ipath '*/testdata/*' ! -name '*_test.go' -printf '%{goroot}/%p\n' >> $src_list + find src/ -type d ! -name testdata -a ! -ipath '*/testdata/*' -printf '%%%dir %{goroot}/%p\n' >> $src_list + find src/ ! -type d ! -ipath '*/testdata/*' -a ! -name '*_test*.go' -printf '%{goroot}/%p\n' >> $src_list find bin/ pkg/ -type d -printf '%%%dir %{goroot}/%p\n' >> $pkg_list find bin/ pkg/ ! -type d -printf '%{goroot}/%p\n' >> $pkg_list @@ -270,13 +278,13 @@ pushd $RPM_BUILD_ROOT%{goroot} find misc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $misc_list find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list - find src/ -type d -ipath '*/testdata/*' -printf '%%%dir %{goroot}/%p\n' >> $tests_list - find src/ ! -type d -ipath '*/testdata/*' -o -name '*_test.go' -printf '%{goroot}/%p\n' >> $tests_list + find src/ -type d -name testdata -o -ipath '*/testdata/*' -printf '%%%dir %{goroot}/%p\n' >> $tests_list + find src/ ! -type d -ipath '*/testdata/*' -o -name '*_test*.go' -printf '%{goroot}/%p\n' >> $tests_list + # this is only the zoneinfo.zip + find lib/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list + find lib/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list popd -# remove the unnecessary zoneinfo file (Go will always use the system one first) -rm -rfv $RPM_BUILD_ROOT%{goroot}/lib/time - # remove the doc Makefile rm -rfv $RPM_BUILD_ROOT%{goroot}/doc/Makefile @@ -403,6 +411,9 @@ fi %changelog +* Tue Aug 25 2015 Vincent Batts - 1.5-3 +- only allow the golang zoneinfo.zip to be used in tests + * Sun Aug 23 2015 Peter Robinson 1.5-2 - Enable aarch64 - Minor cleanups From 32abaed9def7de4db9638213e31f2dbfe1e949f0 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 25 Aug 2015 14:14:36 -0400 Subject: [PATCH 21/25] more changelog message --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 2393e08..ec4734f 100644 --- a/golang.spec +++ b/golang.spec @@ -417,7 +417,10 @@ fi %changelog * Tue Aug 25 2015 Vincent Batts - 1.5-3 -- only allow the golang zoneinfo.zip to be used in tests +- bz1256910 only allow the golang zoneinfo.zip to be used in tests +- bz1166611 add golang.org/x directory +- bz1256525 include stdlib shared object. This will let other libraries and binaries + build with `go build -buildmode=shared -linkshared ...` or similar. * Sun Aug 23 2015 Peter Robinson 1.5-2 - Enable aarch64 From 1a6adea6fb7d78d96c4043cf43dbb3fd04bdd1f8 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 25 Aug 2015 15:29:59 -0400 Subject: [PATCH 22/25] *: fix hostname again, and testdata paths --- golang.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/golang.spec b/golang.spec index ec4734f..00b2f19 100644 --- a/golang.spec +++ b/golang.spec @@ -54,10 +54,10 @@ Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz # go1.5 bootstrapping. The compiler is written in golang. BuildRequires: golang > 1.4 BuildRequires: pcre-devel -%if 0%{?rhel} == 6 || 0%{?fedora} < 23 -BuildRequires: net-tools -%else +%if 0%{?rhel} > 6 || 0%{?fedora} > 0 BuildRequires: hostname +%else +BuildRequires: net-tools %endif # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch @@ -269,8 +269,8 @@ tests_list=$cwd/go-tests.list rm -f $src_list $pkg_list $docs_list $misc_list $tests_list touch $src_list $pkg_list $docs_list $misc_list $tests_list pushd $RPM_BUILD_ROOT%{goroot} - find src/ -type d ! -name testdata -a ! -ipath '*/testdata/*' -printf '%%%dir %{goroot}/%p\n' >> $src_list - find src/ ! -type d ! -ipath '*/testdata/*' -a ! -name '*_test*.go' -printf '%{goroot}/%p\n' >> $src_list + find src/ -type d -a \( ! -name testdata -a ! -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $src_list + find src/ ! -type d -a \( ! -ipath '*/testdata/*' -a ! -name '*_test*.go' \) -printf '%{goroot}/%p\n' >> $src_list find bin/ pkg/ -type d -printf '%%%dir %{goroot}/%p\n' >> $pkg_list find bin/ pkg/ ! -type d -printf '%{goroot}/%p\n' >> $pkg_list @@ -281,8 +281,8 @@ pushd $RPM_BUILD_ROOT%{goroot} find misc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $misc_list find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list - find src/ -type d -name testdata -o -ipath '*/testdata/*' -printf '%%%dir %{goroot}/%p\n' >> $tests_list - find src/ ! -type d -ipath '*/testdata/*' -o -name '*_test*.go' -printf '%{goroot}/%p\n' >> $tests_list + find src/ -type d -a \( -name testdata -o -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $tests_list + find src/ ! -type d -a \( -ipath '*/testdata/*' -o -name '*_test*.go' \) -printf '%{goroot}/%p\n' >> $tests_list # this is only the zoneinfo.zip find lib/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list find lib/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list From 12a31f182208216fee683d5583a6aa04327662a0 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 26 Aug 2015 14:55:29 -0400 Subject: [PATCH 23/25] more test fixes, and holding back on shared objects --- golang.spec | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/golang.spec b/golang.spec index 00b2f19..b094d19 100644 --- a/golang.spec +++ b/golang.spec @@ -44,7 +44,7 @@ Name: golang Version: 1.5 -Release: 3%{?dist} +Release: 4%{?dist} Summary: The Go Programming Language License: BSD @@ -239,8 +239,9 @@ GOARCH=%{gohostarch} \ ./make.bash --no-clean popd +# TODO get linux/386 support for shared objects. # golang shared objects for stdlib -GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std +#GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std %install rm -rf $RPM_BUILD_ROOT @@ -251,7 +252,7 @@ mkdir -p $RPM_BUILD_ROOT%{goroot} # install everything into libdir (until symlink problems are fixed) # https://code.google.com/p/go/issues/detail?id=5830 -cp -apv api bin doc favicon.ico lib pkg robots.txt src misc VERSION \ +cp -apv api bin doc favicon.ico lib pkg robots.txt src misc test VERSION \ $RPM_BUILD_ROOT%{goroot} # bz1099206 @@ -281,6 +282,8 @@ pushd $RPM_BUILD_ROOT%{goroot} find misc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $misc_list find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list + find test/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list + find test/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list find src/ -type d -a \( -name testdata -o -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $tests_list find src/ ! -type d -a \( -ipath '*/testdata/*' -o -name '*_test*.go' \) -printf '%{goroot}/%p\n' >> $tests_list # this is only the zoneinfo.zip @@ -416,6 +419,10 @@ fi %changelog +* Wed Aug 26 2015 Vincent Batts - 1.5-4 +- disable shared object until linux/386 is ironned out +- including the test/ directory for tests + * Tue Aug 25 2015 Vincent Batts - 1.5-3 - bz1256910 only allow the golang zoneinfo.zip to be used in tests - bz1166611 add golang.org/x directory From 7782fc08edc5bea14f360a4b2b56fc38cbb250db Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 27 Aug 2015 14:13:04 -0400 Subject: [PATCH 24/25] gdb runtime path fix --- golang-gdbinit | 2 +- golang.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/golang-gdbinit b/golang-gdbinit index 4ef690b..ecddca6 100644 --- a/golang-gdbinit +++ b/golang-gdbinit @@ -1 +1 @@ -add-auto-load-safe-path /usr/lib/golang/src/pkg/runtime/runtime-gdb.py +add-auto-load-safe-path /usr/lib/golang/src/runtime/runtime-gdb.py diff --git a/golang.spec b/golang.spec index b094d19..87d77e9 100644 --- a/golang.spec +++ b/golang.spec @@ -44,7 +44,7 @@ Name: golang Version: 1.5 -Release: 4%{?dist} +Release: 5%{?dist} Summary: The Go Programming Language License: BSD @@ -419,6 +419,9 @@ fi %changelog +* Thu Aug 27 2015 Vincent Batts - 1.5-5 +- bz991759 gdb path fix + * Wed Aug 26 2015 Vincent Batts - 1.5-4 - disable shared object until linux/386 is ironned out - including the test/ directory for tests From 418a760bf8c75438cfeb46361b1a8ad12c12a648 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 27 Aug 2015 17:29:16 -0400 Subject: [PATCH 25/25] adding x86_64 only shared objects --- golang.spec | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/golang.spec b/golang.spec index 87d77e9..50001fd 100644 --- a/golang.spec +++ b/golang.spec @@ -44,7 +44,7 @@ Name: golang Version: 1.5 -Release: 5%{?dist} +Release: 6%{?dist} Summary: The Go Programming Language License: BSD @@ -103,17 +103,6 @@ Source102: macros.golang %description %{summary}. - -# Restore this package if RPM gets fixed (bug #975909) -#%package data -#Summary: Required architecture-independent files for Go -#Requires: %{name} = %{version}-%{release} -#BuildArch: noarch -#Obsoletes: %{name}-docs < 1.1-4 -# -#%description data -#%{summary}. - %package docs Summary: Golang compiler docs Requires: %{name} = %{version}-%{release} @@ -139,8 +128,6 @@ BuildArch: noarch %description tests %{summary}. -## -# the source tree %package src Summary: Golang compiler source tree BuildArch: noarch @@ -195,6 +182,13 @@ for _,d in pairs({"api", "doc", "include", "lib", "src"}) do end end +%ifarch x86_64 +%package shared +Summary: Golang shared object libraries + +%description shared +%{summary}. +%endif %prep %setup -q -n go @@ -239,9 +233,11 @@ GOARCH=%{gohostarch} \ ./make.bash --no-clean popd +%ifarch x86_64 # TODO get linux/386 support for shared objects. # golang shared objects for stdlib -#GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std +GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std +%endif %install rm -rf $RPM_BUILD_ROOT @@ -264,17 +260,18 @@ find $RPM_BUILD_ROOT%{goroot}/pkg -exec touch -r $RPM_BUILD_ROOT%{goroot}/pkg "{ cwd=$(pwd) src_list=$cwd/go-src.list pkg_list=$cwd/go-pkg.list +shared_list=$cwd/go-shared.list misc_list=$cwd/go-misc.list docs_list=$cwd/go-docs.list tests_list=$cwd/go-tests.list -rm -f $src_list $pkg_list $docs_list $misc_list $tests_list -touch $src_list $pkg_list $docs_list $misc_list $tests_list +rm -f $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list +touch $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list pushd $RPM_BUILD_ROOT%{goroot} find src/ -type d -a \( ! -name testdata -a ! -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $src_list find src/ ! -type d -a \( ! -ipath '*/testdata/*' -a ! -name '*_test*.go' \) -printf '%{goroot}/%p\n' >> $src_list - find bin/ pkg/ -type d -printf '%%%dir %{goroot}/%p\n' >> $pkg_list - find bin/ pkg/ ! -type d -printf '%{goroot}/%p\n' >> $pkg_list + find bin/ pkg/ -type d -a ! -path '*_dynlink/*' -printf '%%%dir %{goroot}/%p\n' >> $pkg_list + find bin/ pkg/ ! -type d -a ! -path '*_dynlink/*' -printf '%{goroot}/%p\n' >> $pkg_list find doc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $docs_list find doc/ ! -type d -printf '%{goroot}/%p\n' >> $docs_list @@ -282,6 +279,11 @@ pushd $RPM_BUILD_ROOT%{goroot} find misc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $misc_list find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list +%ifarch x86_64 + find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list + find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list +%endif + find test/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list find test/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list find src/ -type d -a \( -name testdata -o -ipath '*/testdata/*' \) -printf '%%%dir %{goroot}/%p\n' >> $tests_list @@ -417,8 +419,14 @@ fi %{_bindir}/go %{_bindir}/gofmt +%ifarch x86_64 +%files -f go-shared.list shared +%endif %changelog +* Thu Aug 27 2015 Vincent Batts - 1.5-6 +- starting a shared object subpackage. This will be x86_64 only until upstream supports more arches shared objects. + * Thu Aug 27 2015 Vincent Batts - 1.5-5 - bz991759 gdb path fix