From 79fe1edc90f5894d5d77203827f45750f37fbe3e Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Fri, 30 Aug 2013 09:09:22 -0500 Subject: [PATCH 001/156] fix meta dependency on libc --- golang.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 90262e4..6381cf7 100644 --- a/golang.spec +++ b/golang.spec @@ -16,9 +16,16 @@ # Actually, don't strip at all since we are not even building debug packages and this corrupts the dwarf testdata %global __strip /bin/true +# rpmbuild magic to keep from having meta dependency on libc.so.6 +%define _use_internal_dependency_generator 0 +%define __find_requires %{nil} +%global debug_package %{nil} +%global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \ + /usr/lib/rpm/brp-compress + Name: golang Version: 1.1.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language License: BSD @@ -250,6 +257,9 @@ cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf %changelog +* Fri Aug 30 2013 Adam Miller - 1.1.2-2 +- fix the libc meta dependency (thanks to vbatts [at] redhat.com for the fix) + * Tue Aug 20 2013 Adam Miller - 1.1.2-1 - Update to latest upstream From 76d86a9d1a4138e64efb2456e10fce6c136db240 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 19 Sep 2013 10:53:46 -0500 Subject: [PATCH 002/156] el6 edits --- golang.spec | 62 +++++++++-------------------------------------------- 1 file changed, 10 insertions(+), 52 deletions(-) diff --git a/golang.spec b/golang.spec index 8e71ec8..8c69ed4 100644 --- a/golang.spec +++ b/golang.spec @@ -16,16 +16,9 @@ # Actually, don't strip at all since we are not even building debug packages and this corrupts the dwarf testdata %global __strip /bin/true -# rpmbuild magic to keep from having meta dependency on libc.so.6 -%define _use_internal_dependency_generator 0 -%define __find_requires %{nil} -%global debug_package %{nil} -%global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \ - /usr/lib/rpm/brp-compress - Name: golang Version: 1.1.2 -Release: 4%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language License: BSD @@ -33,7 +26,7 @@ URL: http://golang.org/ Source0: https://go.googlecode.com/files/go%{version}.src.tar.gz BuildRequires: /bin/hostname -BuildRequires: emacs xemacs xemacs-packages-extra +BuildRequires: emacs Patch0: golang-1.1-verbose-build.patch @@ -66,7 +59,6 @@ Source101: golang-prelink.conf %package vim Summary: Vim plugins for Go -Requires: vim-filesystem BuildArch: noarch %description vim @@ -82,16 +74,6 @@ BuildArch: noarch %{summary}. -%package -n xemacs-%{name} -Summary: XEmacs add-on package for Go -Requires: xemacs(bin) >= %{_xemacs_version} -Requires: xemacs-packages-extra -BuildArch: noarch - -%description -n xemacs-%{name} -%{summary}. - - # Workaround old RPM bug of symlink-replaced-with-dir failure %pretrans -p for _,d in pairs({"api", "doc", "include", "lib", "src"}) do @@ -109,9 +91,9 @@ end # increase verbosity of build %patch0 -p1 - %build # create a gcc wrapper to allow us to build with our own flags + mkdir zz cd zz echo -e "#!/bin/sh\n/usr/bin/gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS \"\$@\"" > mygcc @@ -128,6 +110,7 @@ export GOROOT_FINAL=%{_libdir}/%{name} # build cd src +rm *.rc ./make.bash cd .. @@ -138,15 +121,12 @@ cd doc make cd .. -# compile for emacs and xemacs +# compile for emacs cd misc mv emacs/go-mode-load.el emacs/%{name}-init.el -cp -av emacs xemacs %{_emacs_bytecompile} emacs/go-mode.el -%{_xemacs_bytecompile} xemacs/go-mode.el cd .. - %check export GOROOT=$(pwd -P) export PATH="$PATH":"$GOROOT"/bin @@ -154,7 +134,6 @@ cd src ./run.bash --no-rebuild cd .. - %install rm -rf $RPM_BUILD_ROOT @@ -193,12 +172,6 @@ mkdir -p $RPM_BUILD_ROOT%{_emacs_sitestartdir} cp -av misc/emacs/go-mode.* $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name} cp -av misc/emacs/%{name}-init.el $RPM_BUILD_ROOT%{_emacs_sitestartdir} -# misc/xemacs -mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitelispdir}/%{name} -mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitestartdir} -cp -av misc/xemacs/go-mode.* $RPM_BUILD_ROOT%{_xemacs_sitelispdir}/%{name} -cp -av misc/xemacs/%{name}-init.el $RPM_BUILD_ROOT%{_xemacs_sitestartdir} - # misc/vim mkdir -p $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles cp -av misc/vim/* $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles @@ -250,30 +223,15 @@ cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf %{_emacs_sitestartdir}/*.el -%files -n xemacs-%{name} -%doc AUTHORS CONTRIBUTORS LICENSE PATENTS -%{_xemacs_sitelispdir}/%{name} -%{_xemacs_sitestartdir}/*.el - - %changelog -* Fri Aug 30 2013 Adam Miller - 1.1.2-4 -- fix the libc meta dependency (thanks to vbatts [at] redhat.com for the fix) +* Fri Aug 16 2013 Adam Miller - 1.1.2-2 +- vim-filesystem only required for Fedora , vim-common owns those files in RHEL -* Tue Aug 27 2013 Adam Miller - 1.1.2-3 -- Revert incorrect merged changelog - -* Tue Aug 27 2013 Adam Miller - 1.1.2-2 -- This was reverted, just a placeholder changelog entry for bad merge - -* Tue Aug 20 2013 Adam Miller - 1.1.2-1 +* Fri Aug 16 2013 Adam Miller - 1.1.2-1 - Update to latest upstream -* Sat Aug 03 2013 Fedora Release Engineering - 1.1.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - -* Wed Jul 17 2013 Petr Pisar - 1.1.1-6 -- Perl 5.18 rebuild +* Fri Aug 16 2013 Adam Miller - 1.1.1-6 +- Remove xemacs bits for RHEL build * Wed Jul 10 2013 Adam Goode - 1.1.1-5 - Blacklist testdata files from prelink From 666ac20aadeec2aa9be92706e1d96313426b8267 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 19 Sep 2013 12:12:54 -0500 Subject: [PATCH 003/156] fix glibc meta dep, fix from vbatts --- golang.spec | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/golang.spec b/golang.spec index 8c69ed4..c04a2ec 100644 --- a/golang.spec +++ b/golang.spec @@ -16,6 +16,13 @@ # Actually, don't strip at all since we are not even building debug packages and this corrupts the dwarf testdata %global __strip /bin/true +# rpmbuild magic to keep from having meta dependency on libc.so.6 +%define _use_internal_dependency_generator 0 +%define __find_requires %{nil} +%global debug_package %{nil} +%global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \ + /usr/lib/rpm/brp-compress + Name: golang Version: 1.1.2 Release: 2%{?dist} @@ -224,6 +231,9 @@ cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf %changelog +* Thu Sep 19 2013 Adam Miller - 1.2.2-3 +- fix the libc meta dependency (thanks to vbatts [at] redhat.com for the fix) + * Fri Aug 16 2013 Adam Miller - 1.1.2-2 - vim-filesystem only required for Fedora , vim-common owns those files in RHEL From e3f1c1568cd58c7567b673a513aa7b67e2d0a102 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 19 Sep 2013 12:17:04 -0500 Subject: [PATCH 004/156] no with release bump goodness --- golang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index c04a2ec..9d96830 100644 --- a/golang.spec +++ b/golang.spec @@ -25,7 +25,7 @@ Name: golang Version: 1.1.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Go Programming Language License: BSD From a601655be19dda7a830d478ee4475a04a8dea111 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Fri, 20 Sep 2013 09:49:37 -0500 Subject: [PATCH 005/156] fix for BZ#1010271 --- golang-1.1.2-long-links.patch | 510 +++++++++++++++++++++++++++++++++ golang-1.1.2-ustar-split.patch | 62 ++++ golang.spec | 17 +- 3 files changed, 588 insertions(+), 1 deletion(-) create mode 100644 golang-1.1.2-long-links.patch create mode 100644 golang-1.1.2-ustar-split.patch diff --git a/golang-1.1.2-long-links.patch b/golang-1.1.2-long-links.patch new file mode 100644 index 0000000..85c3541 --- /dev/null +++ b/golang-1.1.2-long-links.patch @@ -0,0 +1,510 @@ +Index: src/pkg/archive/tar/common.go +=================================================================== +--- a/src/pkg/archive/tar/common.go ++++ b/src/pkg/archive/tar/common.go +@@ -13,6 +13,7 @@ + package tar + + import ( ++ "bytes" + "errors" + "fmt" + "os" +@@ -174,6 +175,23 @@ + c_ISSOCK = 0140000 // Socket + ) + ++// Keywords for the PAX Extended Header ++const ( ++ paxAtime = "atime" ++ paxCharset = "charset" ++ paxComment = "comment" ++ paxCtime = "ctime" // please note that ctime is not a valid pax header. ++ paxGid = "gid" ++ paxGname = "gname" ++ paxLinkpath = "linkpath" ++ paxMtime = "mtime" ++ paxPath = "path" ++ paxSize = "size" ++ paxUid = "uid" ++ paxUname = "uname" ++ paxNone = "" ++) ++ + // FileInfoHeader creates a partially-populated Header from fi. + // If fi describes a symlink, FileInfoHeader records link as the link target. + // If fi describes a directory, a slash is appended to the name. +@@ -257,3 +275,25 @@ + b, *sp = s[0:n], s[n:] + return + } ++ ++func isASCII(s string) bool { ++ for _, c := range s { ++ if c >= 0x80 { ++ return false ++ } ++ } ++ return true ++} ++ ++func toASCII(s string) string { ++ if isASCII(s) { ++ return s ++ } ++ var buf bytes.Buffer ++ for _, c := range s { ++ if c < 0x80 { ++ buf.WriteByte(byte(c)) ++ } ++ } ++ return buf.String() ++} +Index: src/pkg/archive/tar/reader.go +=================================================================== +--- a/src/pkg/archive/tar/reader.go ++++ b/src/pkg/archive/tar/reader.go +@@ -95,45 +95,45 @@ + func mergePAX(hdr *Header, headers map[string]string) error { + for k, v := range headers { + switch k { +- case "path": ++ case paxPath: + hdr.Name = v +- case "linkpath": ++ case paxLinkpath: + hdr.Linkname = v +- case "gname": ++ case paxGname: + hdr.Gname = v +- case "uname": ++ case paxUname: + hdr.Uname = v +- case "uid": ++ case paxUid: + uid, err := strconv.ParseInt(v, 10, 0) + if err != nil { + return err + } + hdr.Uid = int(uid) +- case "gid": ++ case paxGid: + gid, err := strconv.ParseInt(v, 10, 0) + if err != nil { + return err + } + hdr.Gid = int(gid) +- case "atime": ++ case paxAtime: + t, err := parsePAXTime(v) + if err != nil { + return err + } + hdr.AccessTime = t +- case "mtime": ++ case paxMtime: + t, err := parsePAXTime(v) + if err != nil { + return err + } + hdr.ModTime = t +- case "ctime": ++ case paxCtime: + t, err := parsePAXTime(v) + if err != nil { + return err + } + hdr.ChangeTime = t +- case "size": ++ case paxSize: + size, err := strconv.ParseInt(v, 10, 0) + if err != nil { + return err +Index: src/pkg/archive/tar/writer.go +=================================================================== +--- a/src/pkg/archive/tar/writer.go ++++ b/src/pkg/archive/tar/writer.go +@@ -24,6 +24,7 @@ + ErrFieldTooLong = errors.New("archive/tar: header field too long") + ErrWriteAfterClose = errors.New("archive/tar: write after close") + errNameTooLong = errors.New("archive/tar: name too long") ++ errInvalidHeader = errors.New("archive/tar: header field too long or contains invalid values") + ) + + // A Writer provides sequential writing of a tar archive in POSIX.1 format. +@@ -37,6 +38,7 @@ + pad int64 // amount of padding to write after current file entry + closed bool + usedBinary bool // whether the binary numeric field extension was used ++ preferPax bool // use pax header instead of binary numeric header + } + + // NewWriter creates a new Writer writing to w. +@@ -65,16 +67,23 @@ + } + + // Write s into b, terminating it with a NUL if there is room. +-func (tw *Writer) cString(b []byte, s string) { ++// If the value is too long for the field and allowPax is true add a paxheader record instead ++func (tw *Writer) cString(b []byte, s string, allowPax bool, paxKeyword string, paxHeaders map[string]string) { ++ needsPaxHeader := allowPax && len(s) > len(b) || !isASCII(s) ++ if needsPaxHeader { ++ paxHeaders[paxKeyword] = s ++ return ++ } + if len(s) > len(b) { + if tw.err == nil { + tw.err = ErrFieldTooLong + } + return + } +- copy(b, s) +- if len(s) < len(b) { +- b[len(s)] = 0 ++ ascii := toASCII(s) ++ copy(b, ascii) ++ if len(ascii) < len(b) { ++ b[len(ascii)] = 0 + } + } + +@@ -85,17 +94,27 @@ + for len(s)+1 < len(b) { + s = "0" + s + } +- tw.cString(b, s) ++ tw.cString(b, s, false, paxNone, nil) + } + + // Write x into b, either as octal or as binary (GNUtar/star extension). +-func (tw *Writer) numeric(b []byte, x int64) { ++// If the value is too long for the field and writingPax is enabled both for the field and the add a paxheader record instead ++func (tw *Writer) numeric(b []byte, x int64, allowPax bool, paxKeyword string, paxHeaders map[string]string) { + // Try octal first. + s := strconv.FormatInt(x, 8) + if len(s) < len(b) { + tw.octal(b, x) + return + } ++ ++ // If it is too long for octal, and pax is preferred, use a pax header ++ if allowPax && tw.preferPax { ++ tw.octal(b, 0) ++ s := strconv.FormatInt(x, 10) ++ paxHeaders[paxKeyword] = s ++ return ++ } ++ + // Too big: use binary (big-endian). + tw.usedBinary = true + for i := len(b) - 1; x > 0 && i >= 0; i-- { +@@ -115,6 +134,15 @@ + // WriteHeader calls Flush if it is not the first header. + // Calling after a Close will return ErrWriteAfterClose. + func (tw *Writer) WriteHeader(hdr *Header) error { ++ return tw.writeHeader(hdr, true) ++} ++ ++// WriteHeader writes hdr and prepares to accept the file's contents. ++// WriteHeader calls Flush if it is not the first header. ++// Calling after a Close will return ErrWriteAfterClose. ++// As this method is called internally by writePax header to allow it to ++// suppress writing the pax header. ++func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error { + if tw.closed { + return ErrWriteAfterClose + } +@@ -124,31 +152,21 @@ + if tw.err != nil { + return tw.err + } +- // Decide whether or not to use PAX extensions ++ ++ // a map to hold pax header records, if any are needed ++ paxHeaders := make(map[string]string) ++ + // TODO(shanemhansen): we might want to use PAX headers for + // subsecond time resolution, but for now let's just capture +- // the long name/long symlink use case. +- suffix := hdr.Name +- prefix := "" +- if len(hdr.Name) > fileNameSize || len(hdr.Linkname) > fileNameSize { +- var err error +- prefix, suffix, err = tw.splitUSTARLongName(hdr.Name) +- // Either we were unable to pack the long name into ustar format +- // or the link name is too long; use PAX headers. +- if err == errNameTooLong || len(hdr.Linkname) > fileNameSize { +- if err := tw.writePAXHeader(hdr); err != nil { +- return err +- } +- } else if err != nil { +- return err +- } +- } +- tw.nb = int64(hdr.Size) +- tw.pad = -tw.nb & (blockSize - 1) // blockSize is a power of two ++ // too long fields or non ascii characters + + header := make([]byte, blockSize) + s := slicer(header) +- tw.cString(s.next(fileNameSize), suffix) ++ ++ // keep a reference to the filename to allow to overwrite it later if we detect that we can use ustar longnames instead of pax ++ pathHeaderBytes := s.next(fileNameSize) ++ ++ tw.cString(pathHeaderBytes, hdr.Name, true, paxPath, paxHeaders) + + // Handle out of range ModTime carefully. + var modTime int64 +@@ -156,27 +174,55 @@ + modTime = hdr.ModTime.Unix() + } + +- tw.octal(s.next(8), hdr.Mode) // 100:108 +- tw.numeric(s.next(8), int64(hdr.Uid)) // 108:116 +- tw.numeric(s.next(8), int64(hdr.Gid)) // 116:124 +- tw.numeric(s.next(12), hdr.Size) // 124:136 +- tw.numeric(s.next(12), modTime) // 136:148 +- s.next(8) // chksum (148:156) +- s.next(1)[0] = hdr.Typeflag // 156:157 +- tw.cString(s.next(100), hdr.Linkname) // linkname (157:257) +- copy(s.next(8), []byte("ustar\x0000")) // 257:265 +- tw.cString(s.next(32), hdr.Uname) // 265:297 +- tw.cString(s.next(32), hdr.Gname) // 297:329 +- tw.numeric(s.next(8), hdr.Devmajor) // 329:337 +- tw.numeric(s.next(8), hdr.Devminor) // 337:345 +- tw.cString(s.next(155), prefix) // 345:500 ++ tw.octal(s.next(8), hdr.Mode) // 100:108 ++ tw.numeric(s.next(8), int64(hdr.Uid), true, paxUid, paxHeaders) // 108:116 ++ tw.numeric(s.next(8), int64(hdr.Gid), true, paxGid, paxHeaders) // 116:124 ++ tw.numeric(s.next(12), hdr.Size, true, paxSize, paxHeaders) // 124:136 ++ tw.numeric(s.next(12), modTime, false, paxNone, nil) // 136:148 --- consider using pax for finer granularity ++ s.next(8) // chksum (148:156) ++ s.next(1)[0] = hdr.Typeflag // 156:157 ++ ++ tw.cString(s.next(100), hdr.Linkname, true, paxLinkpath, paxHeaders) ++ ++ copy(s.next(8), []byte("ustar\x0000")) // 257:265 ++ tw.cString(s.next(32), hdr.Uname, true, paxUname, paxHeaders) // 265:297 ++ tw.cString(s.next(32), hdr.Gname, true, paxGname, paxHeaders) // 297:329 ++ tw.numeric(s.next(8), hdr.Devmajor, false, paxNone, nil) // 329:337 ++ tw.numeric(s.next(8), hdr.Devminor, false, paxNone, nil) // 337:345 ++ ++ // keep a reference to the prefix to allow to overwrite it later if we detect that we can use ustar longnames instead of pax ++ prefixHeaderBytes := s.next(155) ++ tw.cString(prefixHeaderBytes, "", false, paxNone, nil) // 345:500 prefix ++ + // Use the GNU magic instead of POSIX magic if we used any GNU extensions. + if tw.usedBinary { + copy(header[257:265], []byte("ustar \x00")) + } +- // Use the ustar magic if we used ustar long names. +- if len(prefix) > 0 { +- copy(header[257:265], []byte("ustar\000")) ++ ++ _, paxPathUsed := paxHeaders[paxPath] ++ // try to use a ustar header when only the name is too long ++ if !tw.preferPax && len(paxHeaders) == 1 && paxPathUsed { ++ suffix := hdr.Name ++ prefix := "" ++ if len(hdr.Name) > fileNameSize && isASCII(hdr.Name) { ++ var err error ++ prefix, suffix, err = tw.splitUSTARLongName(hdr.Name) ++ if err == nil { ++ // ok we can use a ustar long name instead of pax, now correct the fields ++ ++ // remove the path field from the pax header. this will suppress the pax header ++ delete(paxHeaders, paxPath) ++ ++ // update the path fields ++ tw.cString(pathHeaderBytes, suffix, false, paxNone, nil) ++ tw.cString(prefixHeaderBytes, prefix, false, paxNone, nil) ++ ++ // Use the ustar magic if we used ustar long names. ++ if len(prefix) > 0 { ++ copy(header[257:265], []byte("ustar\000")) ++ } ++ } ++ } + } + + // The chksum field is terminated by a NUL and a space. +@@ -190,8 +236,18 @@ + return tw.err + } + ++ if len(paxHeaders) > 0 { ++ if !allowPax { ++ return errInvalidHeader ++ } ++ if err := tw.writePAXHeader(hdr, paxHeaders); err != nil { ++ return err ++ } ++ } ++ tw.nb = int64(hdr.Size) ++ tw.pad = (blockSize - (tw.nb % blockSize)) % blockSize ++ + _, tw.err = tw.w.Write(header) +- + return tw.err + } + +@@ -218,7 +274,7 @@ + + // writePaxHeader writes an extended pax header to the + // archive. +-func (tw *Writer) writePAXHeader(hdr *Header) error { ++func (tw *Writer) writePAXHeader(hdr *Header, paxHeaders map[string]string) error { + // Prepare extended header + ext := new(Header) + ext.Typeflag = TypeXHeader +@@ -229,18 +285,23 @@ + // with the current pid. + pid := os.Getpid() + dir, file := path.Split(hdr.Name) +- ext.Name = path.Join(dir, +- fmt.Sprintf("PaxHeaders.%d", pid), file)[0:100] ++ fullName := path.Join(dir, ++ fmt.Sprintf("PaxHeaders.%d", pid), file) ++ ++ ascii := toASCII(fullName) ++ if len(ascii) > 100 { ++ ascii = ascii[:100] ++ } ++ ext.Name = ascii + // Construct the body + var buf bytes.Buffer +- if len(hdr.Name) > fileNameSize { +- fmt.Fprint(&buf, paxHeader("path="+hdr.Name)) ++ ++ for k, v := range paxHeaders { ++ fmt.Fprint(&buf, paxHeader(k+"="+v)) + } +- if len(hdr.Linkname) > fileNameSize { +- fmt.Fprint(&buf, paxHeader("linkpath="+hdr.Linkname)) +- } ++ + ext.Size = int64(len(buf.Bytes())) +- if err := tw.WriteHeader(ext); err != nil { ++ if err := tw.writeHeader(ext, false); err != nil { + return err + } + if _, err := tw.Write(buf.Bytes()); err != nil { +Index: src/pkg/archive/tar/writer_test.go +=================================================================== +--- a/src/pkg/archive/tar/writer_test.go ++++ b/src/pkg/archive/tar/writer_test.go +@@ -243,15 +243,110 @@ + } + } + ++func TestPaxSymlink(t *testing.T) { ++ // Create an archive with a large linkname ++ fileinfo, err := os.Stat("testdata/small.txt") ++ if err != nil { ++ t.Fatal(err) ++ } ++ hdr, err := FileInfoHeader(fileinfo, "") ++ hdr.Typeflag = TypeSymlink ++ if err != nil { ++ t.Fatalf("os.Stat:1 %v", err) ++ } ++ // Force a PAX long linkname to be written ++ longLinkname := strings.Repeat("1234567890/1234567890", 10) ++ hdr.Linkname = longLinkname ++ ++ hdr.Size = 0 ++ var buf bytes.Buffer ++ writer := NewWriter(&buf) ++ if err := writer.WriteHeader(hdr); err != nil { ++ t.Fatal(err) ++ } ++ if err := writer.Close(); err != nil { ++ t.Fatal(err) ++ } ++ // Simple test to make sure PAX extensions are in effect ++ if !bytes.Contains(buf.Bytes(), []byte("PaxHeaders.")) { ++ t.Fatal("Expected at least one PAX header to be written.") ++ } ++ // Test that we can get a long name back out of the archive. ++ reader := NewReader(&buf) ++ hdr, err = reader.Next() ++ if err != nil { ++ t.Fatal(err) ++ } ++ if hdr.Linkname != longLinkname { ++ t.Fatal("Couldn't recover long link name") ++ } ++} ++ ++func TestPaxNonAscii(t *testing.T) { ++ // Create an archive with non ascii. These should trigger a pax header ++ // because pax headers have a defined utf-8 encoding. ++ fileinfo, err := os.Stat("testdata/small.txt") ++ if err != nil { ++ t.Fatal(err) ++ } ++ ++ hdr, err := FileInfoHeader(fileinfo, "") ++ if err != nil { ++ t.Fatalf("os.Stat:1 %v", err) ++ } ++ ++ // some sample data ++ chineseFilename := "文件名" ++ chineseGroupname := "組" ++ chineseUsername := "用戶名" ++ ++ hdr.Name = chineseFilename ++ hdr.Gname = chineseGroupname ++ hdr.Uname = chineseUsername ++ ++ contents := strings.Repeat(" ", int(hdr.Size)) ++ ++ var buf bytes.Buffer ++ writer := NewWriter(&buf) ++ if err := writer.WriteHeader(hdr); err != nil { ++ t.Fatal(err) ++ } ++ if _, err = writer.Write([]byte(contents)); err != nil { ++ t.Fatal(err) ++ } ++ if err := writer.Close(); err != nil { ++ t.Fatal(err) ++ } ++ // Simple test to make sure PAX extensions are in effect ++ if !bytes.Contains(buf.Bytes(), []byte("PaxHeaders.")) { ++ t.Fatal("Expected at least one PAX header to be written.") ++ } ++ // Test that we can get a long name back out of the archive. ++ reader := NewReader(&buf) ++ hdr, err = reader.Next() ++ if err != nil { ++ t.Fatal(err) ++ } ++ if hdr.Name != chineseFilename { ++ t.Fatal("Couldn't recover unicode name") ++ } ++ if hdr.Gname != chineseGroupname { ++ t.Fatal("Couldn't recover unicode group") ++ } ++ if hdr.Uname != chineseUsername { ++ t.Fatal("Couldn't recover unicode user") ++ } ++} ++ + func TestPAXHeader(t *testing.T) { + medName := strings.Repeat("CD", 50) + longName := strings.Repeat("AB", 100) + paxTests := [][2]string{ +- {"name=/etc/hosts", "19 name=/etc/hosts\n"}, ++ {paxPath + "=/etc/hosts", "19 path=/etc/hosts\n"}, + {"a=b", "6 a=b\n"}, // Single digit length + {"a=names", "11 a=names\n"}, // Test case involving carries +- {"name=" + longName, fmt.Sprintf("210 name=%s\n", longName)}, +- {"name=" + medName, fmt.Sprintf("110 name=%s\n", medName)}} ++ {paxPath + "=" + longName, fmt.Sprintf("210 path=%s\n", longName)}, ++ {paxPath + "=" + medName, fmt.Sprintf("110 path=%s\n", medName)}} + + for _, test := range paxTests { + key, expected := test[0], test[1] diff --git a/golang-1.1.2-ustar-split.patch b/golang-1.1.2-ustar-split.patch new file mode 100644 index 0000000..9e97b38 --- /dev/null +++ b/golang-1.1.2-ustar-split.patch @@ -0,0 +1,62 @@ +Index: src/pkg/archive/tar/writer.go +=================================================================== +--- a/src/pkg/archive/tar/writer.go ++++ b/src/pkg/archive/tar/writer.go +@@ -263,8 +263,11 @@ + length-- + } + i := strings.LastIndex(name[:length], "/") +- nlen := length - i - 1 +- if i <= 0 || nlen > fileNameSize || nlen == 0 { ++ // nlen contains the resulting length in the name field. ++ // plen contains the resulting length in the prefix field. ++ nlen := len(name) - i - 1 ++ plen := i ++ if i <= 0 || nlen > fileNameSize || nlen == 0 || plen > fileNamePrefixSize { + err = errNameTooLong + return + } +Index: src/pkg/archive/tar/writer_test.go +=================================================================== +--- a/src/pkg/archive/tar/writer_test.go ++++ b/src/pkg/archive/tar/writer_test.go +@@ -355,3 +355,39 @@ + } + } + } ++ ++func TestUSTARLongName(t *testing.T) { ++ // Create an archive with a path that failed to split with USTAR extension in previous versions. ++ fileinfo, err := os.Stat("testdata/small.txt") ++ if err != nil { ++ t.Fatal(err) ++ } ++ hdr, err := FileInfoHeader(fileinfo, "") ++ hdr.Typeflag = TypeDir ++ if err != nil { ++ t.Fatalf("os.Stat:1 %v", err) ++ } ++ // Force a PAX long name to be written. The name was taken from a practical example ++ // that fails and replaced ever char through numbers to anonymize the sample. ++ longName := "/0000_0000000/00000-000000000/0000_0000000/00000-0000000000000/0000_0000000/00000-0000000-00000000/0000_0000000/00000000/0000_0000000/000/0000_0000000/00000000v00/0000_0000000/000000/0000_0000000/0000000/0000_0000000/00000y-00/0000/0000/00000000/0x000000/" ++ hdr.Name = longName ++ ++ hdr.Size = 0 ++ var buf bytes.Buffer ++ writer := NewWriter(&buf) ++ if err := writer.WriteHeader(hdr); err != nil { ++ t.Fatal(err) ++ } ++ if err := writer.Close(); err != nil { ++ t.Fatal(err) ++ } ++ // Test that we can get a long name back out of the archive. ++ reader := NewReader(&buf) ++ hdr, err = reader.Next() ++ if err != nil { ++ t.Fatal(err) ++ } ++ if hdr.Name != longName { ++ t.Fatal("Couldn't recover long name") ++ } ++} diff --git a/golang.spec b/golang.spec index 6381cf7..cde5a95 100644 --- a/golang.spec +++ b/golang.spec @@ -25,7 +25,7 @@ Name: golang Version: 1.1.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Go Programming Language License: BSD @@ -35,8 +35,16 @@ Source0: https://go.googlecode.com/files/go%{version}.src.tar.gz BuildRequires: /bin/hostname BuildRequires: emacs xemacs xemacs-packages-extra +# We strip the meta dependency, but go does require glibc. +# This is an odd issue, still looking for a better fix. +Requires: glibc + Patch0: golang-1.1-verbose-build.patch +Patch10: golang-1.1.2-long-links.patch +Patch11: golang-1.1.2-ustar-split.patch + + # Having godoc and the documentation separate was broken Obsoletes: %{name}-godoc < 1.1-4 Obsoletes: %{name}-docs < 1.1-4 @@ -109,6 +117,9 @@ end # increase verbosity of build %patch0 -p1 +# Fix BZ#1010271 +%patch10 -p1 +%patch11 -p1 %build # create a gcc wrapper to allow us to build with our own flags @@ -257,6 +268,10 @@ cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf %changelog +* Fri Sep 20 2013 Adam Miller - 1.1.2-3 +- Pull upstream patches for BZ#1010271 +- Add glibc requirement that got dropped because of meta dep fix + * Fri Aug 30 2013 Adam Miller - 1.1.2-2 - fix the libc meta dependency (thanks to vbatts [at] redhat.com for the fix) From f12359b27ef2cd713de56c2397ad9f6b446385c8 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Fri, 20 Sep 2013 10:10:13 -0500 Subject: [PATCH 006/156] fix for BZ#1010271 --- golang-1.1.2-long-links.patch | 510 +++++++++++++++++++++++++++++++++ golang-1.1.2-ustar-split.patch | 62 ++++ golang.spec | 17 +- 3 files changed, 588 insertions(+), 1 deletion(-) create mode 100644 golang-1.1.2-long-links.patch create mode 100644 golang-1.1.2-ustar-split.patch diff --git a/golang-1.1.2-long-links.patch b/golang-1.1.2-long-links.patch new file mode 100644 index 0000000..85c3541 --- /dev/null +++ b/golang-1.1.2-long-links.patch @@ -0,0 +1,510 @@ +Index: src/pkg/archive/tar/common.go +=================================================================== +--- a/src/pkg/archive/tar/common.go ++++ b/src/pkg/archive/tar/common.go +@@ -13,6 +13,7 @@ + package tar + + import ( ++ "bytes" + "errors" + "fmt" + "os" +@@ -174,6 +175,23 @@ + c_ISSOCK = 0140000 // Socket + ) + ++// Keywords for the PAX Extended Header ++const ( ++ paxAtime = "atime" ++ paxCharset = "charset" ++ paxComment = "comment" ++ paxCtime = "ctime" // please note that ctime is not a valid pax header. ++ paxGid = "gid" ++ paxGname = "gname" ++ paxLinkpath = "linkpath" ++ paxMtime = "mtime" ++ paxPath = "path" ++ paxSize = "size" ++ paxUid = "uid" ++ paxUname = "uname" ++ paxNone = "" ++) ++ + // FileInfoHeader creates a partially-populated Header from fi. + // If fi describes a symlink, FileInfoHeader records link as the link target. + // If fi describes a directory, a slash is appended to the name. +@@ -257,3 +275,25 @@ + b, *sp = s[0:n], s[n:] + return + } ++ ++func isASCII(s string) bool { ++ for _, c := range s { ++ if c >= 0x80 { ++ return false ++ } ++ } ++ return true ++} ++ ++func toASCII(s string) string { ++ if isASCII(s) { ++ return s ++ } ++ var buf bytes.Buffer ++ for _, c := range s { ++ if c < 0x80 { ++ buf.WriteByte(byte(c)) ++ } ++ } ++ return buf.String() ++} +Index: src/pkg/archive/tar/reader.go +=================================================================== +--- a/src/pkg/archive/tar/reader.go ++++ b/src/pkg/archive/tar/reader.go +@@ -95,45 +95,45 @@ + func mergePAX(hdr *Header, headers map[string]string) error { + for k, v := range headers { + switch k { +- case "path": ++ case paxPath: + hdr.Name = v +- case "linkpath": ++ case paxLinkpath: + hdr.Linkname = v +- case "gname": ++ case paxGname: + hdr.Gname = v +- case "uname": ++ case paxUname: + hdr.Uname = v +- case "uid": ++ case paxUid: + uid, err := strconv.ParseInt(v, 10, 0) + if err != nil { + return err + } + hdr.Uid = int(uid) +- case "gid": ++ case paxGid: + gid, err := strconv.ParseInt(v, 10, 0) + if err != nil { + return err + } + hdr.Gid = int(gid) +- case "atime": ++ case paxAtime: + t, err := parsePAXTime(v) + if err != nil { + return err + } + hdr.AccessTime = t +- case "mtime": ++ case paxMtime: + t, err := parsePAXTime(v) + if err != nil { + return err + } + hdr.ModTime = t +- case "ctime": ++ case paxCtime: + t, err := parsePAXTime(v) + if err != nil { + return err + } + hdr.ChangeTime = t +- case "size": ++ case paxSize: + size, err := strconv.ParseInt(v, 10, 0) + if err != nil { + return err +Index: src/pkg/archive/tar/writer.go +=================================================================== +--- a/src/pkg/archive/tar/writer.go ++++ b/src/pkg/archive/tar/writer.go +@@ -24,6 +24,7 @@ + ErrFieldTooLong = errors.New("archive/tar: header field too long") + ErrWriteAfterClose = errors.New("archive/tar: write after close") + errNameTooLong = errors.New("archive/tar: name too long") ++ errInvalidHeader = errors.New("archive/tar: header field too long or contains invalid values") + ) + + // A Writer provides sequential writing of a tar archive in POSIX.1 format. +@@ -37,6 +38,7 @@ + pad int64 // amount of padding to write after current file entry + closed bool + usedBinary bool // whether the binary numeric field extension was used ++ preferPax bool // use pax header instead of binary numeric header + } + + // NewWriter creates a new Writer writing to w. +@@ -65,16 +67,23 @@ + } + + // Write s into b, terminating it with a NUL if there is room. +-func (tw *Writer) cString(b []byte, s string) { ++// If the value is too long for the field and allowPax is true add a paxheader record instead ++func (tw *Writer) cString(b []byte, s string, allowPax bool, paxKeyword string, paxHeaders map[string]string) { ++ needsPaxHeader := allowPax && len(s) > len(b) || !isASCII(s) ++ if needsPaxHeader { ++ paxHeaders[paxKeyword] = s ++ return ++ } + if len(s) > len(b) { + if tw.err == nil { + tw.err = ErrFieldTooLong + } + return + } +- copy(b, s) +- if len(s) < len(b) { +- b[len(s)] = 0 ++ ascii := toASCII(s) ++ copy(b, ascii) ++ if len(ascii) < len(b) { ++ b[len(ascii)] = 0 + } + } + +@@ -85,17 +94,27 @@ + for len(s)+1 < len(b) { + s = "0" + s + } +- tw.cString(b, s) ++ tw.cString(b, s, false, paxNone, nil) + } + + // Write x into b, either as octal or as binary (GNUtar/star extension). +-func (tw *Writer) numeric(b []byte, x int64) { ++// If the value is too long for the field and writingPax is enabled both for the field and the add a paxheader record instead ++func (tw *Writer) numeric(b []byte, x int64, allowPax bool, paxKeyword string, paxHeaders map[string]string) { + // Try octal first. + s := strconv.FormatInt(x, 8) + if len(s) < len(b) { + tw.octal(b, x) + return + } ++ ++ // If it is too long for octal, and pax is preferred, use a pax header ++ if allowPax && tw.preferPax { ++ tw.octal(b, 0) ++ s := strconv.FormatInt(x, 10) ++ paxHeaders[paxKeyword] = s ++ return ++ } ++ + // Too big: use binary (big-endian). + tw.usedBinary = true + for i := len(b) - 1; x > 0 && i >= 0; i-- { +@@ -115,6 +134,15 @@ + // WriteHeader calls Flush if it is not the first header. + // Calling after a Close will return ErrWriteAfterClose. + func (tw *Writer) WriteHeader(hdr *Header) error { ++ return tw.writeHeader(hdr, true) ++} ++ ++// WriteHeader writes hdr and prepares to accept the file's contents. ++// WriteHeader calls Flush if it is not the first header. ++// Calling after a Close will return ErrWriteAfterClose. ++// As this method is called internally by writePax header to allow it to ++// suppress writing the pax header. ++func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error { + if tw.closed { + return ErrWriteAfterClose + } +@@ -124,31 +152,21 @@ + if tw.err != nil { + return tw.err + } +- // Decide whether or not to use PAX extensions ++ ++ // a map to hold pax header records, if any are needed ++ paxHeaders := make(map[string]string) ++ + // TODO(shanemhansen): we might want to use PAX headers for + // subsecond time resolution, but for now let's just capture +- // the long name/long symlink use case. +- suffix := hdr.Name +- prefix := "" +- if len(hdr.Name) > fileNameSize || len(hdr.Linkname) > fileNameSize { +- var err error +- prefix, suffix, err = tw.splitUSTARLongName(hdr.Name) +- // Either we were unable to pack the long name into ustar format +- // or the link name is too long; use PAX headers. +- if err == errNameTooLong || len(hdr.Linkname) > fileNameSize { +- if err := tw.writePAXHeader(hdr); err != nil { +- return err +- } +- } else if err != nil { +- return err +- } +- } +- tw.nb = int64(hdr.Size) +- tw.pad = -tw.nb & (blockSize - 1) // blockSize is a power of two ++ // too long fields or non ascii characters + + header := make([]byte, blockSize) + s := slicer(header) +- tw.cString(s.next(fileNameSize), suffix) ++ ++ // keep a reference to the filename to allow to overwrite it later if we detect that we can use ustar longnames instead of pax ++ pathHeaderBytes := s.next(fileNameSize) ++ ++ tw.cString(pathHeaderBytes, hdr.Name, true, paxPath, paxHeaders) + + // Handle out of range ModTime carefully. + var modTime int64 +@@ -156,27 +174,55 @@ + modTime = hdr.ModTime.Unix() + } + +- tw.octal(s.next(8), hdr.Mode) // 100:108 +- tw.numeric(s.next(8), int64(hdr.Uid)) // 108:116 +- tw.numeric(s.next(8), int64(hdr.Gid)) // 116:124 +- tw.numeric(s.next(12), hdr.Size) // 124:136 +- tw.numeric(s.next(12), modTime) // 136:148 +- s.next(8) // chksum (148:156) +- s.next(1)[0] = hdr.Typeflag // 156:157 +- tw.cString(s.next(100), hdr.Linkname) // linkname (157:257) +- copy(s.next(8), []byte("ustar\x0000")) // 257:265 +- tw.cString(s.next(32), hdr.Uname) // 265:297 +- tw.cString(s.next(32), hdr.Gname) // 297:329 +- tw.numeric(s.next(8), hdr.Devmajor) // 329:337 +- tw.numeric(s.next(8), hdr.Devminor) // 337:345 +- tw.cString(s.next(155), prefix) // 345:500 ++ tw.octal(s.next(8), hdr.Mode) // 100:108 ++ tw.numeric(s.next(8), int64(hdr.Uid), true, paxUid, paxHeaders) // 108:116 ++ tw.numeric(s.next(8), int64(hdr.Gid), true, paxGid, paxHeaders) // 116:124 ++ tw.numeric(s.next(12), hdr.Size, true, paxSize, paxHeaders) // 124:136 ++ tw.numeric(s.next(12), modTime, false, paxNone, nil) // 136:148 --- consider using pax for finer granularity ++ s.next(8) // chksum (148:156) ++ s.next(1)[0] = hdr.Typeflag // 156:157 ++ ++ tw.cString(s.next(100), hdr.Linkname, true, paxLinkpath, paxHeaders) ++ ++ copy(s.next(8), []byte("ustar\x0000")) // 257:265 ++ tw.cString(s.next(32), hdr.Uname, true, paxUname, paxHeaders) // 265:297 ++ tw.cString(s.next(32), hdr.Gname, true, paxGname, paxHeaders) // 297:329 ++ tw.numeric(s.next(8), hdr.Devmajor, false, paxNone, nil) // 329:337 ++ tw.numeric(s.next(8), hdr.Devminor, false, paxNone, nil) // 337:345 ++ ++ // keep a reference to the prefix to allow to overwrite it later if we detect that we can use ustar longnames instead of pax ++ prefixHeaderBytes := s.next(155) ++ tw.cString(prefixHeaderBytes, "", false, paxNone, nil) // 345:500 prefix ++ + // Use the GNU magic instead of POSIX magic if we used any GNU extensions. + if tw.usedBinary { + copy(header[257:265], []byte("ustar \x00")) + } +- // Use the ustar magic if we used ustar long names. +- if len(prefix) > 0 { +- copy(header[257:265], []byte("ustar\000")) ++ ++ _, paxPathUsed := paxHeaders[paxPath] ++ // try to use a ustar header when only the name is too long ++ if !tw.preferPax && len(paxHeaders) == 1 && paxPathUsed { ++ suffix := hdr.Name ++ prefix := "" ++ if len(hdr.Name) > fileNameSize && isASCII(hdr.Name) { ++ var err error ++ prefix, suffix, err = tw.splitUSTARLongName(hdr.Name) ++ if err == nil { ++ // ok we can use a ustar long name instead of pax, now correct the fields ++ ++ // remove the path field from the pax header. this will suppress the pax header ++ delete(paxHeaders, paxPath) ++ ++ // update the path fields ++ tw.cString(pathHeaderBytes, suffix, false, paxNone, nil) ++ tw.cString(prefixHeaderBytes, prefix, false, paxNone, nil) ++ ++ // Use the ustar magic if we used ustar long names. ++ if len(prefix) > 0 { ++ copy(header[257:265], []byte("ustar\000")) ++ } ++ } ++ } + } + + // The chksum field is terminated by a NUL and a space. +@@ -190,8 +236,18 @@ + return tw.err + } + ++ if len(paxHeaders) > 0 { ++ if !allowPax { ++ return errInvalidHeader ++ } ++ if err := tw.writePAXHeader(hdr, paxHeaders); err != nil { ++ return err ++ } ++ } ++ tw.nb = int64(hdr.Size) ++ tw.pad = (blockSize - (tw.nb % blockSize)) % blockSize ++ + _, tw.err = tw.w.Write(header) +- + return tw.err + } + +@@ -218,7 +274,7 @@ + + // writePaxHeader writes an extended pax header to the + // archive. +-func (tw *Writer) writePAXHeader(hdr *Header) error { ++func (tw *Writer) writePAXHeader(hdr *Header, paxHeaders map[string]string) error { + // Prepare extended header + ext := new(Header) + ext.Typeflag = TypeXHeader +@@ -229,18 +285,23 @@ + // with the current pid. + pid := os.Getpid() + dir, file := path.Split(hdr.Name) +- ext.Name = path.Join(dir, +- fmt.Sprintf("PaxHeaders.%d", pid), file)[0:100] ++ fullName := path.Join(dir, ++ fmt.Sprintf("PaxHeaders.%d", pid), file) ++ ++ ascii := toASCII(fullName) ++ if len(ascii) > 100 { ++ ascii = ascii[:100] ++ } ++ ext.Name = ascii + // Construct the body + var buf bytes.Buffer +- if len(hdr.Name) > fileNameSize { +- fmt.Fprint(&buf, paxHeader("path="+hdr.Name)) ++ ++ for k, v := range paxHeaders { ++ fmt.Fprint(&buf, paxHeader(k+"="+v)) + } +- if len(hdr.Linkname) > fileNameSize { +- fmt.Fprint(&buf, paxHeader("linkpath="+hdr.Linkname)) +- } ++ + ext.Size = int64(len(buf.Bytes())) +- if err := tw.WriteHeader(ext); err != nil { ++ if err := tw.writeHeader(ext, false); err != nil { + return err + } + if _, err := tw.Write(buf.Bytes()); err != nil { +Index: src/pkg/archive/tar/writer_test.go +=================================================================== +--- a/src/pkg/archive/tar/writer_test.go ++++ b/src/pkg/archive/tar/writer_test.go +@@ -243,15 +243,110 @@ + } + } + ++func TestPaxSymlink(t *testing.T) { ++ // Create an archive with a large linkname ++ fileinfo, err := os.Stat("testdata/small.txt") ++ if err != nil { ++ t.Fatal(err) ++ } ++ hdr, err := FileInfoHeader(fileinfo, "") ++ hdr.Typeflag = TypeSymlink ++ if err != nil { ++ t.Fatalf("os.Stat:1 %v", err) ++ } ++ // Force a PAX long linkname to be written ++ longLinkname := strings.Repeat("1234567890/1234567890", 10) ++ hdr.Linkname = longLinkname ++ ++ hdr.Size = 0 ++ var buf bytes.Buffer ++ writer := NewWriter(&buf) ++ if err := writer.WriteHeader(hdr); err != nil { ++ t.Fatal(err) ++ } ++ if err := writer.Close(); err != nil { ++ t.Fatal(err) ++ } ++ // Simple test to make sure PAX extensions are in effect ++ if !bytes.Contains(buf.Bytes(), []byte("PaxHeaders.")) { ++ t.Fatal("Expected at least one PAX header to be written.") ++ } ++ // Test that we can get a long name back out of the archive. ++ reader := NewReader(&buf) ++ hdr, err = reader.Next() ++ if err != nil { ++ t.Fatal(err) ++ } ++ if hdr.Linkname != longLinkname { ++ t.Fatal("Couldn't recover long link name") ++ } ++} ++ ++func TestPaxNonAscii(t *testing.T) { ++ // Create an archive with non ascii. These should trigger a pax header ++ // because pax headers have a defined utf-8 encoding. ++ fileinfo, err := os.Stat("testdata/small.txt") ++ if err != nil { ++ t.Fatal(err) ++ } ++ ++ hdr, err := FileInfoHeader(fileinfo, "") ++ if err != nil { ++ t.Fatalf("os.Stat:1 %v", err) ++ } ++ ++ // some sample data ++ chineseFilename := "文件名" ++ chineseGroupname := "組" ++ chineseUsername := "用戶名" ++ ++ hdr.Name = chineseFilename ++ hdr.Gname = chineseGroupname ++ hdr.Uname = chineseUsername ++ ++ contents := strings.Repeat(" ", int(hdr.Size)) ++ ++ var buf bytes.Buffer ++ writer := NewWriter(&buf) ++ if err := writer.WriteHeader(hdr); err != nil { ++ t.Fatal(err) ++ } ++ if _, err = writer.Write([]byte(contents)); err != nil { ++ t.Fatal(err) ++ } ++ if err := writer.Close(); err != nil { ++ t.Fatal(err) ++ } ++ // Simple test to make sure PAX extensions are in effect ++ if !bytes.Contains(buf.Bytes(), []byte("PaxHeaders.")) { ++ t.Fatal("Expected at least one PAX header to be written.") ++ } ++ // Test that we can get a long name back out of the archive. ++ reader := NewReader(&buf) ++ hdr, err = reader.Next() ++ if err != nil { ++ t.Fatal(err) ++ } ++ if hdr.Name != chineseFilename { ++ t.Fatal("Couldn't recover unicode name") ++ } ++ if hdr.Gname != chineseGroupname { ++ t.Fatal("Couldn't recover unicode group") ++ } ++ if hdr.Uname != chineseUsername { ++ t.Fatal("Couldn't recover unicode user") ++ } ++} ++ + func TestPAXHeader(t *testing.T) { + medName := strings.Repeat("CD", 50) + longName := strings.Repeat("AB", 100) + paxTests := [][2]string{ +- {"name=/etc/hosts", "19 name=/etc/hosts\n"}, ++ {paxPath + "=/etc/hosts", "19 path=/etc/hosts\n"}, + {"a=b", "6 a=b\n"}, // Single digit length + {"a=names", "11 a=names\n"}, // Test case involving carries +- {"name=" + longName, fmt.Sprintf("210 name=%s\n", longName)}, +- {"name=" + medName, fmt.Sprintf("110 name=%s\n", medName)}} ++ {paxPath + "=" + longName, fmt.Sprintf("210 path=%s\n", longName)}, ++ {paxPath + "=" + medName, fmt.Sprintf("110 path=%s\n", medName)}} + + for _, test := range paxTests { + key, expected := test[0], test[1] diff --git a/golang-1.1.2-ustar-split.patch b/golang-1.1.2-ustar-split.patch new file mode 100644 index 0000000..9e97b38 --- /dev/null +++ b/golang-1.1.2-ustar-split.patch @@ -0,0 +1,62 @@ +Index: src/pkg/archive/tar/writer.go +=================================================================== +--- a/src/pkg/archive/tar/writer.go ++++ b/src/pkg/archive/tar/writer.go +@@ -263,8 +263,11 @@ + length-- + } + i := strings.LastIndex(name[:length], "/") +- nlen := length - i - 1 +- if i <= 0 || nlen > fileNameSize || nlen == 0 { ++ // nlen contains the resulting length in the name field. ++ // plen contains the resulting length in the prefix field. ++ nlen := len(name) - i - 1 ++ plen := i ++ if i <= 0 || nlen > fileNameSize || nlen == 0 || plen > fileNamePrefixSize { + err = errNameTooLong + return + } +Index: src/pkg/archive/tar/writer_test.go +=================================================================== +--- a/src/pkg/archive/tar/writer_test.go ++++ b/src/pkg/archive/tar/writer_test.go +@@ -355,3 +355,39 @@ + } + } + } ++ ++func TestUSTARLongName(t *testing.T) { ++ // Create an archive with a path that failed to split with USTAR extension in previous versions. ++ fileinfo, err := os.Stat("testdata/small.txt") ++ if err != nil { ++ t.Fatal(err) ++ } ++ hdr, err := FileInfoHeader(fileinfo, "") ++ hdr.Typeflag = TypeDir ++ if err != nil { ++ t.Fatalf("os.Stat:1 %v", err) ++ } ++ // Force a PAX long name to be written. The name was taken from a practical example ++ // that fails and replaced ever char through numbers to anonymize the sample. ++ longName := "/0000_0000000/00000-000000000/0000_0000000/00000-0000000000000/0000_0000000/00000-0000000-00000000/0000_0000000/00000000/0000_0000000/000/0000_0000000/00000000v00/0000_0000000/000000/0000_0000000/0000000/0000_0000000/00000y-00/0000/0000/00000000/0x000000/" ++ hdr.Name = longName ++ ++ hdr.Size = 0 ++ var buf bytes.Buffer ++ writer := NewWriter(&buf) ++ if err := writer.WriteHeader(hdr); err != nil { ++ t.Fatal(err) ++ } ++ if err := writer.Close(); err != nil { ++ t.Fatal(err) ++ } ++ // Test that we can get a long name back out of the archive. ++ reader := NewReader(&buf) ++ hdr, err = reader.Next() ++ if err != nil { ++ t.Fatal(err) ++ } ++ if hdr.Name != longName { ++ t.Fatal("Couldn't recover long name") ++ } ++} diff --git a/golang.spec b/golang.spec index 9d96830..29ba550 100644 --- a/golang.spec +++ b/golang.spec @@ -25,7 +25,7 @@ Name: golang Version: 1.1.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: The Go Programming Language License: BSD @@ -35,8 +35,15 @@ Source0: https://go.googlecode.com/files/go%{version}.src.tar.gz BuildRequires: /bin/hostname BuildRequires: emacs +# We strip the meta dependency, but go does require glibc. +# This is an odd issue, still looking for a better fix. +Requires: glibc + Patch0: golang-1.1-verbose-build.patch +Patch10: golang-1.1.2-long-links.patch +Patch11: golang-1.1.2-ustar-split.patch + # Having godoc and the documentation separate was broken Obsoletes: %{name}-godoc < 1.1-4 Obsoletes: %{name}-docs < 1.1-4 @@ -98,6 +105,10 @@ end # increase verbosity of build %patch0 -p1 +# Fix BZ#1010271 +%patch10 -p1 +%patch11 -p1 + %build # create a gcc wrapper to allow us to build with our own flags @@ -231,6 +242,10 @@ cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf %changelog +* Fri Sep 20 2013 Adam Miller - 1.1.2-4 +- Pull upstream patches for BZ#1010271 +- Add glibc requirement that got dropped because of meta dep fix + * Thu Sep 19 2013 Adam Miller - 1.2.2-3 - fix the libc meta dependency (thanks to vbatts [at] redhat.com for the fix) From 96d7496e0543c6de0c1a1ef8cb9ee1dbb818f6a3 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 8 Jul 2014 11:36:44 -0400 Subject: [PATCH 007/156] cleaning up multiarch builds bz1105901, bz1101508 --- golang.spec | 175 +++++++++++++--------------------------------------- 1 file changed, 42 insertions(+), 133 deletions(-) diff --git a/golang.spec b/golang.spec index 4c3a7b2..f74d7fd 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: The Go Programming Language License: BSD @@ -221,7 +221,7 @@ Requires(postun): %{_sbindir}/update-alternatives Summary: Golang compiler toolchain to compile for linux 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-linux-386 %{summary} @@ -229,7 +229,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for linux amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-linux-amd64 %{summary} @@ -237,7 +237,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for linux arm Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-linux-arm %{summary} @@ -245,7 +245,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for darwin 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-darwin-386 %{summary} @@ -253,7 +253,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for darwin amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-darwin-amd64 %{summary} @@ -261,7 +261,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for windows 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-windows-386 %{summary} @@ -269,7 +269,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for windows amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-windows-amd64 %{summary} @@ -277,7 +277,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for plan9 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-plan9-386 %{summary} @@ -285,7 +285,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for plan9 amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-plan9-amd64 %{summary} @@ -293,7 +293,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for freebsd 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-freebsd-386 %{summary} @@ -301,7 +301,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for freebsd amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-freebsd-amd64 %{summary} @@ -309,7 +309,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for freebsd arm Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-freebsd-arm %{summary} @@ -317,7 +317,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for netbsd 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-netbsd-386 %{summary} @@ -325,7 +325,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for netbsd amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-netbsd-amd64 %{summary} @@ -333,7 +333,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for netbsd arm Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-netbsd-arm %{summary} @@ -341,7 +341,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for openbsd 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-openbsd-386 %{summary} @@ -349,7 +349,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for openbsd amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-openbsd-amd64 %{summary} @@ -359,7 +359,6 @@ Requires(post): golang-bin #Summary: Golang compiler toolchain to compile for openbsd arm #Requires: go = %{version}-%{release} #BuildArch: noarch -#Requires(post): golang-bin #%description pkg-openbsd-arm #%{summary} @@ -436,7 +435,7 @@ pushd src PATH="$(pwd -P)/../zz:$PATH" CC="gcc" \ GOOS=${goos} \ GOARCH=${goarch} \ - ./make.bash + ./make.bash --no-clean done done popd @@ -472,7 +471,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 -av api bin doc favicon.ico include lib pkg robots.txt src \ +cp -apv api bin doc favicon.ico include lib pkg robots.txt src misc VERSION \ $RPM_BUILD_ROOT%{goroot} # remove the unnecessary zoneinfo file (Go will always use the system one first) @@ -598,61 +597,11 @@ if [ $1 = 0 ]; then fi %endif -# All these archives need to be newer than the corresponding source in goroot -# https://bugzilla.redhat.com/show_bug.cgi?id=1099206 -%post pkg-linux-386 -GOROOT=%{goroot} GOOS=linux GOARCH=386 go install std - -%post pkg-linux-amd64 -GOROOT=%{goroot} GOOS=linux GOARCH=amd64 go install std - -%post pkg-linux-arm -GOROOT=%{goroot} GOOS=linux GOARCH=arm go install std - -%post pkg-darwin-386 -GOROOT=%{goroot} GOOS=darwin GOARCH=386 go install std - -%post pkg-darwin-amd64 -GOROOT=%{goroot} GOOS=darwin GOARCH=amd64 go install std - -%post pkg-windows-386 -GOROOT=%{goroot} GOOS=windows GOARCH=386 go install std - -%post pkg-windows-amd64 -GOROOT=%{goroot} GOOS=windows GOARCH=amd64 go install std - -%post pkg-plan9-386 -GOROOT=%{goroot} GOOS=plan9 GOARCH=386 go install std - -%post pkg-plan9-amd64 -GOROOT=%{goroot} GOOS=plan9 GOARCH=amd64 go install std - -%post pkg-freebsd-386 -GOROOT=%{goroot} GOOS=freebsd GOARCH=386 go install std - -%post pkg-freebsd-amd64 -GOROOT=%{goroot} GOOS=freebsd GOARCH=amd64 go install std - -%post pkg-freebsd-arm -GOROOT=%{goroot} GOOS=freebsd GOARCH=arm go install std - -%post pkg-netbsd-386 -GOROOT=%{goroot} GOOS=netbsd GOARCH=386 go install std - -%post pkg-netbsd-amd64 -GOROOT=%{goroot} GOOS=netbsd GOARCH=amd64 go install std - -%post pkg-netbsd-arm -GOROOT=%{goroot} GOOS=netbsd GOARCH=arm go install std - -%post pkg-openbsd-386 -GOROOT=%{goroot} GOOS=openbsd GOARCH=386 go install std - -%post pkg-openbsd-amd64 -GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %files -%doc AUTHORS CONTRIBUTORS LICENSE PATENTS VERSION +%doc AUTHORS CONTRIBUTORS LICENSE PATENTS +# VERSION has to be present in the GOROOT, for `go install std` to work +%doc %{goroot}/VERSION # go files %dir %{goroot} @@ -708,65 +657,6 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %files src %{goroot}/src/ -# files that are generated based on compile-time ARCH will go in that arch's pkg-bin-* -%ifarch %{ix86} - -# this is wacky that now these files are generated in a different arch -%exclude %{goroot}/src/cmd/8l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_386.go -%exclude %{goroot}/src/cmd/6l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go - -%exclude %{goroot}/src/pkg/runtime/zasm_linux_386.h -%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zmprof_linux_386.c -%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_386.go -%exclude %{goroot}/src/pkg/runtime/zsema_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zstring_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zsys_linux_386.s -%exclude %{goroot}/src/pkg/runtime/ztime_linux_386.c -%endif - -%ifarch x86_64 -%exclude %{goroot}/src/cmd/6l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go - -%exclude %{goroot}/src/pkg/runtime/zasm_linux_amd64.h -%exclude %{goroot}/src/pkg/runtime/zmprof_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zsema_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_amd64.go -%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zstring_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zsys_linux_amd64.s -%exclude %{goroot}/src/pkg/runtime/ztime_linux_amd64.c -%endif - -%ifarch %{arm} -%exclude %{goroot}/src/cmd/5l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_arm.go -%exclude %{goroot}/src/cmd/6l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go - -%exclude %{goroot}/src/pkg/runtime/zasm_linux_arm.h -%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zmprof_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/znoasm_arm_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_arm.go -%exclude %{goroot}/src/pkg/runtime/zsema_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zstring_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zsys_linux_arm.s -%exclude %{goroot}/src/pkg/runtime/ztime_linux_arm.c -%endif - %ifarch %{ix86} %files pkg-bin-linux-386 @@ -778,6 +668,10 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %{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 @@ -819,10 +713,18 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %{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 @@ -864,6 +766,10 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %{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 @@ -978,6 +884,9 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %changelog +* Tue Jul 08 2014 Vincent Batts - 1.2.2-8 +- `go install std` requires gcc, to build cgo. bz1105901, bz1101508 + * Wed May 21 2014 Vincent Batts 1.2.2-7 - bz1099206 ghost files are not what is needed From 7c6268c5d65c4d20a27002371f01d63a6dacec1f Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 8 Jul 2014 11:36:44 -0400 Subject: [PATCH 008/156] cleaning up multiarch builds bz1105901, bz1101508 --- golang.spec | 175 +++++++++++++--------------------------------------- 1 file changed, 42 insertions(+), 133 deletions(-) diff --git a/golang.spec b/golang.spec index 74002b6..6f769e2 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: The Go Programming Language License: BSD @@ -221,7 +221,7 @@ Requires(postun): %{_sbindir}/update-alternatives Summary: Golang compiler toolchain to compile for linux 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-linux-386 %{summary} @@ -229,7 +229,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for linux amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-linux-amd64 %{summary} @@ -237,7 +237,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for linux arm Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-linux-arm %{summary} @@ -245,7 +245,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for darwin 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-darwin-386 %{summary} @@ -253,7 +253,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for darwin amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-darwin-amd64 %{summary} @@ -261,7 +261,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for windows 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-windows-386 %{summary} @@ -269,7 +269,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for windows amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-windows-amd64 %{summary} @@ -277,7 +277,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for plan9 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-plan9-386 %{summary} @@ -285,7 +285,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for plan9 amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-plan9-amd64 %{summary} @@ -293,7 +293,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for freebsd 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-freebsd-386 %{summary} @@ -301,7 +301,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for freebsd amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-freebsd-amd64 %{summary} @@ -309,7 +309,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for freebsd arm Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-freebsd-arm %{summary} @@ -317,7 +317,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for netbsd 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-netbsd-386 %{summary} @@ -325,7 +325,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for netbsd amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-netbsd-amd64 %{summary} @@ -333,7 +333,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for netbsd arm Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-netbsd-arm %{summary} @@ -341,7 +341,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for openbsd 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-openbsd-386 %{summary} @@ -349,7 +349,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for openbsd amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-openbsd-amd64 %{summary} @@ -359,7 +359,6 @@ Requires(post): golang-bin #Summary: Golang compiler toolchain to compile for openbsd arm #Requires: go = %{version}-%{release} #BuildArch: noarch -#Requires(post): golang-bin #%description pkg-openbsd-arm #%{summary} @@ -436,7 +435,7 @@ pushd src PATH="$(pwd -P)/../zz:$PATH" CC="gcc" \ GOOS=${goos} \ GOARCH=${goarch} \ - ./make.bash + ./make.bash --no-clean done done popd @@ -472,7 +471,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 -av api bin doc favicon.ico include lib pkg robots.txt src \ +cp -apv api bin doc favicon.ico include lib pkg robots.txt src misc VERSION \ $RPM_BUILD_ROOT%{goroot} # remove the unnecessary zoneinfo file (Go will always use the system one first) @@ -598,61 +597,11 @@ if [ $1 = 0 ]; then fi %endif -# All these archives need to be newer than the corresponding source in goroot -# https://bugzilla.redhat.com/show_bug.cgi?id=1099206 -%post pkg-linux-386 -GOROOT=%{goroot} GOOS=linux GOARCH=386 go install std - -%post pkg-linux-amd64 -GOROOT=%{goroot} GOOS=linux GOARCH=amd64 go install std - -%post pkg-linux-arm -GOROOT=%{goroot} GOOS=linux GOARCH=arm go install std - -%post pkg-darwin-386 -GOROOT=%{goroot} GOOS=darwin GOARCH=386 go install std - -%post pkg-darwin-amd64 -GOROOT=%{goroot} GOOS=darwin GOARCH=amd64 go install std - -%post pkg-windows-386 -GOROOT=%{goroot} GOOS=windows GOARCH=386 go install std - -%post pkg-windows-amd64 -GOROOT=%{goroot} GOOS=windows GOARCH=amd64 go install std - -%post pkg-plan9-386 -GOROOT=%{goroot} GOOS=plan9 GOARCH=386 go install std - -%post pkg-plan9-amd64 -GOROOT=%{goroot} GOOS=plan9 GOARCH=amd64 go install std - -%post pkg-freebsd-386 -GOROOT=%{goroot} GOOS=freebsd GOARCH=386 go install std - -%post pkg-freebsd-amd64 -GOROOT=%{goroot} GOOS=freebsd GOARCH=amd64 go install std - -%post pkg-freebsd-arm -GOROOT=%{goroot} GOOS=freebsd GOARCH=arm go install std - -%post pkg-netbsd-386 -GOROOT=%{goroot} GOOS=netbsd GOARCH=386 go install std - -%post pkg-netbsd-amd64 -GOROOT=%{goroot} GOOS=netbsd GOARCH=amd64 go install std - -%post pkg-netbsd-arm -GOROOT=%{goroot} GOOS=netbsd GOARCH=arm go install std - -%post pkg-openbsd-386 -GOROOT=%{goroot} GOOS=openbsd GOARCH=386 go install std - -%post pkg-openbsd-amd64 -GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %files -%doc AUTHORS CONTRIBUTORS LICENSE PATENTS VERSION +%doc AUTHORS CONTRIBUTORS LICENSE PATENTS +# VERSION has to be present in the GOROOT, for `go install std` to work +%doc %{goroot}/VERSION # go files %dir %{goroot} @@ -708,65 +657,6 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %files src %{goroot}/src/ -# files that are generated based on compile-time ARCH will go in that arch's pkg-bin-* -%ifarch %{ix86} - -# this is wacky that now these files are generated in a different arch -%exclude %{goroot}/src/cmd/8l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_386.go -%exclude %{goroot}/src/cmd/6l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go - -%exclude %{goroot}/src/pkg/runtime/zasm_linux_386.h -%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zmprof_linux_386.c -%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_386.go -%exclude %{goroot}/src/pkg/runtime/zsema_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zstring_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zsys_linux_386.s -%exclude %{goroot}/src/pkg/runtime/ztime_linux_386.c -%endif - -%ifarch x86_64 -%exclude %{goroot}/src/cmd/6l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go - -%exclude %{goroot}/src/pkg/runtime/zasm_linux_amd64.h -%exclude %{goroot}/src/pkg/runtime/zmprof_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zsema_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_amd64.go -%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zstring_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zsys_linux_amd64.s -%exclude %{goroot}/src/pkg/runtime/ztime_linux_amd64.c -%endif - -%ifarch %{arm} -%exclude %{goroot}/src/cmd/5l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_arm.go -%exclude %{goroot}/src/cmd/6l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go - -%exclude %{goroot}/src/pkg/runtime/zasm_linux_arm.h -%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zmprof_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/znoasm_arm_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_arm.go -%exclude %{goroot}/src/pkg/runtime/zsema_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zstring_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zsys_linux_arm.s -%exclude %{goroot}/src/pkg/runtime/ztime_linux_arm.c -%endif - %ifarch %{ix86} %files pkg-bin-linux-386 @@ -778,6 +668,10 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %{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 @@ -819,10 +713,18 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %{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 @@ -864,6 +766,10 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %{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 @@ -978,6 +884,9 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %changelog +* Tue Jul 08 2014 Vincent Batts - 1.2.2-8 +- `go install std` requires gcc, to build cgo. bz1105901, bz1101508 + * Wed May 21 2014 Vincent Batts 1.2.2-7 - bz1099206 ghost files are not what is needed From 420732b09da87b4c54764bc91a9509ee3a63d072 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 8 Jul 2014 11:36:44 -0400 Subject: [PATCH 009/156] cleaning up multiarch builds bz1105901, bz1101508 --- golang.spec | 175 +++++++++++++--------------------------------------- 1 file changed, 42 insertions(+), 133 deletions(-) diff --git a/golang.spec b/golang.spec index 576d8d0..786ed04 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: The Go Programming Language License: BSD @@ -221,7 +221,7 @@ Requires(postun): %{_sbindir}/update-alternatives Summary: Golang compiler toolchain to compile for linux 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-linux-386 %{summary} @@ -229,7 +229,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for linux amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-linux-amd64 %{summary} @@ -237,7 +237,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for linux arm Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-linux-arm %{summary} @@ -245,7 +245,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for darwin 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-darwin-386 %{summary} @@ -253,7 +253,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for darwin amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-darwin-amd64 %{summary} @@ -261,7 +261,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for windows 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-windows-386 %{summary} @@ -269,7 +269,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for windows amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-windows-amd64 %{summary} @@ -277,7 +277,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for plan9 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-plan9-386 %{summary} @@ -285,7 +285,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for plan9 amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-plan9-amd64 %{summary} @@ -293,7 +293,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for freebsd 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-freebsd-386 %{summary} @@ -301,7 +301,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for freebsd amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-freebsd-amd64 %{summary} @@ -309,7 +309,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for freebsd arm Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-freebsd-arm %{summary} @@ -317,7 +317,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for netbsd 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-netbsd-386 %{summary} @@ -325,7 +325,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for netbsd amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-netbsd-amd64 %{summary} @@ -333,7 +333,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for netbsd arm Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-netbsd-arm %{summary} @@ -341,7 +341,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for openbsd 386 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-openbsd-386 %{summary} @@ -349,7 +349,7 @@ Requires(post): golang-bin Summary: Golang compiler toolchain to compile for openbsd amd64 Requires: go = %{version}-%{release} BuildArch: noarch -Requires(post): golang-bin +Requires: gcc %description pkg-openbsd-amd64 %{summary} @@ -359,7 +359,6 @@ Requires(post): golang-bin #Summary: Golang compiler toolchain to compile for openbsd arm #Requires: go = %{version}-%{release} #BuildArch: noarch -#Requires(post): golang-bin #%description pkg-openbsd-arm #%{summary} @@ -436,7 +435,7 @@ pushd src PATH="$(pwd -P)/../zz:$PATH" CC="gcc" \ GOOS=${goos} \ GOARCH=${goarch} \ - ./make.bash + ./make.bash --no-clean done done popd @@ -472,7 +471,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 -av api bin doc favicon.ico include lib pkg robots.txt src \ +cp -apv api bin doc favicon.ico include lib pkg robots.txt src misc VERSION \ $RPM_BUILD_ROOT%{goroot} # remove the unnecessary zoneinfo file (Go will always use the system one first) @@ -598,61 +597,11 @@ if [ $1 = 0 ]; then fi %endif -# All these archives need to be newer than the corresponding source in goroot -# https://bugzilla.redhat.com/show_bug.cgi?id=1099206 -%post pkg-linux-386 -GOROOT=%{goroot} GOOS=linux GOARCH=386 go install std - -%post pkg-linux-amd64 -GOROOT=%{goroot} GOOS=linux GOARCH=amd64 go install std - -%post pkg-linux-arm -GOROOT=%{goroot} GOOS=linux GOARCH=arm go install std - -%post pkg-darwin-386 -GOROOT=%{goroot} GOOS=darwin GOARCH=386 go install std - -%post pkg-darwin-amd64 -GOROOT=%{goroot} GOOS=darwin GOARCH=amd64 go install std - -%post pkg-windows-386 -GOROOT=%{goroot} GOOS=windows GOARCH=386 go install std - -%post pkg-windows-amd64 -GOROOT=%{goroot} GOOS=windows GOARCH=amd64 go install std - -%post pkg-plan9-386 -GOROOT=%{goroot} GOOS=plan9 GOARCH=386 go install std - -%post pkg-plan9-amd64 -GOROOT=%{goroot} GOOS=plan9 GOARCH=amd64 go install std - -%post pkg-freebsd-386 -GOROOT=%{goroot} GOOS=freebsd GOARCH=386 go install std - -%post pkg-freebsd-amd64 -GOROOT=%{goroot} GOOS=freebsd GOARCH=amd64 go install std - -%post pkg-freebsd-arm -GOROOT=%{goroot} GOOS=freebsd GOARCH=arm go install std - -%post pkg-netbsd-386 -GOROOT=%{goroot} GOOS=netbsd GOARCH=386 go install std - -%post pkg-netbsd-amd64 -GOROOT=%{goroot} GOOS=netbsd GOARCH=amd64 go install std - -%post pkg-netbsd-arm -GOROOT=%{goroot} GOOS=netbsd GOARCH=arm go install std - -%post pkg-openbsd-386 -GOROOT=%{goroot} GOOS=openbsd GOARCH=386 go install std - -%post pkg-openbsd-amd64 -GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %files -%doc AUTHORS CONTRIBUTORS LICENSE PATENTS VERSION +%doc AUTHORS CONTRIBUTORS LICENSE PATENTS +# VERSION has to be present in the GOROOT, for `go install std` to work +%doc %{goroot}/VERSION # go files %dir %{goroot} @@ -708,65 +657,6 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %files src %{goroot}/src/ -# files that are generated based on compile-time ARCH will go in that arch's pkg-bin-* -%ifarch %{ix86} - -# this is wacky that now these files are generated in a different arch -%exclude %{goroot}/src/cmd/8l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_386.go -%exclude %{goroot}/src/cmd/6l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go - -%exclude %{goroot}/src/pkg/runtime/zasm_linux_386.h -%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zmprof_linux_386.c -%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_386.go -%exclude %{goroot}/src/pkg/runtime/zsema_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zstring_linux_386.c -%exclude %{goroot}/src/pkg/runtime/zsys_linux_386.s -%exclude %{goroot}/src/pkg/runtime/ztime_linux_386.c -%endif - -%ifarch x86_64 -%exclude %{goroot}/src/cmd/6l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go - -%exclude %{goroot}/src/pkg/runtime/zasm_linux_amd64.h -%exclude %{goroot}/src/pkg/runtime/zmprof_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zsema_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_amd64.go -%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zstring_linux_amd64.c -%exclude %{goroot}/src/pkg/runtime/zsys_linux_amd64.s -%exclude %{goroot}/src/pkg/runtime/ztime_linux_amd64.c -%endif - -%ifarch %{arm} -%exclude %{goroot}/src/cmd/5l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_arm.go -%exclude %{goroot}/src/cmd/6l/enam.c -%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go - -%exclude %{goroot}/src/pkg/runtime/zasm_linux_arm.h -%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zmprof_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/znoasm_arm_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_arm.go -%exclude %{goroot}/src/pkg/runtime/zsema_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zstring_linux_arm.c -%exclude %{goroot}/src/pkg/runtime/zsys_linux_arm.s -%exclude %{goroot}/src/pkg/runtime/ztime_linux_arm.c -%endif - %ifarch %{ix86} %files pkg-bin-linux-386 @@ -778,6 +668,10 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %{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 @@ -819,10 +713,18 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %{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 @@ -864,6 +766,10 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %{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 @@ -978,6 +884,9 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std %changelog +* Tue Jul 08 2014 Vincent Batts - 1.2.2-8 +- `go install std` requires gcc, to build cgo. bz1105901, bz1101508 + * Wed May 21 2014 Vincent Batts 1.2.2-7 - bz1099206 ghost files are not what is needed From e3554eaea80a6e928043be91e9af906a3f642c05 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 15 Jul 2014 12:30:16 -0400 Subject: [PATCH 010/156] fix gdb init for safe-paths bz981356 Conflicts: golang.spec --- golang-gdbinit | 1 - golang.spec | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/golang-gdbinit b/golang-gdbinit index 0a32958..4ef690b 100644 --- a/golang-gdbinit +++ b/golang-gdbinit @@ -1,2 +1 @@ add-auto-load-safe-path /usr/lib/golang/src/pkg/runtime/runtime-gdb.py -add-auto-load-safe-path /usr/lib64/golang/src/pkg/runtime/runtime-gdb.py diff --git a/golang.spec b/golang.spec index f74d7fd..40520ae 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 8%{?dist} +Release: 9%{?dist} Summary: The Go Programming Language License: BSD @@ -544,7 +544,7 @@ cp -av misc/zsh/go $RPM_BUILD_ROOT%{_datadir}/zsh/site-functions # gdbinit mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d -cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang +cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang.gdb # prelink blacklist mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d @@ -884,7 +884,10 @@ fi %changelog -* Tue Jul 08 2014 Vincent Batts - 1.2.2-8 +* Tue Jul 15 2014 Vincent Batts - 1.2.2-9 +- fix the loading of gdb safe-path. bz981356 + +* Tue Jul 08 2014 Vincent Batts - 1.2.2-8 - `go install std` requires gcc, to build cgo. bz1105901, bz1101508 * Wed May 21 2014 Vincent Batts 1.2.2-7 @@ -934,7 +937,7 @@ fi * Tue Mar 04 2014 Adam Miller 1.2.1-1 - Update to latest upstream -* Thu Feb 20 2014 Adam Miller 1.2-7 +* Thu Feb 20 2014 Adam Miller 1.2-7 - Remove _BSD_SOURCE and _SVID_SOURCE, they are deprecated in recent versions of glibc and aren't needed From 73415829c2034aeee8d039f9f732ab253682d95c Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 15 Jul 2014 12:30:16 -0400 Subject: [PATCH 011/156] fix gdb init for safe-paths bz981356 Conflicts: golang.spec --- golang-gdbinit | 1 - golang.spec | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/golang-gdbinit b/golang-gdbinit index 0a32958..4ef690b 100644 --- a/golang-gdbinit +++ b/golang-gdbinit @@ -1,2 +1 @@ add-auto-load-safe-path /usr/lib/golang/src/pkg/runtime/runtime-gdb.py -add-auto-load-safe-path /usr/lib64/golang/src/pkg/runtime/runtime-gdb.py diff --git a/golang.spec b/golang.spec index 786ed04..f7c32ae 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 8%{?dist} +Release: 9%{?dist} Summary: The Go Programming Language License: BSD @@ -544,7 +544,7 @@ cp -av misc/zsh/go $RPM_BUILD_ROOT%{_datadir}/zsh/site-functions # gdbinit mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d -cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang +cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang.gdb # prelink blacklist mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d @@ -884,7 +884,10 @@ fi %changelog -* Tue Jul 08 2014 Vincent Batts - 1.2.2-8 +* Tue Jul 15 2014 Vincent Batts - 1.2.2-9 +- fix the loading of gdb safe-path. bz981356 + +* Tue Jul 08 2014 Vincent Batts - 1.2.2-8 - `go install std` requires gcc, to build cgo. bz1105901, bz1101508 * Wed May 21 2014 Vincent Batts 1.2.2-7 @@ -934,7 +937,7 @@ fi * Tue Mar 04 2014 Adam Miller 1.2.1-1 - Update to latest upstream -* Thu Feb 20 2014 Adam Miller 1.2-7 +* Thu Feb 20 2014 Adam Miller 1.2-7 - Remove _BSD_SOURCE and _SVID_SOURCE, they are deprecated in recent versions of glibc and aren't needed From 8712265c7e57f7415c1cc5b30ff96e882b2d8949 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 15 Jul 2014 12:30:16 -0400 Subject: [PATCH 012/156] fix gdb init for safe-paths bz981356 Conflicts: golang.spec --- golang-gdbinit | 1 - golang.spec | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/golang-gdbinit b/golang-gdbinit index 0a32958..4ef690b 100644 --- a/golang-gdbinit +++ b/golang-gdbinit @@ -1,2 +1 @@ add-auto-load-safe-path /usr/lib/golang/src/pkg/runtime/runtime-gdb.py -add-auto-load-safe-path /usr/lib64/golang/src/pkg/runtime/runtime-gdb.py diff --git a/golang.spec b/golang.spec index 6f769e2..4693899 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 8%{?dist} +Release: 9%{?dist} Summary: The Go Programming Language License: BSD @@ -544,7 +544,7 @@ cp -av misc/zsh/go $RPM_BUILD_ROOT%{_datadir}/zsh/site-functions # gdbinit mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d -cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang +cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang.gdb # prelink blacklist mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d @@ -884,7 +884,10 @@ fi %changelog -* Tue Jul 08 2014 Vincent Batts - 1.2.2-8 +* Tue Jul 15 2014 Vincent Batts - 1.2.2-9 +- fix the loading of gdb safe-path. bz981356 + +* Tue Jul 08 2014 Vincent Batts - 1.2.2-8 - `go install std` requires gcc, to build cgo. bz1105901, bz1101508 * Wed May 21 2014 Vincent Batts 1.2.2-7 @@ -934,7 +937,7 @@ fi * Tue Mar 04 2014 Adam Miller 1.2.1-1 - Update to latest upstream -* Thu Feb 20 2014 Adam Miller 1.2-7 +* Thu Feb 20 2014 Adam Miller 1.2-7 - Remove _BSD_SOURCE and _SVID_SOURCE, they are deprecated in recent versions of glibc and aren't needed From 9abed9ed8411d1c50e7277300027e0e2585f3018 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 6 Aug 2014 21:23:25 +0000 Subject: [PATCH 013/156] making the golang-src package arch'ed. Fixes bz1099206 Conflicts: golang.spec --- golang.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/golang.spec b/golang.spec index 40520ae..c2159c4 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 9%{?dist} +Release: 10%{?dist} Summary: The Go Programming Language License: BSD @@ -161,8 +161,6 @@ BuildArch: noarch %package src Summary: Golang compiler source tree Requires: go = %{version}-%{release} -# the binary bits in this tree are for testdata -BuildArch: noarch %description src %{summary} @@ -884,6 +882,9 @@ fi %changelog +* Wed Aug 06 2014 Vincent Batts - 1.2.2-10 +- make the source subpackage arch'ed, instead of noarch + * Tue Jul 15 2014 Vincent Batts - 1.2.2-9 - fix the loading of gdb safe-path. bz981356 From c6c5ac57e3d3eeca2660b193b26222b2cf4f8ae6 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 6 Aug 2014 21:23:25 +0000 Subject: [PATCH 014/156] making the golang-src package arch'ed. Fixes bz1099206 Conflicts: golang.spec --- golang.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/golang.spec b/golang.spec index f7c32ae..11be215 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 9%{?dist} +Release: 10%{?dist} Summary: The Go Programming Language License: BSD @@ -161,8 +161,6 @@ BuildArch: noarch %package src Summary: Golang compiler source tree Requires: go = %{version}-%{release} -# the binary bits in this tree are for testdata -BuildArch: noarch %description src %{summary} @@ -884,6 +882,9 @@ fi %changelog +* Wed Aug 06 2014 Vincent Batts - 1.2.2-10 +- make the source subpackage arch'ed, instead of noarch + * Tue Jul 15 2014 Vincent Batts - 1.2.2-9 - fix the loading of gdb safe-path. bz981356 From 97dd9b460e6744d14872751426814b575359eda4 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 6 Aug 2014 21:23:25 +0000 Subject: [PATCH 015/156] making the golang-src package arch'ed. Fixes bz1099206 Conflicts: golang.spec --- golang.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/golang.spec b/golang.spec index 4693899..9923ecf 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 9%{?dist} +Release: 10%{?dist} Summary: The Go Programming Language License: BSD @@ -161,8 +161,6 @@ BuildArch: noarch %package src Summary: Golang compiler source tree Requires: go = %{version}-%{release} -# the binary bits in this tree are for testdata -BuildArch: noarch %description src %{summary} @@ -884,6 +882,9 @@ fi %changelog +* Wed Aug 06 2014 Vincent Batts - 1.2.2-10 +- make the source subpackage arch'ed, instead of noarch + * Tue Jul 15 2014 Vincent Batts - 1.2.2-9 - fix the loading of gdb safe-path. bz981356 From 6da1cd966e9a5d36005c1f30f1d7b09c9210c653 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 7 Aug 2014 03:39:03 +0000 Subject: [PATCH 016/156] xemacs version constraint for bz1127518 --- golang.spec | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/golang.spec b/golang.spec index c2159c4..9789ed8 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 10%{?dist} +Release: 11%{?dist} Summary: The Go Programming Language License: BSD @@ -65,7 +65,10 @@ Requires: golang-src BuildRequires: emacs # xemacs on fedora only %if 0%{?fedora} -BuildRequires: xemacs xemacs-packages-extra +BuildRequires: xemacs +# xemacs-packages-extra-20130408-3 worked fine, but not the newer bump +# https://bugzilla.redhat.com/show_bug.cgi?id=1127518 +BuildRequires: xemacs-packages-extra < 20140705-1 %endif Patch0: golang-1.2-verbose-build.patch @@ -149,7 +152,8 @@ BuildArch: noarch %package -n xemacs-%{name} Summary: XEmacs add-on package for Go Requires: xemacs(bin) >= %{_xemacs_version} -Requires: xemacs-packages-extra +# https://bugzilla.redhat.com/show_bug.cgi?id=1127518 +Requires: xemacs-packages-extra < 20140705-1 BuildArch: noarch %description -n xemacs-%{name} @@ -882,6 +886,9 @@ fi %changelog +* Wed Aug 06 2014 Vincent Batts - 1.2.2-11 +- set a version constraint on xemacs due to bz1127518 + * Wed Aug 06 2014 Vincent Batts - 1.2.2-10 - make the source subpackage arch'ed, instead of noarch From 688fe6aa08324e6483685fac593fc6536bbed141 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 8 Aug 2014 17:03:30 +0000 Subject: [PATCH 017/156] another version constraint on xemacs to not use the broken version of xemacs-packages-extra --- golang.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/golang.spec b/golang.spec index 9789ed8..10ea702 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 11%{?dist} +Release: 12%{?dist} Summary: The Go Programming Language License: BSD @@ -68,7 +68,8 @@ BuildRequires: emacs BuildRequires: xemacs # xemacs-packages-extra-20130408-3 worked fine, but not the newer bump # https://bugzilla.redhat.com/show_bug.cgi?id=1127518 -BuildRequires: xemacs-packages-extra < 20140705-1 +BuildConflicts: xemacs-packages-extra == 20140705-1 +BuildRequires: xemacs-packages-extra %endif Patch0: golang-1.2-verbose-build.patch @@ -152,8 +153,7 @@ BuildArch: noarch %package -n xemacs-%{name} Summary: XEmacs add-on package for Go Requires: xemacs(bin) >= %{_xemacs_version} -# https://bugzilla.redhat.com/show_bug.cgi?id=1127518 -Requires: xemacs-packages-extra < 20140705-1 +Requires: xemacs-packages-extra BuildArch: noarch %description -n xemacs-%{name} @@ -886,6 +886,9 @@ fi %changelog +* Fri Aug 08 2014 Vincent Batts - 1.2.2-12 +- set another version constraint on xemacs due to bz1127518 + * Wed Aug 06 2014 Vincent Batts - 1.2.2-11 - set a version constraint on xemacs due to bz1127518 From 90e73267ad61eecb9d5b354ba2bbd7115ff1da55 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 8 Aug 2014 21:11:50 +0000 Subject: [PATCH 018/156] set source directory timestamps during %install --- golang.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 10ea702..ac10839 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 12%{?dist} +Release: 13%{?dist} Summary: The Go Programming Language License: BSD @@ -476,6 +476,8 @@ mkdir -p $RPM_BUILD_ROOT%{goroot} cp -apv api bin doc favicon.ico include lib pkg robots.txt src misc VERSION \ $RPM_BUILD_ROOT%{goroot} +find $RPM_BUILD_ROOT%{goroot}/src -type d -exec touch -r $RPM_BUILD_ROOT%{goroot}/VERSION "{}" \; + # remove the unnecessary zoneinfo file (Go will always use the system one first) rm -rfv $RPM_BUILD_ROOT%{goroot}/lib/time @@ -886,6 +888,9 @@ fi %changelog +* Fri Aug 08 2014 Vincent Batts - 1.2.2-13 +- update timestamps of source during %%install bz1099206 + * Fri Aug 08 2014 Vincent Batts - 1.2.2-12 - set another version constraint on xemacs due to bz1127518 From ab7a3d0b63fae54ce28da54ddaf87931a62026b5 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 11 Aug 2014 14:41:34 +0000 Subject: [PATCH 019/156] don't just update directories Conflicts: golang.spec --- golang.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/golang.spec b/golang.spec index ac10839..fc39981 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 13%{?dist} +Release: 14%{?dist} Summary: The Go Programming Language License: BSD @@ -476,7 +476,8 @@ mkdir -p $RPM_BUILD_ROOT%{goroot} cp -apv api bin doc favicon.ico include lib pkg robots.txt src misc VERSION \ $RPM_BUILD_ROOT%{goroot} -find $RPM_BUILD_ROOT%{goroot}/src -type d -exec touch -r $RPM_BUILD_ROOT%{goroot}/VERSION "{}" \; +# bz1099206 +find $RPM_BUILD_ROOT%{goroot}/src -exec touch -r $RPM_BUILD_ROOT%{goroot}/VERSION "{}" \; # remove the unnecessary zoneinfo file (Go will always use the system one first) rm -rfv $RPM_BUILD_ROOT%{goroot}/lib/time @@ -888,6 +889,9 @@ fi %changelog +* Mon Aug 11 2014 Vincent Batts - 1.2.2-14 +- update timestamps of source files during %%install bz1099206 + * Fri Aug 08 2014 Vincent Batts - 1.2.2-13 - update timestamps of source during %%install bz1099206 From ea1d7adb978a2589462e8502bc560fde10a8269a Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 11 Aug 2014 15:28:01 +0000 Subject: [PATCH 020/156] make golang-src noarch again Conflicts: golang.spec --- golang.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index fc39981..87a2d61 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 14%{?dist} +Release: 15%{?dist} Summary: The Go Programming Language License: BSD @@ -165,6 +165,7 @@ BuildArch: noarch %package src Summary: Golang compiler source tree Requires: go = %{version}-%{release} +BuildArch: noarch %description src %{summary} @@ -889,6 +890,9 @@ fi %changelog +* Mon Aug 11 2014 Vincent Batts - 1.2.2-15 +- make golang-src 'noarch' again, since that was not a fix, and takes up more space + * Mon Aug 11 2014 Vincent Batts - 1.2.2-14 - update timestamps of source files during %%install bz1099206 From abfb918aebe04f2c221f6e6e2d8ae847360bb3d0 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 11 Aug 2014 18:54:30 +0000 Subject: [PATCH 021/156] more touching --- .gitignore | 1 + golang.spec | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8f0d407..11e6069 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /golang-19087:a15f344a9efa-xattrs.tar /go1.2.1.src.tar.gz /go1.2.2.src.tar.gz +/go1.3.src.tar.gz diff --git a/golang.spec b/golang.spec index 87a2d61..49d74e0 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 15%{?dist} +Release: 16%{?dist} Summary: The Go Programming Language License: BSD @@ -479,6 +479,10 @@ cp -apv api bin doc favicon.ico include lib pkg robots.txt src misc VERSION \ # bz1099206 find $RPM_BUILD_ROOT%{goroot}/src -exec touch -r $RPM_BUILD_ROOT%{goroot}/VERSION "{}" \; +# and level out all the built archives +touch $RPM_BUILD_ROOT%{goroot}/pkg +find $RPM_BUILD_ROOT%{goroot}/pkg -exec touch -r $RPM_BUILD_ROOT%{goroot}/pkg "{}" \; + # remove the unnecessary zoneinfo file (Go will always use the system one first) rm -rfv $RPM_BUILD_ROOT%{goroot}/lib/time @@ -890,6 +894,9 @@ fi %changelog +* Mon Aug 11 2014 Vincent Batts - 1.2.2-16 +- touch all the built archives to be the same + * Mon Aug 11 2014 Vincent Batts - 1.2.2-15 - make golang-src 'noarch' again, since that was not a fix, and takes up more space From 9380b0ecebc3ab83622f68a2d860502c94f7ff9c Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 12 Aug 2014 15:01:25 +0000 Subject: [PATCH 022/156] file list for src tree --- golang.spec | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/golang.spec b/golang.spec index 49d74e0..0894db9 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ Name: golang Version: 1.2.2 -Release: 16%{?dist} +Release: 17%{?dist} Summary: The Go Programming Language License: BSD @@ -482,7 +482,13 @@ find $RPM_BUILD_ROOT%{goroot}/src -exec touch -r $RPM_BUILD_ROOT%{goroot}/VERSIO # and level out all the built archives touch $RPM_BUILD_ROOT%{goroot}/pkg find $RPM_BUILD_ROOT%{goroot}/pkg -exec touch -r $RPM_BUILD_ROOT%{goroot}/pkg "{}" \; - +# generate the spec file ownership of this source tree +src_list=$(pwd)/go-src.list +touch $src_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 +popd # remove the unnecessary zoneinfo file (Go will always use the system one first) rm -rfv $RPM_BUILD_ROOT%{goroot}/lib/time @@ -665,7 +671,7 @@ fi %{_xemacs_sitestartdir}/*.el %endif -%files src +%files -f go-src.list src %{goroot}/src/ %ifarch %{ix86} @@ -894,6 +900,9 @@ fi %changelog +* Tue Aug 12 2014 Vincent Batts - 1.2.2-17 +- explicitly list all the files and directories of the src tree, to preserve timestamps + * Mon Aug 11 2014 Vincent Batts - 1.2.2-16 - touch all the built archives to be the same From 110e264e04a7b5d2f987c8fa5364fc654cc5559a Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 12 Aug 2014 20:52:59 +0000 Subject: [PATCH 023/156] now build file list for pkg rpms too --- golang.spec | 97 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 35 deletions(-) diff --git a/golang.spec b/golang.spec index 0894db9..439ddda 100644 --- a/golang.spec +++ b/golang.spec @@ -23,6 +23,9 @@ %global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \ /usr/lib/rpm/brp-compress +# allow turning this off +%{!?build_xemacs:%global build_xemacs 1} + # let this match the macros in macros.golang %global goroot /usr/lib/%{name} %global gopath %{_datadir}/gocode @@ -39,7 +42,7 @@ Name: golang Version: 1.2.2 -Release: 17%{?dist} +Release: 18%{?dist} Summary: The Go Programming Language License: BSD @@ -64,7 +67,7 @@ Requires: golang-src BuildRequires: emacs # xemacs on fedora only -%if 0%{?fedora} +%if 0%{?fedora} && %{build_xemacs} == 1 BuildRequires: xemacs # xemacs-packages-extra-20130408-3 worked fine, but not the newer bump # https://bugzilla.redhat.com/show_bug.cgi?id=1127518 @@ -149,7 +152,7 @@ BuildArch: noarch # xemacs on fedora only -%if 0%{?fedora} +%if 0%{?fedora} && %{build_xemacs} == 1 %package -n xemacs-%{name} Summary: XEmacs add-on package for Go Requires: xemacs(bin) >= %{_xemacs_version} @@ -447,7 +450,7 @@ popd cd misc mv emacs/go-mode-load.el emacs/%{name}-init.el # xemacs on fedora only -%if 0%{?fedora} +%if 0%{?fedora} && %{build_xemacs} == 1 cp -av emacs xemacs %{_xemacs_bytecompile} xemacs/go-mode.el %endif @@ -455,16 +458,6 @@ cp -av emacs xemacs cd .. -%check -export GOROOT=$(pwd -P) -export PATH="$PATH":"$GOROOT"/bin -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 -./run.bash --no-rebuild -cd .. - - %install rm -rf $RPM_BUILD_ROOT @@ -482,12 +475,30 @@ find $RPM_BUILD_ROOT%{goroot}/src -exec touch -r $RPM_BUILD_ROOT%{goroot}/VERSIO # and level out all the built archives touch $RPM_BUILD_ROOT%{goroot}/pkg find $RPM_BUILD_ROOT%{goroot}/pkg -exec touch -r $RPM_BUILD_ROOT%{goroot}/pkg "{}" \; -# generate the spec file ownership of this source tree -src_list=$(pwd)/go-src.list +# 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 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 + + + 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 popd # remove the unnecessary zoneinfo file (Go will always use the system one first) @@ -541,7 +552,7 @@ cp -av misc/emacs/go-mode.* $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name} cp -av misc/emacs/%{name}-init.el $RPM_BUILD_ROOT%{_emacs_sitestartdir} # xemacs on fedora only -%if 0%{?fedora} +%if 0%{?fedora} && %{build_xemacs} == 1 # misc/xemacs mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitelispdir}/%{name} mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitestartdir} @@ -576,6 +587,19 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm cp -av %{SOURCE102} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.golang %endif +%check +export GOROOT=$(pwd -P) +export PATH="$PATH":"$GOROOT"/bin +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 +./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 @@ -664,7 +688,7 @@ fi # xemacs on fedora only -%if 0%{?fedora} +%if 0%{?fedora} && %{build_xemacs} == 1 %files -n xemacs-%{name} %doc AUTHORS CONTRIBUTORS LICENSE PATENTS %{_xemacs_sitelispdir}/%{name} @@ -810,7 +834,7 @@ fi %{goroot}/src/pkg/runtime/ztime_linux_arm.c %endif -%files pkg-linux-386 +%files pkg-linux-386 -f pkg-linux-386.list %{goroot}/pkg/linux_386/ %ifarch %{ix86} %exclude %{goroot}/pkg/linux_386/runtime/cgo.a @@ -819,7 +843,7 @@ fi %{goroot}/pkg/tool/linux_386/fix %{goroot}/pkg/tool/linux_386/yacc -%files pkg-linux-amd64 +%files pkg-linux-amd64 -f pkg-linux-amd64.list %{goroot}/pkg/linux_amd64/ %ifarch x86_64 %exclude %{goroot}/pkg/linux_amd64/runtime/cgo.a @@ -828,7 +852,7 @@ fi %{goroot}/pkg/tool/linux_amd64/fix %{goroot}/pkg/tool/linux_amd64/yacc -%files pkg-linux-arm +%files pkg-linux-arm -f pkg-linux-arm.list %{goroot}/pkg/linux_arm/ %ifarch %{arm} %exclude %{goroot}/pkg/linux_arm/runtime/cgo.a @@ -837,59 +861,59 @@ fi %{goroot}/pkg/tool/linux_arm/fix %{goroot}/pkg/tool/linux_arm/yacc -%files pkg-darwin-386 +%files pkg-darwin-386 -f pkg-darwin-386.list %{goroot}/pkg/darwin_386/ %{goroot}/pkg/tool/darwin_386/ -%files pkg-darwin-amd64 +%files pkg-darwin-amd64 -f pkg-darwin-amd64.list %{goroot}/pkg/darwin_amd64/ %{goroot}/pkg/tool/darwin_amd64/ -%files pkg-windows-386 +%files pkg-windows-386 -f pkg-windows-386.list %{goroot}/pkg/windows_386/ %{goroot}/pkg/tool/windows_386/ -%files pkg-windows-amd64 +%files pkg-windows-amd64 -f pkg-windows-amd64.list %{goroot}/pkg/windows_amd64/ %{goroot}/pkg/tool/windows_amd64/ -%files pkg-plan9-386 +%files pkg-plan9-386 -f pkg-plan9-386.list %{goroot}/pkg/plan9_386/ %{goroot}/pkg/tool/plan9_386/ -%files pkg-plan9-amd64 +%files pkg-plan9-amd64 -f pkg-plan9-amd64.list %{goroot}/pkg/plan9_amd64/ %{goroot}/pkg/tool/plan9_amd64/ -%files pkg-freebsd-386 +%files pkg-freebsd-386 -f pkg-freebsd-386.list %{goroot}/pkg/freebsd_386/ %{goroot}/pkg/tool/freebsd_386/ -%files pkg-freebsd-amd64 +%files pkg-freebsd-amd64 -f pkg-freebsd-amd64.list %{goroot}/pkg/freebsd_amd64/ %{goroot}/pkg/tool/freebsd_amd64/ -%files pkg-freebsd-arm +%files pkg-freebsd-arm -f pkg-freebsd-arm.list %{goroot}/pkg/freebsd_arm/ %{goroot}/pkg/tool/freebsd_arm/ -%files pkg-netbsd-386 +%files pkg-netbsd-386 -f pkg-netbsd-386.list %{goroot}/pkg/netbsd_386/ %{goroot}/pkg/tool/netbsd_386/ -%files pkg-netbsd-amd64 +%files pkg-netbsd-amd64 -f pkg-netbsd-amd64.list %{goroot}/pkg/netbsd_amd64/ %{goroot}/pkg/tool/netbsd_amd64/ -%files pkg-netbsd-arm +%files pkg-netbsd-arm -f pkg-netbsd-arm.list %{goroot}/pkg/netbsd_arm/ %{goroot}/pkg/tool/netbsd_arm/ -%files pkg-openbsd-386 +%files pkg-openbsd-386 -f pkg-openbsd-386.list %{goroot}/pkg/openbsd_386/ %{goroot}/pkg/tool/openbsd_386/ -%files pkg-openbsd-amd64 +%files pkg-openbsd-amd64 -f pkg-openbsd-amd64.list %{goroot}/pkg/openbsd_amd64/ %{goroot}/pkg/tool/openbsd_amd64/ @@ -900,6 +924,9 @@ fi %changelog +* Tue Aug 12 2014 Vincent Batts - 1.2.2-18 +- explicitly list all the files and directories for the packages trees + * Tue Aug 12 2014 Vincent Batts - 1.2.2-17 - explicitly list all the files and directories of the src tree, to preserve timestamps From 3b49f3293c98ef0767e2b75c6d7f8fdb4926739a Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 13 Aug 2014 01:04:25 +0000 Subject: [PATCH 024/156] touch cgo.a in a %post Signed-off-by: Vincent Batts --- golang.spec | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 439ddda..3473f9a 100644 --- a/golang.spec +++ b/golang.spec @@ -42,7 +42,7 @@ Name: golang Version: 1.2.2 -Release: 18%{?dist} +Release: 19%{?dist} Summary: The Go Programming Language License: BSD @@ -603,6 +603,13 @@ 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, +# then a multitude of packages will appear Stale. For sanity we'll check whether cgo is Stale, and plum it up to runtime.a +if go list -json runtime/cgo | grep -q Stale ; then + runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') + cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') + touch -r ${runtime_file} ${cgo_file} +fi %{_sbindir}/update-alternatives --install %{_bindir}/go \ go %{goroot}/bin/linux_386/go 90 \ --slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_386/gofmt @@ -615,6 +622,13 @@ fi %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, +# then a multitude of packages will appear Stale. For sanity we'll check whether cgo is Stale, and plum it up to runtime.a +if go list -json runtime/cgo | grep -q Stale ; then + runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') + cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') + touch -r ${runtime_file} ${cgo_file} +fi %{_sbindir}/update-alternatives --install %{_bindir}/go \ go %{goroot}/bin/linux_amd64/go 90 \ --slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_amd64/gofmt @@ -627,6 +641,13 @@ fi %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, +# then a multitude of packages will appear Stale. For sanity we'll check whether cgo is Stale, and plum it up to runtime.a +if go list -json runtime/cgo | grep -q Stale ; then + runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') + cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') + touch -r ${runtime_file} ${cgo_file} +fi %{_sbindir}/update-alternatives --install %{_bindir}/go \ go %{goroot}/bin/linux_arm/go 90 \ --slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_arm/gofmt @@ -924,6 +945,9 @@ fi %changelog +* Tue Aug 12 2014 Vincent Batts - 1.2.2-19 +- finally check for a Stale cgo in a %%post + * Tue Aug 12 2014 Vincent Batts - 1.2.2-18 - explicitly list all the files and directories for the packages trees From 31e8a62d232ec1759b91187517018978b41a4e2f Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 13 Aug 2014 11:55:03 +0000 Subject: [PATCH 025/156] order the deps for the %post to run correctly Signed-off-by: Vincent Batts --- golang.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 3473f9a..d766d18 100644 --- a/golang.spec +++ b/golang.spec @@ -42,7 +42,7 @@ Name: golang Version: 1.2.2 -Release: 19%{?dist} +Release: 20%{?dist} Summary: The Go Programming Language License: BSD @@ -179,6 +179,7 @@ BuildArch: noarch Summary: Golang compiler tool for linux 386 Requires: go = %{version}-%{release} Requires: golang-pkg-linux-386 = %{version}-%{release} +Requires(post): golang-pkg-linux-386 = %{version}-%{release} Provides: golang-bin = 386 # We strip the meta dependency, but go does require glibc. # This is an odd issue, still looking for a better fix. @@ -194,6 +195,7 @@ Requires(postun): %{_sbindir}/update-alternatives 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 # We strip the meta dependency, but go does require glibc. # This is an odd issue, still looking for a better fix. @@ -209,6 +211,7 @@ Requires(postun): %{_sbindir}/update-alternatives 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 # We strip the meta dependency, but go does require glibc. # This is an odd issue, still looking for a better fix. @@ -945,6 +948,9 @@ fi %changelog +* Wed Aug 13 2014 Vincent Batts - 1.2.2-20 +- rpm dependency ordering for %%post + * Tue Aug 12 2014 Vincent Batts - 1.2.2-19 - finally check for a Stale cgo in a %%post From 33152ba710583cace2f5602cec4b4ce292b9e891 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 13 Aug 2014 14:32:02 +0000 Subject: [PATCH 026/156] touch cgo.a in %post, regardless --- golang.spec | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/golang.spec b/golang.spec index d766d18..0887274 100644 --- a/golang.spec +++ b/golang.spec @@ -42,7 +42,7 @@ Name: golang Version: 1.2.2 -Release: 20%{?dist} +Release: 21%{?dist} Summary: The Go Programming Language License: BSD @@ -607,12 +607,10 @@ 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, -# then a multitude of packages will appear Stale. For sanity we'll check whether cgo is Stale, and plum it up to runtime.a -if go list -json runtime/cgo | grep -q Stale ; then - runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') - cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') - touch -r ${runtime_file} ${cgo_file} -fi +runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') +cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') +touch -r ${runtime_file} ${cgo_file} + %{_sbindir}/update-alternatives --install %{_bindir}/go \ go %{goroot}/bin/linux_386/go 90 \ --slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_386/gofmt @@ -626,12 +624,10 @@ fi %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, -# then a multitude of packages will appear Stale. For sanity we'll check whether cgo is Stale, and plum it up to runtime.a -if go list -json runtime/cgo | grep -q Stale ; then - runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') - cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') - touch -r ${runtime_file} ${cgo_file} -fi +runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') +cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') +touch -r ${runtime_file} ${cgo_file} + %{_sbindir}/update-alternatives --install %{_bindir}/go \ go %{goroot}/bin/linux_amd64/go 90 \ --slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_amd64/gofmt @@ -645,12 +641,10 @@ fi %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, -# then a multitude of packages will appear Stale. For sanity we'll check whether cgo is Stale, and plum it up to runtime.a -if go list -json runtime/cgo | grep -q Stale ; then - runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') - cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') - touch -r ${runtime_file} ${cgo_file} -fi +runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') +cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') +touch -r ${runtime_file} ${cgo_file} + %{_sbindir}/update-alternatives --install %{_bindir}/go \ go %{goroot}/bin/linux_arm/go 90 \ --slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_arm/gofmt @@ -948,6 +942,9 @@ fi %changelog +* Wed Aug 13 2014 Vincent Batts - 1.2.2-21 +- touch cgo.a regardless + * Wed Aug 13 2014 Vincent Batts - 1.2.2-20 - rpm dependency ordering for %%post From 84033d417e23b09d4702e5062368326b3b27d8b2 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 13 Aug 2014 16:54:12 +0000 Subject: [PATCH 027/156] not sure why this %post is not setting the mtime of cgo.a. Making it more explicit --- golang.spec | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/golang.spec b/golang.spec index 0887274..c30b9bb 100644 --- a/golang.spec +++ b/golang.spec @@ -42,7 +42,7 @@ Name: golang Version: 1.2.2 -Release: 21%{?dist} +Release: 22%{?dist} Summary: The Go Programming Language License: BSD @@ -607,9 +607,7 @@ 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, -runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') -cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') -touch -r ${runtime_file} ${cgo_file} +touch -r %{goroot}/pkg/linux_386/runtime.a %{goroot}/pkg/linux_386/runtime/cgo.a %{_sbindir}/update-alternatives --install %{_bindir}/go \ go %{goroot}/bin/linux_386/go 90 \ @@ -624,9 +622,7 @@ fi %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, -runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') -cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') -touch -r ${runtime_file} ${cgo_file} +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 \ @@ -641,9 +637,7 @@ fi %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, -runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') -cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/') -touch -r ${runtime_file} ${cgo_file} +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 \ @@ -942,6 +936,9 @@ fi %changelog +* Wed Aug 13 2014 Vincent Batts - 1.2.2-22 +- more work to get cgo.a timestamps to line up, due to build-env + * Wed Aug 13 2014 Vincent Batts - 1.2.2-21 - touch cgo.a regardless From e0d801060b7ef94d7b2fed314562949dc8dcda8d Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 24 Oct 2014 10:34:14 -0400 Subject: [PATCH 028/156] gccgo and macros for https://bugzilla.redhat.com/show_bug.cgi?id=1156129 we're putting the macros in its own rpm. Also, starting the work on rpm dependencies to accomodate gccgo --- golang.spec | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/golang.spec b/golang.spec index c7a80dc..daf8a4d 100644 --- a/golang.spec +++ b/golang.spec @@ -37,6 +37,8 @@ %global gohostarch arm %endif +%global go_api 1.3.3 + Name: golang Version: 1.3.3 Release: 1%{?dist} @@ -60,7 +62,8 @@ BuildRequires: /bin/hostname Provides: go = %{version}-%{release} Requires: golang-bin -Requires: golang-src +Requires: golang-src = %{version}-%{release} +Requires: golang-srpm-macros = %{version}-%{release} BuildRequires: emacs @@ -108,6 +111,14 @@ Source102: macros.golang #%{summary}. +%package srpm-macros +Summary: RPM macros for the Go programming language +BuildArch: noarch + +%description srpm-macros +%{summary}. + + %package vim Summary: Vim plugins for Go # fedora only @@ -133,7 +144,6 @@ BuildArch: noarch # the source tree %package src Summary: Golang compiler source tree -Requires: go = %{version}-%{release} BuildArch: noarch %description src %{summary} @@ -147,6 +157,7 @@ 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} # We strip the meta dependency, but go does require glibc. # This is an odd issue, still looking for a better fix. Requires: glibc @@ -164,6 +175,7 @@ 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 @@ -181,6 +193,7 @@ 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 @@ -198,6 +211,7 @@ Requires(postun): %{_sbindir}/update-alternatives %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} @@ -205,6 +219,7 @@ BuildArch: noarch %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} @@ -212,6 +227,7 @@ BuildArch: noarch %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} @@ -624,6 +640,8 @@ fi # prelink blacklist %{_sysconfdir}/prelink.conf.d + +%files srpm-macros %if 0%{?rhel} > 6 || 0%{?fedora} > 0 %{_rpmconfigdir}/macros.d/macros.golang %else From c2c5dc1c664a929d7751c869d04800aef6704566 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 24 Oct 2014 11:07:57 -0400 Subject: [PATCH 029/156] bump release --- golang.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/golang.spec b/golang.spec index daf8a4d..86f9dd3 100644 --- a/golang.spec +++ b/golang.spec @@ -19,7 +19,6 @@ # rpmbuild magic to keep from having meta dependency on libc.so.6 %define _use_internal_dependency_generator 0 %define __find_requires %{nil} -%global debug_package %{nil} %global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \ /usr/lib/rpm/brp-compress @@ -41,7 +40,7 @@ Name: golang Version: 1.3.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language License: BSD @@ -916,6 +915,10 @@ fi %changelog +* Fri Oct 24 2014 Vincent Batts - 1.3.3-2 +- split out rpm macros (bz1156129) +- progress on gccgo accomodation + * Wed Oct 01 2014 Vincent Batts - 1.3.3-1 - update to go1.3.3 (bz1146882) From 84f93201d954b212de7a24dfd7d19892c3439b2f Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 30 Oct 2014 14:32:05 -0400 Subject: [PATCH 030/156] revert macros in subpackage they'll need to be in their own rpm entirely --- golang.spec | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/golang.spec b/golang.spec index 86f9dd3..8d84865 100644 --- a/golang.spec +++ b/golang.spec @@ -40,7 +40,7 @@ Name: golang Version: 1.3.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Go Programming Language License: BSD @@ -62,7 +62,6 @@ BuildRequires: /bin/hostname Provides: go = %{version}-%{release} Requires: golang-bin Requires: golang-src = %{version}-%{release} -Requires: golang-srpm-macros = %{version}-%{release} BuildRequires: emacs @@ -110,14 +109,6 @@ Source102: macros.golang #%{summary}. -%package srpm-macros -Summary: RPM macros for the Go programming language -BuildArch: noarch - -%description srpm-macros -%{summary}. - - %package vim Summary: Vim plugins for Go # fedora only @@ -639,8 +630,6 @@ fi # prelink blacklist %{_sysconfdir}/prelink.conf.d - -%files srpm-macros %if 0%{?rhel} > 6 || 0%{?fedora} > 0 %{_rpmconfigdir}/macros.d/macros.golang %else @@ -915,6 +904,9 @@ fi %changelog +* Thu Oct 30 2014 Vincent Batts - 1.3.3-3 +- macros will need to be in their own rpm + * Fri Oct 24 2014 Vincent Batts - 1.3.3-2 - split out rpm macros (bz1156129) - progress on gccgo accomodation From 20cd634d140da5286a8ce6f725fb7c2438ade241 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 4 Nov 2014 10:52:19 -0500 Subject: [PATCH 031/156] update to go1.4beta1 --- .gitignore | 1 + go1.3-tar-fix_writing_of_pax_headers.patch | 110 ------------ go1.3-tar_reuse_buffer_readHeader.patch | 64 ------- go1.3-tar_reuse_buffer_writeHeader.patch | 56 ------ golang-1.2-archive_tar-xattr.patch | 197 --------------------- golang-1.2-remove-ECC-p224.patch | 40 ++--- golang-1.2-skipCpuProfileTest.patch | 12 -- golang-f21-hostname.patch | 4 +- golang.spec | 194 ++------------------ sources | 2 +- 10 files changed, 38 insertions(+), 642 deletions(-) delete mode 100644 go1.3-tar-fix_writing_of_pax_headers.patch delete mode 100644 go1.3-tar_reuse_buffer_readHeader.patch delete mode 100644 go1.3-tar_reuse_buffer_writeHeader.patch delete mode 100644 golang-1.2-archive_tar-xattr.patch delete mode 100644 golang-1.2-skipCpuProfileTest.patch diff --git a/.gitignore b/.gitignore index 281e185..dee89c5 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ /go1.3rc1.src.tar.gz /go1.3rc2.src.tar.gz /go1.3.src.tar.gz +/go1.4beta1.src.tar.gz /golang-19087:a15f344a9efa-xattrs.tar diff --git a/go1.3-tar-fix_writing_of_pax_headers.patch b/go1.3-tar-fix_writing_of_pax_headers.patch deleted file mode 100644 index 1c847e7..0000000 --- a/go1.3-tar-fix_writing_of_pax_headers.patch +++ /dev/null @@ -1,110 +0,0 @@ -# HG changeset patch -# User Cristian Staretu -# Date 1405555229 -36000 -# Thu Jul 17 10:00:29 2014 +1000 -# Node ID 1b17b3426e3c281a973d2d7bbf235b936d6a0942 -# Parent 278365dff593f027db6c6b2c0a89262490d6b676 -archive/tar: fix writing of pax headers - -"archive/tar: reuse temporary buffer in writeHeader" introduced a -change which was supposed to help lower the number of allocations from -512 bytes for every call to writeHeader. This change broke the writing -of PAX headers. - -writeHeader calls writePAXHeader and writePAXHeader calls writeHeader -again. writeHeader will end up writing the PAX header twice. - -example broken header: -PaxHeaders.4007/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021512 xustar0000000000000000 -PaxHeaders.4007/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021512 xustar0000000000000000 - -example correct header: -PaxHeaders.4290/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021516 xustar0000000000000000 -0100644000000000000000000000270412301216634007250 0ustar0000000000000000 - -This commit adds a dedicated buffer for pax headers to the Writer -struct. This change increases the size of the struct by 512 bytes, but -allows tar/writer to avoid allocating 512 bytes for all written -headers and it avoids allocating 512 more bytes for pax headers. - -LGTM=dsymonds -R=dsymonds, dave, iant -CC=golang-codereviews -https://codereview.appspot.com/110480043 - -Committer: David Symonds - -diff -r 278365dff593 -r 1b17b3426e3c src/pkg/archive/tar/writer.go ---- a/src/pkg/archive/tar/writer.go Wed Jul 16 16:29:51 2014 -0700 -+++ b/src/pkg/archive/tar/writer.go Thu Jul 17 10:00:29 2014 +1000 -@@ -39,7 +39,8 @@ - closed bool - usedBinary bool // whether the binary numeric field extension was used - preferPax bool // use pax header instead of binary numeric header -- hdrBuff [blockSize]byte // buffer to use in writeHeader -+ hdrBuff [blockSize]byte // buffer to use in writeHeader when writing a regular header -+ paxHdrBuff [blockSize]byte // buffer to use in writeHeader when writing a pax header - } - - // NewWriter creates a new Writer writing to w. -@@ -161,7 +162,17 @@ - // subsecond time resolution, but for now let's just capture - // too long fields or non ascii characters - -- header := tw.hdrBuff[:] -+ var header []byte -+ -+ // We need to select which scratch buffer to use carefully, -+ // since this method is called recursively to write PAX headers. -+ // If allowPax is true, this is the non-recursive call, and we will use hdrBuff. -+ // If allowPax is false, we are being called by writePAXHeader, and hdrBuff is -+ // already being used by the non-recursive call, so we must use paxHdrBuff. -+ header = tw.hdrBuff[:] -+ if !allowPax { -+ header = tw.paxHdrBuff[:] -+ } - copy(header, zeroBlock) - s := slicer(header) - -diff -r 278365dff593 -r 1b17b3426e3c src/pkg/archive/tar/writer_test.go ---- a/src/pkg/archive/tar/writer_test.go Wed Jul 16 16:29:51 2014 -0700 -+++ b/src/pkg/archive/tar/writer_test.go Thu Jul 17 10:00:29 2014 +1000 -@@ -454,3 +454,38 @@ - t.Fatal("Couldn't recover long name") - } - } -+ -+func TestValidTypeflagWithPAXHeader(t *testing.T) { -+ var buffer bytes.Buffer -+ tw := NewWriter(&buffer) -+ -+ fileName := strings.Repeat("ab", 100) -+ -+ hdr := &Header{ -+ Name: fileName, -+ Size: 4, -+ Typeflag: 0, -+ } -+ if err := tw.WriteHeader(hdr); err != nil { -+ t.Fatalf("Failed to write header: %s", err) -+ } -+ if _, err := tw.Write([]byte("fooo")); err != nil { -+ t.Fatalf("Failed to write the file's data: %s", err) -+ } -+ tw.Close() -+ -+ tr := NewReader(&buffer) -+ -+ for { -+ header, err := tr.Next() -+ if err == io.EOF { -+ break -+ } -+ if err != nil { -+ t.Fatalf("Failed to read header: %s", err) -+ } -+ if header.Typeflag != 0 { -+ t.Fatalf("Typeflag should've been 0, found %d", header.Typeflag) -+ } -+ } -+} diff --git a/go1.3-tar_reuse_buffer_readHeader.patch b/go1.3-tar_reuse_buffer_readHeader.patch deleted file mode 100644 index 1c6693c..0000000 --- a/go1.3-tar_reuse_buffer_readHeader.patch +++ /dev/null @@ -1,64 +0,0 @@ -# HG changeset patch -# User Cristian Staretu -# Date 1404344479 -36000 -# Thu Jul 03 09:41:19 2014 +1000 -# Node ID 17404efd6b02d4b3acd17070e3f89de97a145877 -# Parent 837348e418f33fc7a242f56dbe2feff829532526 -archive/tar: reuse temporary buffer in readHeader - -A temporary 512 bytes buffer is allocated for every call to -readHeader. This buffer isn't returned to the caller and it could -be reused to lower the number of memory allocations. - -This CL improves it by using a pool and zeroing out the buffer before -putting it back into the pool. - -benchmark old ns/op new ns/op delta -BenchmarkListFiles100k 545249903 538832687 -1.18% - -benchmark old allocs new allocs delta -BenchmarkListFiles100k 2105167 2005692 -4.73% - -benchmark old bytes new bytes delta -BenchmarkListFiles100k 105903472 54831527 -48.22% - -This improvement is very important if your code has to deal with a lot -of tarballs which contain a lot of files. - -LGTM=dsymonds -R=golang-codereviews, dave, dsymonds, bradfitz -CC=golang-codereviews -https://codereview.appspot.com/108240044 - -Committer: David Symonds - -diff -r 837348e418f3 -r 17404efd6b02 src/pkg/archive/tar/reader.go ---- a/src/pkg/archive/tar/reader.go Thu Jul 03 09:40:53 2014 +1000 -+++ b/src/pkg/archive/tar/reader.go Thu Jul 03 09:41:19 2014 +1000 -@@ -29,10 +29,11 @@ - // The Next method advances to the next file in the archive (including the first), - // and then it can be treated as an io.Reader to access the file's data. - type Reader struct { -- r io.Reader -- err error -- pad int64 // amount of padding (ignored) after current file entry -- curr numBytesReader // reader for current file entry -+ r io.Reader -+ err error -+ pad int64 // amount of padding (ignored) after current file entry -+ curr numBytesReader // reader for current file entry -+ hdrBuff [blockSize]byte // buffer to use in readHeader - } - - // A numBytesReader is an io.Reader with a numBytes method, returning the number -@@ -426,7 +427,9 @@ - } - - func (tr *Reader) readHeader() *Header { -- header := make([]byte, blockSize) -+ header := tr.hdrBuff[:] -+ copy(header, zeroBlock) -+ - if _, tr.err = io.ReadFull(tr.r, header); tr.err != nil { - return nil - } diff --git a/go1.3-tar_reuse_buffer_writeHeader.patch b/go1.3-tar_reuse_buffer_writeHeader.patch deleted file mode 100644 index 6cd8969..0000000 --- a/go1.3-tar_reuse_buffer_writeHeader.patch +++ /dev/null @@ -1,56 +0,0 @@ -# HG changeset patch -# User Cristian Staretu -# Date 1404344453 -36000 -# Thu Jul 03 09:40:53 2014 +1000 -# Node ID 837348e418f33fc7a242f56dbe2feff829532526 -# Parent c5f72a685e256457a0872f6587e2bb9500eac7c4 -archive/tar: reuse temporary buffer in writeHeader - -A temporary 512 bytes buffer is allocated for every call to -writeHeader. This buffer could be reused the lower the number -of memory allocations. - -benchmark old ns/op new ns/op delta -BenchmarkWriteFiles100k 634622051 583810847 -8.01% - -benchmark old allocs new allocs delta -BenchmarkWriteFiles100k 2701920 2602621 -3.68% - -benchmark old bytes new bytes delta -BenchmarkWriteFiles100k 115383884 64349922 -44.23% - -This change is very important if your code has to write a lot of -tarballs with a lot of files. - -LGTM=dsymonds -R=golang-codereviews, dave, dsymonds -CC=golang-codereviews -https://codereview.appspot.com/107440043 - -Committer: David Symonds - -diff -r c5f72a685e25 -r 837348e418f3 src/pkg/archive/tar/writer.go ---- a/src/pkg/archive/tar/writer.go Wed Jul 02 15:28:57 2014 -0700 -+++ b/src/pkg/archive/tar/writer.go Thu Jul 03 09:40:53 2014 +1000 -@@ -37,8 +37,9 @@ - nb int64 // number of unwritten bytes for current file entry - pad int64 // amount of padding to write after current file entry - closed bool -- usedBinary bool // whether the binary numeric field extension was used -- preferPax bool // use pax header instead of binary numeric header -+ usedBinary bool // whether the binary numeric field extension was used -+ preferPax bool // use pax header instead of binary numeric header -+ hdrBuff [blockSize]byte // buffer to use in writeHeader - } - - // NewWriter creates a new Writer writing to w. -@@ -160,7 +161,8 @@ - // subsecond time resolution, but for now let's just capture - // too long fields or non ascii characters - -- header := make([]byte, blockSize) -+ header := tw.hdrBuff[:] -+ copy(header, zeroBlock) - s := slicer(header) - - // keep a reference to the filename to allow to overwrite it later if we detect that we can use ustar longnames instead of pax diff --git a/golang-1.2-archive_tar-xattr.patch b/golang-1.2-archive_tar-xattr.patch deleted file mode 100644 index 10c8f3d..0000000 --- a/golang-1.2-archive_tar-xattr.patch +++ /dev/null @@ -1,197 +0,0 @@ -# HG changeset patch -# User Alexander Larsson -# Date 1392282510 -39600 -# Node ID a15f344a9efa35ef168c8feaa92a15a1cdc93db5 -# Parent 1a32fe60e0798d82bbff6c945001c7f0ba8de5ea -archive/tar: support extended attributes - -This adds support for archives with the SCHILY.xattr field in the -pax header. This is what gnu tar and star generate. -Fixes issue 7154. - -LGTM=dsymonds -R=golang-codereviews, gobot, dsymonds -CC=golang-codereviews -https://codereview.appspot.com/54570043 - -Committer: David Symonds - -diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/common.go ---- a/src/pkg/archive/tar/common.go Thu Feb 13 03:09:03 2014 -0500 -+++ b/src/pkg/archive/tar/common.go Thu Feb 13 20:08:30 2014 +1100 -@@ -57,6 +57,7 @@ - Devminor int64 // minor number of character or block device - AccessTime time.Time // access time - ChangeTime time.Time // status change time -+ Xattrs map[string]string - } - - // File name constants from the tar spec. -@@ -189,6 +190,7 @@ - paxSize = "size" - paxUid = "uid" - paxUname = "uname" -+ paxXattr = "SCHILY.xattr." - paxNone = "" - ) - -diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/reader.go ---- a/src/pkg/archive/tar/reader.go Thu Feb 13 03:09:03 2014 -0500 -+++ b/src/pkg/archive/tar/reader.go Thu Feb 13 20:08:30 2014 +1100 -@@ -139,8 +139,14 @@ - return err - } - hdr.Size = int64(size) -+ default: -+ if strings.HasPrefix(k, paxXattr) { -+ if hdr.Xattrs == nil { -+ hdr.Xattrs = make(map[string]string) -+ } -+ hdr.Xattrs[k[len(paxXattr):]] = v -+ } - } -- - } - return nil - } -diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/reader_test.go ---- a/src/pkg/archive/tar/reader_test.go Thu Feb 13 03:09:03 2014 -0500 -+++ b/src/pkg/archive/tar/reader_test.go Thu Feb 13 20:08:30 2014 +1100 -@@ -161,6 +161,46 @@ - }, - }, - }, -+ { -+ file: "testdata/xattrs.tar", -+ headers: []*Header{ -+ { -+ Name: "small.txt", -+ Mode: 0644, -+ Uid: 1000, -+ Gid: 10, -+ Size: 5, -+ ModTime: time.Unix(1386065770, 448252320), -+ Typeflag: '0', -+ Uname: "alex", -+ Gname: "wheel", -+ AccessTime: time.Unix(1389782991, 419875220), -+ ChangeTime: time.Unix(1389782956, 794414986), -+ Xattrs: map[string]string{ -+ "user.key": "value", -+ "user.key2": "value2", -+ // Interestingly, selinux encodes the terminating null inside the xattr -+ "security.selinux": "unconfined_u:object_r:default_t:s0\x00", -+ }, -+ }, -+ { -+ Name: "small2.txt", -+ Mode: 0644, -+ Uid: 1000, -+ Gid: 10, -+ Size: 11, -+ ModTime: time.Unix(1386065770, 449252304), -+ Typeflag: '0', -+ Uname: "alex", -+ Gname: "wheel", -+ AccessTime: time.Unix(1389782991, 419875220), -+ ChangeTime: time.Unix(1386065770, 449252304), -+ Xattrs: map[string]string{ -+ "security.selinux": "unconfined_u:object_r:default_t:s0\x00", -+ }, -+ }, -+ }, -+ }, - } - - func TestReader(t *testing.T) { -@@ -180,7 +220,7 @@ - f.Close() - continue testLoop - } -- if *hdr != *header { -+ if !reflect.DeepEqual(*hdr, *header) { - t.Errorf("test %d, entry %d: Incorrect header:\nhave %+v\nwant %+v", - i, j, *hdr, *header) - } -@@ -253,7 +293,7 @@ - } - - // check the header -- if *hdr != *headers[nread] { -+ if !reflect.DeepEqual(*hdr, *headers[nread]) { - t.Errorf("Incorrect header:\nhave %+v\nwant %+v", - *hdr, headers[nread]) - } -diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/writer.go ---- a/src/pkg/archive/tar/writer.go Thu Feb 13 03:09:03 2014 -0500 -+++ b/src/pkg/archive/tar/writer.go Thu Feb 13 20:08:30 2014 +1100 -@@ -236,6 +236,12 @@ - return tw.err - } - -+ if allowPax { -+ for k, v := range hdr.Xattrs { -+ paxHeaders[paxXattr+k] = v -+ } -+ } -+ - if len(paxHeaders) > 0 { - if !allowPax { - return errInvalidHeader -diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/writer_test.go ---- a/src/pkg/archive/tar/writer_test.go Thu Feb 13 03:09:03 2014 -0500 -+++ b/src/pkg/archive/tar/writer_test.go Thu Feb 13 20:08:30 2014 +1100 -@@ -10,6 +10,7 @@ - "io" - "io/ioutil" - "os" -+ "reflect" - "strings" - "testing" - "testing/iotest" -@@ -338,6 +339,45 @@ - } - } - -+func TestPaxXattrs(t *testing.T) { -+ xattrs := map[string]string{ -+ "user.key": "value", -+ } -+ -+ // Create an archive with an xattr -+ fileinfo, err := os.Stat("testdata/small.txt") -+ if err != nil { -+ t.Fatal(err) -+ } -+ hdr, err := FileInfoHeader(fileinfo, "") -+ if err != nil { -+ t.Fatalf("os.Stat: %v", err) -+ } -+ contents := "Kilts" -+ hdr.Xattrs = xattrs -+ var buf bytes.Buffer -+ writer := NewWriter(&buf) -+ if err := writer.WriteHeader(hdr); err != nil { -+ t.Fatal(err) -+ } -+ if _, err = writer.Write([]byte(contents)); err != nil { -+ t.Fatal(err) -+ } -+ if err := writer.Close(); err != nil { -+ t.Fatal(err) -+ } -+ // Test that we can get the xattrs back out of the archive. -+ reader := NewReader(&buf) -+ hdr, err = reader.Next() -+ if err != nil { -+ t.Fatal(err) -+ } -+ if !reflect.DeepEqual(hdr.Xattrs, xattrs) { -+ t.Fatalf("xattrs did not survive round trip: got %+v, want %+v", -+ hdr.Xattrs, xattrs) -+ } -+} -+ - func TestPAXHeader(t *testing.T) { - medName := strings.Repeat("CD", 50) - longName := strings.Repeat("AB", 100) diff --git a/golang-1.2-remove-ECC-p224.patch b/golang-1.2-remove-ECC-p224.patch index 1b9e021..ef5a4a6 100644 --- a/golang-1.2-remove-ECC-p224.patch +++ b/golang-1.2-remove-ECC-p224.patch @@ -10,10 +10,10 @@ Index: go/api/go1.txt pkg crypto/elliptic, func P256() Curve pkg crypto/elliptic, func P384() Curve pkg crypto/elliptic, func P521() Curve -Index: go/src/pkg/crypto/ecdsa/ecdsa_test.go +Index: go/src/crypto/ecdsa/ecdsa_test.go =================================================================== ---- go.orig/src/pkg/crypto/ecdsa/ecdsa_test.go -+++ go/src/pkg/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 } @@ -39,10 +39,10 @@ Index: go/src/pkg/crypto/ecdsa/ecdsa_test.go case "P-256": pub.Curve = elliptic.P256() case "P-384": -Index: go/src/pkg/crypto/elliptic/bottombits.go +Index: go/src/crypto/elliptic/bottombits.go =================================================================== --- /dev/null -+++ go/src/pkg/crypto/elliptic/bottombits.go ++++ go/src/crypto/elliptic/bottombits.go @@ -0,0 +1,14 @@ + +// Copyright 2012 The Go Authors. All rights reserved. @@ -58,10 +58,10 @@ Index: go/src/pkg/crypto/elliptic/bottombits.go +const two31m3 = 1<<31 - 1<<3 +const two31m15m3 = 1<<31 - 1<<15 - 1<<3 + -Index: go/src/pkg/crypto/elliptic/elliptic.go +Index: go/src/crypto/elliptic/elliptic.go =================================================================== ---- go.orig/src/pkg/crypto/elliptic/elliptic.go -+++ go/src/pkg/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 @@ -70,20 +70,20 @@ Index: go/src/pkg/crypto/elliptic/elliptic.go initP256() initP384() initP521() -Index: go/src/pkg/crypto/elliptic/elliptic_test.go +Index: go/src/crypto/elliptic/elliptic_test.go =================================================================== ---- go.orig/src/pkg/crypto/elliptic/elliptic_test.go -+++ go/src/pkg/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/pkg/crypto/elliptic/p224.go +Index: go/src/crypto/elliptic/p224.go =================================================================== ---- go.orig/src/pkg/crypto/elliptic/p224.go -+++ go/src/pkg/crypto/elliptic/p224.go +--- go.orig/src/crypto/elliptic/p224.go ++++ go/src/crypto/elliptic/p224.go @@ -1,3 +1,5 @@ +// +build ignore + @@ -111,20 +111,20 @@ Index: go/src/pkg/crypto/elliptic/p224.go // p224Mul computes *out = a*b // // a[i] < 2**29, b[i] < 2**30 (or vice versa) -Index: go/src/pkg/crypto/elliptic/p224_test.go +Index: go/src/crypto/elliptic/p224_test.go =================================================================== ---- go.orig/src/pkg/crypto/elliptic/p224_test.go -+++ go/src/pkg/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/pkg/crypto/x509/x509.go +Index: go/src/crypto/x509/x509.go =================================================================== ---- go.orig/src/pkg/crypto/x509/x509.go -+++ go/src/pkg/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 diff --git a/golang-1.2-skipCpuProfileTest.patch b/golang-1.2-skipCpuProfileTest.patch deleted file mode 100644 index 3dee29f..0000000 --- a/golang-1.2-skipCpuProfileTest.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -r 87dea3f5ebe7 src/pkg/runtime/pprof/pprof_test.go ---- a/src/pkg/runtime/pprof/pprof_test.go Fri Nov 29 08:32:31 2013 +1100 -+++ b/src/pkg/runtime/pprof/pprof_test.go Fri Jan 24 13:47:42 2014 -0500 -@@ -32,7 +32,7 @@ - }) - } - --func TestCPUProfileMultithreaded(t *testing.T) { -+func testCPUProfileMultithreaded(t *testing.T) { - buf := make([]byte, 100000) - defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2)) - testCPUProfile(t, []string{"crc32.ChecksumIEEE", "crc32.Update"}, func() { diff --git a/golang-f21-hostname.patch b/golang-f21-hostname.patch index 6025ecb..730e8a8 100644 --- a/golang-f21-hostname.patch +++ b/golang-f21-hostname.patch @@ -1,5 +1,5 @@ ---- src/pkg/os/os_test.go.orig 2014-02-20 13:14:45.543644182 -0600 -+++ src/pkg/os/os_test.go 2014-02-20 13:14:55.934813622 -0600 +--- 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) } diff --git a/golang.spec b/golang.spec index 8d84865..eb03d9e 100644 --- a/golang.spec +++ b/golang.spec @@ -36,16 +36,17 @@ %global gohostarch arm %endif -%global go_api 1.3.3 +%global go_api 1.4 +%global go_version 1.4beta1 Name: golang -Version: 1.3.3 -Release: 3%{?dist} +Version: 1.3.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 # this command moved places %if 0%{?fedora} >= 21 @@ -63,24 +64,11 @@ Provides: go = %{version}-%{release} Requires: golang-bin Requires: golang-src = %{version}-%{release} -BuildRequires: emacs - 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 flaky test for now -# http://code.google.com/p/go/issues/detail?id=6522 -Patch2: ./golang-1.2-skipCpuProfileTest.patch - -# these patches can be dropped for go1.4 -# discovered working here https://github.com/dotcloud/docker/pull/6829 -Patch3: ./go1.3-tar_reuse_buffer_readHeader.patch -Patch4: ./go1.3-tar_reuse_buffer_writeHeader.patch -# https://code.google.com/p/go/source/detail?r=1b17b3426e3c -Patch5: ./go1.3-tar-fix_writing_of_pax_headers.patch - # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -109,27 +97,6 @@ Source102: macros.golang #%{summary}. -%package vim -Summary: Vim plugins for Go -# fedora only -%if 0%{?fedora} -Requires: vim-filesystem -%endif -BuildArch: noarch - -%description vim -%{summary}. - - -%package -n emacs-%{name} -Summary: Emacs add-on package for Go -Requires: emacs(bin) >= %{_emacs_version} -BuildArch: noarch - -%description -n emacs-%{name} -%{summary}. - - ## # the source tree %package src @@ -320,7 +287,7 @@ BuildArch: noarch %description pkg-openbsd-amd64 %{summary} -## missing ./go/src/pkg/runtime/defs_openbsd_arm.h +## 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 @@ -354,24 +321,6 @@ end # remove the P224 curve %patch1 -p1 -# skip flaky test -%patch2 -p1 - -# performance for archive/tar -%patch3 -p1 -%patch4 -p1 -# buffer the PAX header -%patch5 -p1 - -# create a [dirty] gcc wrapper to allow us to build with our own flags -# (dirty because it is spoofing 'gcc' since CC value is stored in the go tool) -# TODO: remove this and just set CFLAGS/LDFLAGS once upstream supports it -# https://code.google.com/p/go/issues/detail?id=6882 -# UPDATE: this is fixed in trunk, and will be in go1.3 -mkdir -p zz -echo -e "#!/bin/sh\n/usr/bin/gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS \"\$@\"" > ./zz/gcc -chmod +x ./zz/gcc - %build # set up final install location export GOROOT_FINAL=%{goroot} @@ -392,8 +341,9 @@ pushd src continue fi fi - # use our gcc wrapper - PATH="$(pwd -P)/../zz:$PATH" CC="gcc" \ + # 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 @@ -401,13 +351,6 @@ pushd src done popd -# compile for emacs -cd misc -mv emacs/go-mode-load.el emacs/%{name}-init.el -%{_emacs_bytecompile} emacs/go-mode.el -cd .. - - %install rm -rf $RPM_BUILD_ROOT @@ -488,28 +431,6 @@ ln -sf /etc/alternatives/go $RPM_BUILD_ROOT%{_bindir}/go rm -f $RPM_BUILD_ROOT%{_bindir}/gofmt ln -sf /etc/alternatives/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt -# misc/bash -mkdir -p $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions -cp -av misc/bash/go $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions -for z in 8l 6l 5l 8g 6g 5g gofmt gccgo - do ln -s go $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions/$z -done - -# misc/emacs -mkdir -p $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name} -mkdir -p $RPM_BUILD_ROOT%{_emacs_sitestartdir} -cp -av misc/emacs/go-mode.* $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name} -cp -av misc/emacs/%{name}-init.el $RPM_BUILD_ROOT%{_emacs_sitestartdir} - -# misc/vim -mkdir -p $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles -cp -av misc/vim/* $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles -rm $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/readme.txt - -# misc/zsh -mkdir -p $RPM_BUILD_ROOT%{_datadir}/zsh/site-functions -cp -av misc/zsh/go $RPM_BUILD_ROOT%{_datadir}/zsh/site-functions - # gdbinit mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang.gdb @@ -596,9 +517,6 @@ fi %endif -#%post pkg-openbsd-arm -#GOROOT=%{goroot} GOOS=openbsd GOARCH=arm go install std - %files %doc AUTHORS CONTRIBUTORS LICENSE PATENTS # VERSION has to be present in the GOROOT, for `go install std` to work @@ -607,6 +525,7 @@ fi # go files %dir %{goroot} %{goroot}/* +%exclude %{goroot}/VERSION %exclude %{goroot}/bin/ %exclude %{goroot}/pkg/ %exclude %{goroot}/src/ @@ -620,10 +539,6 @@ fi %dir %{gopath}/src/code.google.com/p/ -# autocomplete -%{_datadir}/bash-completion -%{_datadir}/zsh - # gdbinit (for gdb debugging) %{_sysconfdir}/gdbinit.d @@ -637,19 +552,8 @@ fi %endif -%files vim -%doc AUTHORS CONTRIBUTORS LICENSE PATENTS -%{_datadir}/vim/vimfiles/* - - -%files -n emacs-%{name} -%doc AUTHORS CONTRIBUTORS LICENSE PATENTS -%{_emacs_sitelispdir}/%{name} -%{_emacs_sitestartdir}/*.el - - %files -f go-src.list src -%{goroot}/src/ + %ifarch %{ix86} %files pkg-bin-linux-386 @@ -679,30 +583,6 @@ fi %{goroot}/pkg/tool/linux_386/objdump %{goroot}/pkg/tool/linux_386/pack %{goroot}/pkg/tool/linux_386/pprof - -# arch dependent generated files, used by cgo -%{goroot}/src/pkg/runtime/zasm_linux_386.h -%{goroot}/src/pkg/runtime/zgoarch_386.go -%{goroot}/src/pkg/runtime/zmalloc_linux_386.c -%{goroot}/src/pkg/runtime/zmprof_linux_386.c -%{goroot}/src/pkg/runtime/znetpoll_linux_386.c -%{goroot}/src/pkg/runtime/zruntime1_linux_386.c -%{goroot}/src/pkg/runtime/zruntime_defs_linux_386.go -%{goroot}/src/pkg/runtime/zsema_linux_386.c -%{goroot}/src/pkg/runtime/zsigqueue_linux_386.c -%{goroot}/src/pkg/runtime/zstring_linux_386.c -%{goroot}/src/pkg/runtime/zsys_linux_386.s -%{goroot}/src/pkg/runtime/ztime_linux_386.c -%{goroot}/src/pkg/runtime/zalg_linux_386.c -%{goroot}/src/pkg/runtime/zchan_linux_386.c -%{goroot}/src/pkg/runtime/zcomplex_linux_386.c -%{goroot}/src/pkg/runtime/zcpuprof_linux_386.c -%{goroot}/src/pkg/runtime/zhashmap_linux_386.c -%{goroot}/src/pkg/runtime/ziface_linux_386.c -%{goroot}/src/pkg/runtime/zlfstack_linux_386.c -%{goroot}/src/pkg/runtime/zrdebug_linux_386.c -%{goroot}/src/pkg/runtime/zslice_linux_386.c -%{goroot}/src/pkg/runtime/zsymtab_linux_386.c %endif %ifarch x86_64 @@ -733,30 +613,6 @@ fi %{goroot}/pkg/tool/linux_amd64/objdump %{goroot}/pkg/tool/linux_amd64/pack %{goroot}/pkg/tool/linux_amd64/pprof - -# arch dependent generated files, used by cgo -%{goroot}/src/pkg/runtime/zasm_linux_amd64.h -%{goroot}/src/pkg/runtime/zgoarch_amd64.go -%{goroot}/src/pkg/runtime/zmalloc_linux_amd64.c -%{goroot}/src/pkg/runtime/zmprof_linux_amd64.c -%{goroot}/src/pkg/runtime/znetpoll_linux_amd64.c -%{goroot}/src/pkg/runtime/zruntime1_linux_amd64.c -%{goroot}/src/pkg/runtime/zruntime_defs_linux_amd64.go -%{goroot}/src/pkg/runtime/zsema_linux_amd64.c -%{goroot}/src/pkg/runtime/zsigqueue_linux_amd64.c -%{goroot}/src/pkg/runtime/zstring_linux_amd64.c -%{goroot}/src/pkg/runtime/zsys_linux_amd64.s -%{goroot}/src/pkg/runtime/ztime_linux_amd64.c -%{goroot}/src/pkg/runtime/zalg_linux_amd64.c -%{goroot}/src/pkg/runtime/zchan_linux_amd64.c -%{goroot}/src/pkg/runtime/zcomplex_linux_amd64.c -%{goroot}/src/pkg/runtime/zcpuprof_linux_amd64.c -%{goroot}/src/pkg/runtime/zhashmap_linux_amd64.c -%{goroot}/src/pkg/runtime/ziface_linux_amd64.c -%{goroot}/src/pkg/runtime/zlfstack_linux_amd64.c -%{goroot}/src/pkg/runtime/zrdebug_linux_amd64.c -%{goroot}/src/pkg/runtime/zslice_linux_amd64.c -%{goroot}/src/pkg/runtime/zsymtab_linux_amd64.c %endif %ifarch %{arm} @@ -787,31 +643,6 @@ fi %{goroot}/pkg/tool/linux_arm/objdump %{goroot}/pkg/tool/linux_arm/pack %{goroot}/pkg/tool/linux_arm/pprof - -# arch dependent generated files, used by cgo -%{goroot}/src/pkg/runtime/zasm_linux_arm.h -%{goroot}/src/pkg/runtime/zgoarch_arm.go -%{goroot}/src/pkg/runtime/zmalloc_linux_arm.c -%{goroot}/src/pkg/runtime/zmprof_linux_arm.c -%{goroot}/src/pkg/runtime/znetpoll_linux_arm.c -%{goroot}/src/pkg/runtime/znoasm_arm_linux_arm.c -%{goroot}/src/pkg/runtime/zruntime1_linux_arm.c -%{goroot}/src/pkg/runtime/zruntime_defs_linux_arm.go -%{goroot}/src/pkg/runtime/zsema_linux_arm.c -%{goroot}/src/pkg/runtime/zsigqueue_linux_arm.c -%{goroot}/src/pkg/runtime/zstring_linux_arm.c -%{goroot}/src/pkg/runtime/zsys_linux_arm.s -%{goroot}/src/pkg/runtime/ztime_linux_arm.c -%{goroot}/src/pkg/runtime/zalg_linux_arm.c -%{goroot}/src/pkg/runtime/zchan_linux_arm.c -%{goroot}/src/pkg/runtime/zcomplex_linux_arm.c -%{goroot}/src/pkg/runtime/zcpuprof_linux_arm.c -%{goroot}/src/pkg/runtime/zhashmap_linux_arm.c -%{goroot}/src/pkg/runtime/ziface_linux_arm.c -%{goroot}/src/pkg/runtime/zlfstack_linux_arm.c -%{goroot}/src/pkg/runtime/zrdebug_linux_arm.c -%{goroot}/src/pkg/runtime/zslice_linux_arm.c -%{goroot}/src/pkg/runtime/zsymtab_linux_arm.c %endif %files pkg-linux-386 -f pkg-linux-386.list @@ -904,6 +735,9 @@ fi %changelog +* Thu Oct 30 2014 Vincent Batts - 1.3.99-1.1.4beta1 +- update to go1.4beta1 + * Thu Oct 30 2014 Vincent Batts - 1.3.3-3 - macros will need to be in their own rpm diff --git a/sources b/sources index 66155c8..6a3976d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar -2cdbad6baefcf1007f3cf54a5bc878b7 go1.3.3.src.tar.gz +0e58d3b4fa02110f65426f9cb297f41c go1.4beta1.src.tar.gz From 55020ead860583f2906a4a2b99f9eff8661f2781 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 17 Nov 2014 10:46:28 -0500 Subject: [PATCH 032/156] update to go1.4rc1 --- .gitignore | 3 ++- golang.spec | 7 +++++-- sources | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index dee89c5..a32bcac 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,10 @@ /go1.3.1.src.tar.gz /go1.3.2.src.tar.gz /go1.3.3.src.tar.gz +/go1.3.src.tar.gz /go1.3beta2.src.tar.gz /go1.3rc1.src.tar.gz /go1.3rc2.src.tar.gz -/go1.3.src.tar.gz /go1.4beta1.src.tar.gz +/go1.4rc1.src.tar.gz /golang-19087:a15f344a9efa-xattrs.tar diff --git a/golang.spec b/golang.spec index eb03d9e..d255d6c 100644 --- a/golang.spec +++ b/golang.spec @@ -37,11 +37,11 @@ %endif %global go_api 1.4 -%global go_version 1.4beta1 +%global go_version 1.4rc1 Name: golang Version: 1.3.99 -Release: 1.%{go_version}%{?dist} +Release: 2.%{go_version}%{?dist} Summary: The Go Programming Language License: BSD @@ -735,6 +735,9 @@ fi %changelog +* Mon Nov 17 2014 Vincent Batts - 1.3.99-2.1.4rc1 +- update to go1.4rc1 + * Thu Oct 30 2014 Vincent Batts - 1.3.99-1.1.4beta1 - update to go1.4beta1 diff --git a/sources b/sources index 6a3976d..a6ad6a5 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar -0e58d3b4fa02110f65426f9cb297f41c go1.4beta1.src.tar.gz +da6734572d53487b19b04357a3e55e79 go1.4rc1.src.tar.gz From 0ad646d98dff8a205852c6d78feac36c59c48e88 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 3 Dec 2014 10:49:10 +0100 Subject: [PATCH 033/156] bumping to 1.4rc2 --- golang.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/golang.spec b/golang.spec index d255d6c..0b2c03c 100644 --- a/golang.spec +++ b/golang.spec @@ -37,11 +37,11 @@ %endif %global go_api 1.4 -%global go_version 1.4rc1 +%global go_version 1.4rc2 Name: golang Version: 1.3.99 -Release: 2.%{go_version}%{?dist} +Release: 3.%{go_version}%{?dist} Summary: The Go Programming Language License: BSD @@ -735,6 +735,9 @@ fi %changelog +* Wed Dec 03 2014 Vincent Batts - 1.3.99-3.1.4rc2 +- update to go1.4rc2 + * Mon Nov 17 2014 Vincent Batts - 1.3.99-2.1.4rc1 - update to go1.4rc1 diff --git a/sources b/sources index a6ad6a5..d874f4e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar -da6734572d53487b19b04357a3e55e79 go1.4rc1.src.tar.gz +1e40cd4c47a7eeaab7d99eeaea20d8fc go1.4rc2.src.tar.gz From 5e609613fc2db09015babadf7efd8e21bddc14e9 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 3 Dec 2014 10:51:11 +0100 Subject: [PATCH 034/156] gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a32bcac..fd6ffe6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /go1.4beta1.src.tar.gz /go1.4rc1.src.tar.gz /golang-19087:a15f344a9efa-xattrs.tar +/go1.4rc2.src.tar.gz From 82982da13261bba431371e2a2be43e28b1116e82 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 11 Dec 2014 10:27:04 -0500 Subject: [PATCH 035/156] update to go1.4 --- .gitignore | 1 + golang.spec | 10 ++++++---- sources | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index fd6ffe6..414d1ff 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /go1.4rc1.src.tar.gz /golang-19087:a15f344a9efa-xattrs.tar /go1.4rc2.src.tar.gz +/go1.4.src.tar.gz diff --git a/golang.spec b/golang.spec index 0b2c03c..95fdb6d 100644 --- a/golang.spec +++ b/golang.spec @@ -37,16 +37,15 @@ %endif %global go_api 1.4 -%global go_version 1.4rc2 Name: golang -Version: 1.3.99 -Release: 3.%{go_version}%{?dist} +Version: 1.4 +Release: 1%{?dist} Summary: The Go Programming Language License: BSD URL: http://golang.org/ -Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz +Source0: https://storage.googleapis.com/golang/go%{version}.src.tar.gz # this command moved places %if 0%{?fedora} >= 21 @@ -735,6 +734,9 @@ fi %changelog +* Thu Dec 11 2014 Vincent Batts - 1.4-1 +- update to go1.4 release + * Wed Dec 03 2014 Vincent Batts - 1.3.99-3.1.4rc2 - update to go1.4rc2 diff --git a/sources b/sources index d874f4e..2579fe1 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar 1e40cd4c47a7eeaab7d99eeaea20d8fc go1.4rc2.src.tar.gz +c0d732ef7181f98db4b93fbce4eef5a2 go1.4.src.tar.gz From 2ba9c52536cd3a1d253bce01f0d1feee2c9db9ce Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 2 Jan 2015 12:20:59 -0500 Subject: [PATCH 036/156] classifying project doc as %doc --- golang.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 95fdb6d..42e982d 100644 --- a/golang.spec +++ b/golang.spec @@ -40,7 +40,7 @@ Name: golang Version: 1.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language License: BSD @@ -520,6 +520,7 @@ fi %doc AUTHORS CONTRIBUTORS LICENSE PATENTS # VERSION has to be present in the GOROOT, for `go install std` to work %doc %{goroot}/VERSION +%doc %{goroot}/doc/* # go files %dir %{goroot} @@ -734,6 +735,9 @@ fi %changelog +* Fri Jan 02 2015 Vincent Batts - 1.4-2 +- doc organizing + * Thu Dec 11 2014 Vincent Batts - 1.4-1 - update to go1.4 release From 4c424d466469dc2a9d978a7dfc15e92aafbb3cc6 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 16 Jan 2015 12:57:47 -0500 Subject: [PATCH 037/156] update to go1.4.1 --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 414d1ff..499f074 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /golang-19087:a15f344a9efa-xattrs.tar /go1.4rc2.src.tar.gz /go1.4.src.tar.gz +/go1.4.1.src.tar.gz diff --git a/golang.spec b/golang.spec index 42e982d..cdd7e65 100644 --- a/golang.spec +++ b/golang.spec @@ -39,8 +39,8 @@ %global go_api 1.4 Name: golang -Version: 1.4 -Release: 2%{?dist} +Version: 1.4.1 +Release: 1%{?dist} Summary: The Go Programming Language License: BSD @@ -735,6 +735,9 @@ fi %changelog +* Fri Jan 16 2015 Vincent Batts - 1.4.1-1 +- updating to go1.4.1 + * Fri Jan 02 2015 Vincent Batts - 1.4-2 - doc organizing diff --git a/sources b/sources index 2579fe1..76aa0e6 100644 --- a/sources +++ b/sources @@ -1,3 +1,2 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar -1e40cd4c47a7eeaab7d99eeaea20d8fc go1.4rc2.src.tar.gz -c0d732ef7181f98db4b93fbce4eef5a2 go1.4.src.tar.gz +b15b6b2a761f7233153e801584de25cb go1.4.1.src.tar.gz From b5c025475a7ea3333d3569769460e7acab7902e4 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 18 Feb 2015 10:26:22 -0500 Subject: [PATCH 038/156] update to go1.4.2 Signed-off-by: Vincent Batts --- .gitignore | 7 ++++--- golang.spec | 5 ++++- sources | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 499f074..415af81 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,10 @@ /go1.3beta2.src.tar.gz /go1.3rc1.src.tar.gz /go1.3rc2.src.tar.gz +/go1.4.1.src.tar.gz +/go1.4.2.src.tar.gz +/go1.4.src.tar.gz /go1.4beta1.src.tar.gz /go1.4rc1.src.tar.gz -/golang-19087:a15f344a9efa-xattrs.tar /go1.4rc2.src.tar.gz -/go1.4.src.tar.gz -/go1.4.1.src.tar.gz +/golang-19087:a15f344a9efa-xattrs.tar diff --git a/golang.spec b/golang.spec index cdd7e65..c47a6c7 100644 --- a/golang.spec +++ b/golang.spec @@ -39,7 +39,7 @@ %global go_api 1.4 Name: golang -Version: 1.4.1 +Version: 1.4.2 Release: 1%{?dist} Summary: The Go Programming Language @@ -735,6 +735,9 @@ fi %changelog +* Wed Feb 18 2015 Vincent Batts - 1.4.2-1 +- updating to go1.4.2 + * Fri Jan 16 2015 Vincent Batts - 1.4.1-1 - updating to go1.4.1 diff --git a/sources b/sources index 76aa0e6..c9c38e8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar -b15b6b2a761f7233153e801584de25cb go1.4.1.src.tar.gz +907f85c8fa765d31f7f955836fec4049 go1.4.2.src.tar.gz From a8686d833c0fb28108b7b73fe4e2f74af37f9f33 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 19 Mar 2015 10:12:49 -0400 Subject: [PATCH 039/156] obsolete packages for upgrade path Signed-off-by: Vincent Batts --- golang.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index c47a6c7..33cff31 100644 --- a/golang.spec +++ b/golang.spec @@ -40,7 +40,7 @@ Name: golang Version: 1.4.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language License: BSD @@ -74,6 +74,10 @@ Obsoletes: %{name}-docs < 1.1-4 # RPM can't handle symlink -> dir with subpackages, so merge back Obsoletes: %{name}-data < 1.1.1-4 +# go1.4 deprecates a few packages +Obsoletes: %{name}-vim < 1.4 +Obsoletes: emacs-%{name} < 1.4 + # These are the only RHEL/Fedora architectures that we compile this package for ExclusiveArch: %{go_arches} @@ -735,6 +739,9 @@ fi %changelog +* Wed Mar 18 2015 Vincent Batts - 1.4.2-2 +- obsoleting deprecated packages + * Wed Feb 18 2015 Vincent Batts - 1.4.2-1 - updating to go1.4.2 From 7dc03d11016e238efc432c9205dacddd1e929886 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 17 Jun 2015 09:16:23 +0000 Subject: [PATCH 040/156] - 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 041/156] 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 042/156] 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 043/156] 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 044/156] 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 045/156] 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 046/156] 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 047/156] 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 048/156] 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 049/156] 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 050/156] 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 aa501a2cd88372568446113fce8f47030e14d523 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 5 Aug 2015 16:45:13 -0400 Subject: [PATCH 051/156] upstream patches for net/http Fixes: bz1250353 bz1250352 bz1250374 --- ...dcb83d7f42d6aa72241240af99ded81118e9.patch | 135 +++++++++++ ...22585e32449860e624cace9d2e521deee62e.patch | 112 +++++++++ ...9a21583e7cf0149a778a0611e76ff7c6680f.patch | 225 ++++++++++++++++++ golang.spec | 16 +- 4 files changed, 487 insertions(+), 1 deletion(-) create mode 100644 117ddcb83d7f42d6aa72241240af99ded81118e9.patch create mode 100644 143822585e32449860e624cace9d2e521deee62e.patch create mode 100644 300d9a21583e7cf0149a778a0611e76ff7c6680f.patch diff --git a/117ddcb83d7f42d6aa72241240af99ded81118e9.patch b/117ddcb83d7f42d6aa72241240af99ded81118e9.patch new file mode 100644 index 0000000..bc8eb0b --- /dev/null +++ b/117ddcb83d7f42d6aa72241240af99ded81118e9.patch @@ -0,0 +1,135 @@ +commit 117ddcb83d7f42d6aa72241240af99ded81118e9 +Author: Brad Fitzpatrick +Date: Tue Jun 30 09:22:41 2015 -0700 + + net/textproto: don't treat spaces as hyphens in header keys + + This was originally done in https://codereview.appspot.com/5690059 + (Feb 2012) to deal with bad response headers coming back from webcams, + but it presents a potential security problem with HTTP request + smuggling for request headers containing "Content Length" instead of + "Content-Length". + + Part of overall HTTP hardening for request smuggling. See RFC 7230. + + Thanks to Régis Leroy for the report. + + Change-Id: I92b17fb637c9171c5774ea1437979ae2c17ca88a + Reviewed-on: https://go-review.googlesource.com/11772 + Reviewed-by: Russ Cox + Run-TryBot: Brad Fitzpatrick + TryBot-Result: Gobot Gobot + +diff --git a/src/net/http/header.go b/src/net/http/header.go +index 153b943..d847b13 100644 +--- a/src/net/http/header.go ++++ b/src/net/http/header.go +@@ -168,6 +168,8 @@ func (h Header) WriteSubset(w io.Writer, exclude map[string]bool) error { + // letter and any letter following a hyphen to upper case; + // the rest are converted to lowercase. For example, the + // canonical key for "accept-encoding" is "Accept-Encoding". ++// If s contains a space or invalid header field bytes, it is ++// returned without modifications. + func CanonicalHeaderKey(s string) string { return textproto.CanonicalMIMEHeaderKey(s) } + + // hasToken reports whether token appears with v, ASCII +diff --git a/src/net/textproto/reader.go b/src/net/textproto/reader.go +index e4b8f6b..91303fe 100644 +--- a/src/net/textproto/reader.go ++++ b/src/net/textproto/reader.go +@@ -547,11 +547,16 @@ func (r *Reader) upcomingHeaderNewlines() (n int) { + // the rest are converted to lowercase. For example, the + // canonical key for "accept-encoding" is "Accept-Encoding". + // MIME header keys are assumed to be ASCII only. ++// If s contains a space or invalid header field bytes, it is ++// returned without modifications. + func CanonicalMIMEHeaderKey(s string) string { + // Quick check for canonical encoding. + upper := true + for i := 0; i < len(s); i++ { + c := s[i] ++ if !validHeaderFieldByte(c) { ++ return s ++ } + if upper && 'a' <= c && c <= 'z' { + return canonicalMIMEHeaderKey([]byte(s)) + } +@@ -565,19 +570,44 @@ func CanonicalMIMEHeaderKey(s string) string { + + const toLower = 'a' - 'A' + ++// validHeaderFieldByte reports whether b is a valid byte in a header ++// field key. This is actually stricter than RFC 7230, which says: ++// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / ++// "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA ++// token = 1*tchar ++// TODO: revisit in Go 1.6+ and possibly expand this. But note that many ++// servers have historically dropped '_' to prevent ambiguities when mapping ++// to CGI environment variables. ++func validHeaderFieldByte(b byte) bool { ++ return ('A' <= b && b <= 'Z') || ++ ('a' <= b && b <= 'z') || ++ ('0' <= b && b <= '9') || ++ b == '-' ++} ++ + // canonicalMIMEHeaderKey is like CanonicalMIMEHeaderKey but is + // allowed to mutate the provided byte slice before returning the + // string. ++// ++// For invalid inputs (if a contains spaces or non-token bytes), a ++// is unchanged and a string copy is returned. + func canonicalMIMEHeaderKey(a []byte) string { ++ // See if a looks like a header key. If not, return it unchanged. ++ for _, c := range a { ++ if validHeaderFieldByte(c) { ++ continue ++ } ++ // Don't canonicalize. ++ return string(a) ++ } ++ + upper := true + for i, c := range a { + // Canonicalize: first letter upper case + // and upper case after each dash. + // (Host, User-Agent, If-Modified-Since). + // MIME headers are ASCII only, so no Unicode issues. +- if c == ' ' { +- c = '-' +- } else if upper && 'a' <= c && c <= 'z' { ++ if upper && 'a' <= c && c <= 'z' { + c -= toLower + } else if !upper && 'A' <= c && c <= 'Z' { + c += toLower +diff --git a/src/net/textproto/reader_test.go b/src/net/textproto/reader_test.go +index 6bbd993..8fce7dd 100644 +--- a/src/net/textproto/reader_test.go ++++ b/src/net/textproto/reader_test.go +@@ -24,11 +24,14 @@ var canonicalHeaderKeyTests = []canonicalHeaderKeyTest{ + {"uSER-aGENT", "User-Agent"}, + {"user-agent", "User-Agent"}, + {"USER-AGENT", "User-Agent"}, +- {"üser-agenT", "üser-Agent"}, // non-ASCII unchanged ++ ++ // Non-ASCII or anything with spaces or non-token chars is unchanged: ++ {"üser-agenT", "üser-agenT"}, ++ {"a B", "a B"}, + + // This caused a panic due to mishandling of a space: +- {"C Ontent-Transfer-Encoding", "C-Ontent-Transfer-Encoding"}, +- {"foo bar", "Foo-Bar"}, ++ {"C Ontent-Transfer-Encoding", "C Ontent-Transfer-Encoding"}, ++ {"foo bar", "foo bar"}, + } + + func TestCanonicalMIMEHeaderKey(t *testing.T) { +@@ -194,7 +197,7 @@ func TestReadMIMEHeaderNonCompliant(t *testing.T) { + "Foo": {"bar"}, + "Content-Language": {"en"}, + "Sid": {"0"}, +- "Audio-Mode": {"None"}, ++ "Audio Mode": {"None"}, + "Privilege": {"127"}, + } + if !reflect.DeepEqual(m, want) || err != nil { diff --git a/143822585e32449860e624cace9d2e521deee62e.patch b/143822585e32449860e624cace9d2e521deee62e.patch new file mode 100644 index 0000000..b11edc6 --- /dev/null +++ b/143822585e32449860e624cace9d2e521deee62e.patch @@ -0,0 +1,112 @@ +commit 143822585e32449860e624cace9d2e521deee62e +Author: Brad Fitzpatrick +Date: Tue Jul 7 13:19:44 2015 -0600 + + net/http: revert overly-strict part of earlier smuggling defense + + The recent https://golang.org/cl/11810 is reportedly a bit too + aggressive. + + Apparently some HTTP requests in the wild do contain both a + Transfer-Encoding along with a bogus Content-Length. Instead of + returning a 400 Bad Request error, we should just ignore the + Content-Length like we did before. + + Change-Id: I0001be90d09f8293a34f04691f608342875ff5c4 + Reviewed-on: https://go-review.googlesource.com/11962 + Reviewed-by: Andrew Gerrand + Run-TryBot: Brad Fitzpatrick + TryBot-Result: Gobot Gobot + +diff --git a/src/net/http/readrequest_test.go b/src/net/http/readrequest_test.go +index 1a3cf91..60e2be4 100644 +--- a/src/net/http/readrequest_test.go ++++ b/src/net/http/readrequest_test.go +@@ -178,6 +178,36 @@ var reqTests = []reqTest{ + noError, + }, + ++ // Tests chunked body and a bogus Content-Length which should be deleted. ++ { ++ "POST / HTTP/1.1\r\n" + ++ "Host: foo.com\r\n" + ++ "Transfer-Encoding: chunked\r\n" + ++ "Content-Length: 9999\r\n\r\n" + // to be removed. ++ "3\r\nfoo\r\n" + ++ "3\r\nbar\r\n" + ++ "0\r\n" + ++ "\r\n", ++ &Request{ ++ Method: "POST", ++ URL: &url.URL{ ++ Path: "/", ++ }, ++ TransferEncoding: []string{"chunked"}, ++ Proto: "HTTP/1.1", ++ ProtoMajor: 1, ++ ProtoMinor: 1, ++ Header: Header{}, ++ ContentLength: -1, ++ Host: "foo.com", ++ RequestURI: "/", ++ }, ++ ++ "foobar", ++ noTrailer, ++ noError, ++ }, ++ + // CONNECT request with domain name: + { + "CONNECT www.google.com:443 HTTP/1.1\r\n\r\n", +@@ -400,11 +430,6 @@ Content-Length: 3 + Content-Length: 4 + + abc`)}, +- {"smuggle_chunked_and_len", reqBytes(`POST / HTTP/1.1 +-Transfer-Encoding: chunked +-Content-Length: 3 +- +-abc`)}, + {"smuggle_content_len_head", reqBytes(`HEAD / HTTP/1.1 + Host: foo + Content-Length: 5`)}, +diff --git a/src/net/http/transfer.go b/src/net/http/transfer.go +index 3c868bd..fbbbf24 100644 +--- a/src/net/http/transfer.go ++++ b/src/net/http/transfer.go +@@ -430,7 +430,6 @@ func fixTransferEncoding(isResponse bool, requestMethod string, header Header) ( + if !present { + return nil, nil + } +- isRequest := !isResponse + delete(header, "Transfer-Encoding") + + encodings := strings.Split(raw[0], ",") +@@ -458,12 +457,20 @@ func fixTransferEncoding(isResponse bool, requestMethod string, header Header) ( + // RFC 7230 3.3.2 says "A sender MUST NOT send a + // Content-Length header field in any message that + // contains a Transfer-Encoding header field." +- if len(header["Content-Length"]) > 0 { +- if isRequest { +- return nil, errors.New("http: invalid Content-Length with Transfer-Encoding") +- } +- delete(header, "Content-Length") +- } ++ // ++ // but also: ++ // "If a message is received with both a ++ // Transfer-Encoding and a Content-Length header ++ // field, the Transfer-Encoding overrides the ++ // Content-Length. Such a message might indicate an ++ // attempt to perform request smuggling (Section 9.5) ++ // or response splitting (Section 9.4) and ought to be ++ // handled as an error. A sender MUST remove the ++ // received Content-Length field prior to forwarding ++ // such a message downstream." ++ // ++ // Reportedly, these appear in the wild. ++ delete(header, "Content-Length") + return te, nil + } + diff --git a/300d9a21583e7cf0149a778a0611e76ff7c6680f.patch b/300d9a21583e7cf0149a778a0611e76ff7c6680f.patch new file mode 100644 index 0000000..1027032 --- /dev/null +++ b/300d9a21583e7cf0149a778a0611e76ff7c6680f.patch @@ -0,0 +1,225 @@ +commit 300d9a21583e7cf0149a778a0611e76ff7c6680f +Author: Brad Fitzpatrick +Date: Tue Jun 30 14:21:15 2015 -0700 + + net/http: harden Server against request smuggling + + See RFC 7230. + + Thanks to Régis Leroy for the report. + + Change-Id: Ic1779bc2180900430d4d7a4938cac04ed73c304c + Reviewed-on: https://go-review.googlesource.com/11810 + Reviewed-by: Russ Cox + Run-TryBot: Brad Fitzpatrick + +diff --git a/src/net/http/readrequest_test.go b/src/net/http/readrequest_test.go +index e930d99..1a3cf91 100644 +--- a/src/net/http/readrequest_test.go ++++ b/src/net/http/readrequest_test.go +@@ -9,6 +9,7 @@ import ( + "bytes" + "fmt" + "io" ++ "io/ioutil" + "net/url" + "reflect" + "strings" +@@ -323,6 +324,32 @@ var reqTests = []reqTest{ + noTrailer, + noError, + }, ++ ++ // HEAD with Content-Length 0. Make sure this is permitted, ++ // since I think we used to send it. ++ { ++ "HEAD / HTTP/1.1\r\nHost: issue8261.com\r\nConnection: close\r\nContent-Length: 0\r\n\r\n", ++ &Request{ ++ Method: "HEAD", ++ URL: &url.URL{ ++ Path: "/", ++ }, ++ Header: Header{ ++ "Connection": []string{"close"}, ++ "Content-Length": []string{"0"}, ++ }, ++ Host: "issue8261.com", ++ Proto: "HTTP/1.1", ++ ProtoMajor: 1, ++ ProtoMinor: 1, ++ Close: true, ++ RequestURI: "/", ++ }, ++ ++ noBody, ++ noTrailer, ++ noError, ++ }, + } + + func TestReadRequest(t *testing.T) { +@@ -356,3 +383,39 @@ func TestReadRequest(t *testing.T) { + } + } + } ++ ++// reqBytes treats req as a request (with \n delimiters) and returns it with \r\n delimiters, ++// ending in \r\n\r\n ++func reqBytes(req string) []byte { ++ return []byte(strings.Replace(strings.TrimSpace(req), "\n", "\r\n", -1) + "\r\n\r\n") ++} ++ ++var badRequestTests = []struct { ++ name string ++ req []byte ++}{ ++ {"bad_connect_host", reqBytes("CONNECT []%20%48%54%54%50%2f%31%2e%31%0a%4d%79%48%65%61%64%65%72%3a%20%31%32%33%0a%0a HTTP/1.0")}, ++ {"smuggle_two_contentlen", reqBytes(`POST / HTTP/1.1 ++Content-Length: 3 ++Content-Length: 4 ++ ++abc`)}, ++ {"smuggle_chunked_and_len", reqBytes(`POST / HTTP/1.1 ++Transfer-Encoding: chunked ++Content-Length: 3 ++ ++abc`)}, ++ {"smuggle_content_len_head", reqBytes(`HEAD / HTTP/1.1 ++Host: foo ++Content-Length: 5`)}, ++} ++ ++func TestReadRequest_Bad(t *testing.T) { ++ for _, tt := range badRequestTests { ++ got, err := ReadRequest(bufio.NewReader(bytes.NewReader(tt.req))) ++ if err == nil { ++ all, err := ioutil.ReadAll(got.Body) ++ t.Errorf("%s: got unexpected request = %#v\n Body = %q, %v", tt.name, got, all, err) ++ } ++ } ++} +diff --git a/src/net/http/transfer.go b/src/net/http/transfer.go +index 5205003..3887604 100644 +--- a/src/net/http/transfer.go ++++ b/src/net/http/transfer.go +@@ -143,6 +143,9 @@ func (t *transferWriter) shouldSendContentLength() bool { + return true + } + if t.ContentLength == 0 && isIdentity(t.TransferEncoding) { ++ if t.Method == "GET" || t.Method == "HEAD" { ++ return false ++ } + return true + } + +@@ -310,6 +313,7 @@ func readTransfer(msg interface{}, r *bufio.Reader) (err error) { + } + case *Request: + t.Header = rr.Header ++ t.RequestMethod = rr.Method + t.ProtoMajor = rr.ProtoMajor + t.ProtoMinor = rr.ProtoMinor + // Transfer semantics for Requests are exactly like those for +@@ -325,7 +329,7 @@ func readTransfer(msg interface{}, r *bufio.Reader) (err error) { + } + + // Transfer encoding, content length +- t.TransferEncoding, err = fixTransferEncoding(t.RequestMethod, t.Header) ++ t.TransferEncoding, err = fixTransferEncoding(isResponse, t.RequestMethod, t.Header) + if err != nil { + return err + } +@@ -413,12 +417,12 @@ func chunked(te []string) bool { return len(te) > 0 && te[0] == "chunked" } + func isIdentity(te []string) bool { return len(te) == 1 && te[0] == "identity" } + + // Sanitize transfer encoding +-func fixTransferEncoding(requestMethod string, header Header) ([]string, error) { ++func fixTransferEncoding(isResponse bool, requestMethod string, header Header) ([]string, error) { + raw, present := header["Transfer-Encoding"] + if !present { + return nil, nil + } +- ++ isRequest := !isResponse + delete(header, "Transfer-Encoding") + + encodings := strings.Split(raw[0], ",") +@@ -443,10 +447,15 @@ func fixTransferEncoding(requestMethod string, header Header) ([]string, error) + return nil, &badStringError{"too many transfer encodings", strings.Join(te, ",")} + } + if len(te) > 0 { +- // Chunked encoding trumps Content-Length. See RFC 2616 +- // Section 4.4. Currently len(te) > 0 implies chunked +- // encoding. +- delete(header, "Content-Length") ++ // RFC 7230 3.3.2 says "A sender MUST NOT send a ++ // Content-Length header field in any message that ++ // contains a Transfer-Encoding header field." ++ if len(header["Content-Length"]) > 0 { ++ if isRequest { ++ return nil, errors.New("http: invalid Content-Length with Transfer-Encoding") ++ } ++ delete(header, "Content-Length") ++ } + return te, nil + } + +@@ -457,9 +466,17 @@ func fixTransferEncoding(requestMethod string, header Header) ([]string, error) + // function is not a method, because ultimately it should be shared by + // ReadResponse and ReadRequest. + func fixLength(isResponse bool, status int, requestMethod string, header Header, te []string) (int64, error) { +- ++ contentLens := header["Content-Length"] ++ isRequest := !isResponse + // Logic based on response type or status + if noBodyExpected(requestMethod) { ++ // For HTTP requests, as part of hardening against request ++ // smuggling (RFC 7230), don't allow a Content-Length header for ++ // methods which don't permit bodies. As an exception, allow ++ // exactly one Content-Length header if its value is "0". ++ if isRequest && len(contentLens) > 0 && !(len(contentLens) == 1 && contentLens[0] == "0") { ++ return 0, fmt.Errorf("http: method cannot contain a Content-Length; got %q", contentLens) ++ } + return 0, nil + } + if status/100 == 1 { +@@ -470,13 +487,21 @@ func fixLength(isResponse bool, status int, requestMethod string, header Header, + return 0, nil + } + ++ if len(contentLens) > 1 { ++ // harden against HTTP request smuggling. See RFC 7230. ++ return 0, errors.New("http: message cannot contain multiple Content-Length headers") ++ } ++ + // Logic based on Transfer-Encoding + if chunked(te) { + return -1, nil + } + + // Logic based on Content-Length +- cl := strings.TrimSpace(header.get("Content-Length")) ++ var cl string ++ if len(contentLens) == 1 { ++ cl = strings.TrimSpace(contentLens[0]) ++ } + if cl != "" { + n, err := parseContentLength(cl) + if err != nil { +@@ -487,11 +512,14 @@ func fixLength(isResponse bool, status int, requestMethod string, header Header, + header.Del("Content-Length") + } + +- if !isResponse && requestMethod == "GET" { +- // RFC 2616 doesn't explicitly permit nor forbid an ++ if !isResponse { ++ // RFC 2616 neither explicitly permits nor forbids an + // entity-body on a GET request so we permit one if + // declared, but we default to 0 here (not -1 below) + // if there's no mention of a body. ++ // Likewise, all other request methods are assumed to have ++ // no body if neither Transfer-Encoding chunked nor a ++ // Content-Length are set. + return 0, nil + } + diff --git a/golang.spec b/golang.spec index 33cff31..dd8281d 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 @@ -68,6 +68,12 @@ Patch0: golang-1.2-verbose-build.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Patch1: golang-1.2-remove-ECC-p224.patch +# TODO this should be removed with go1.4.3 +# https://bugzilla.redhat.com/show_bug.cgi?id=1250352 +Patch100: 300d9a21583e7cf0149a778a0611e76ff7c6680f.patch +Patch101: 117ddcb83d7f42d6aa72241240af99ded81118e9.patch +Patch102: 143822585e32449860e624cace9d2e521deee62e.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -324,6 +330,11 @@ end # remove the P224 curve %patch1 -p1 +# bz1250352 +%patch100 -p1 +%patch101 -p1 +%patch102 -p1 + %build # set up final install location export GOROOT_FINAL=%{goroot} @@ -739,6 +750,9 @@ fi %changelog +* Wed Aug 05 2015 Vincent Batts - 1.4.2-3 +- bz1250352 + * Wed Mar 18 2015 Vincent Batts - 1.4.2-2 - obsoleting deprecated packages From 831ba34f7437b279e27e486bf80ec3c5b2b95244 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 6 Aug 2015 15:48:15 -0400 Subject: [PATCH 052/156] 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 053/156] 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 054/156] 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 055/156] 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 056/156] 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 057/156] 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 058/156] 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 059/156] 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 060/156] 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 061/156] 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 062/156] *: 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 063/156] 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 064/156] 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 065/156] 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 From 821a201d206bb640a224ca80576d905f02d9b3a7 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 1 Sep 2015 12:16:22 -0400 Subject: [PATCH 066/156] remove f23-only history --- golang.spec | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/golang.spec b/golang.spec index 97d30cb..351d834 100644 --- a/golang.spec +++ b/golang.spec @@ -447,43 +447,6 @@ fi * 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 - -* 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 - -* 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 .. - -* 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 - -* 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 - -* 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 - -* Wed Jun 17 2015 Fedora Release Engineering - 1.4.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - * Wed Aug 05 2015 Vincent Batts - 1.4.2-3 - bz1250352 From 34fd651dfbad2bbb8378a5e20f44a003a4272ad1 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 3 Sep 2015 10:36:52 -0400 Subject: [PATCH 067/156] bz1258166 remove srpm macros, for go-srpm-macros --- golang.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/golang.spec b/golang.spec index 50001fd..0cdb8e6 100644 --- a/golang.spec +++ b/golang.spec @@ -24,8 +24,6 @@ # let this match the macros in macros.golang %global goroot /usr/lib/%{name} -%global gopath %{_datadir}/gocode -%global go_arches %{ix86} x86_64 %{arm} aarch64 %ifarch x86_64 %global gohostarch amd64 %endif @@ -94,7 +92,7 @@ Obsoletes: %{name}-vim < 1.4 Obsoletes: emacs-%{name} < 1.4 # These are the only RHEL/Fedora architectures that we compile this package for -ExclusiveArch: %{go_arches} +ExclusiveArch: %{golang_arches} Source100: golang-gdbinit Source101: golang-prelink.conf From 286f73c812ee39ea82fdaba1a7be6d8e7d4ee183 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 3 Sep 2015 10:38:28 -0400 Subject: [PATCH 068/156] changelog --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 0cdb8e6..733966c 100644 --- a/golang.spec +++ b/golang.spec @@ -42,7 +42,7 @@ Name: golang Version: 1.5 -Release: 6%{?dist} +Release: 7%{?dist} Summary: The Go Programming Language License: BSD @@ -422,6 +422,9 @@ fi %endif %changelog +* Thu Sep 03 2015 Vincent Batts - 1.5-7 +- bz1258166 remove srpm macros, for go-srpm-macros + * 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. From a68f1b0499ebb4de6c679d743e7b79cda3ed0184 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 4 Sep 2015 10:07:14 -0400 Subject: [PATCH 069/156] bz1258166: actually remove the macros file .. --- golang.spec | 24 +++++------------------- macros.golang | 8 -------- 2 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 macros.golang diff --git a/golang.spec b/golang.spec index 733966c..80cdd3b 100644 --- a/golang.spec +++ b/golang.spec @@ -42,7 +42,7 @@ Name: golang Version: 1.5 -Release: 7%{?dist} +Release: 8%{?dist} Summary: The Go Programming Language License: BSD @@ -63,6 +63,7 @@ Patch212: golang-1.5-bootstrap-binary-path.patch Provides: go = %{version}-%{release} Requires: %{name}-bin Requires: %{name}-src = %{version}-%{release} +Requires: go-srpm-macros Patch0: golang-1.2-verbose-build.patch @@ -96,7 +97,6 @@ ExclusiveArch: %{golang_arches} Source100: golang-gdbinit Source101: golang-prelink.conf -Source102: macros.golang %description %{summary}. @@ -320,16 +320,6 @@ cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang.gdb mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf -# rpm macros -mkdir -p %{buildroot} -%if 0%{?rhel} > 6 || 0%{?fedora} > 0 -mkdir -p $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d -cp -av %{SOURCE102} $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d/macros.golang -%else -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm -cp -av %{SOURCE102} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.golang -%endif - %check export GOROOT=$(pwd -P) @@ -398,13 +388,6 @@ fi # prelink blacklist %{_sysconfdir}/prelink.conf.d -%if 0%{?rhel} > 6 || 0%{?fedora} > 0 -%{_rpmconfigdir}/macros.d/macros.golang -%else -%{_sysconfdir}/rpm/macros.golang -%endif - - %files -f go-src.list src %files -f go-docs.list docs @@ -422,6 +405,9 @@ fi %endif %changelog +* Fri Sep 04 2015 Vincent Batts - 1.5-8 +- bz1258166 remove srpm macros, for go-srpm-macros + * Thu Sep 03 2015 Vincent Batts - 1.5-7 - bz1258166 remove srpm macros, for go-srpm-macros diff --git a/macros.golang b/macros.golang deleted file mode 100644 index bc6b803..0000000 --- a/macros.golang +++ /dev/null @@ -1,8 +0,0 @@ -# Where to set GOPATH for builds. Like: -# export GOPATH=$(pwd)/_build:%{gopath} -%gopath %{_datadir}/gocode - -# for use like: -# ExclusiveArch: %{go_arches} -%go_arches %{ix86} x86_64 %{arm} - From c127d6af984d39739ec1cf9921504ae4c0adef70 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 9 Sep 2015 10:33:51 -0400 Subject: [PATCH 070/156] update to go1.5.1 --- .gitignore | 1 + golang.spec | 9 ++++++--- sources | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 7995a4a..5c0b29a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ /go1.5beta3.src.tar.gz /go1.5rc1.src.tar.gz /go1.5.src.tar.gz +/go1.5.1.src.tar.gz diff --git a/golang.spec b/golang.spec index 80cdd3b..af418c6 100644 --- a/golang.spec +++ b/golang.spec @@ -38,11 +38,11 @@ %endif %global go_api 1.5 -%global go_version 1.5 +%global go_version 1.5.1 Name: golang -Version: 1.5 -Release: 8%{?dist} +Version: 1.5.1 +Release: 0%{?dist} Summary: The Go Programming Language License: BSD @@ -405,6 +405,9 @@ fi %endif %changelog +* Wed Sep 09 2015 Vincent Batts - 1.5.1-0 +- update to go1.5.1 + * Fri Sep 04 2015 Vincent Batts - 1.5-8 - bz1258166 remove srpm macros, for go-srpm-macros diff --git a/sources b/sources index 259d362..23e64bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3f072baece07fa42d18376419afad323 go1.5.src.tar.gz +4adfbdfca523cc1c229be8a321f3602f go1.5.1.src.tar.gz From 682f928b4cca144d72f6b53695ca6fa47aeb049b Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 9 Sep 2015 10:33:51 -0400 Subject: [PATCH 071/156] update to go1.5.1 --- .gitignore | 1 + golang.spec | 9 ++++++--- sources | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 7995a4a..5c0b29a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ /go1.5beta3.src.tar.gz /go1.5rc1.src.tar.gz /go1.5.src.tar.gz +/go1.5.1.src.tar.gz diff --git a/golang.spec b/golang.spec index 70ab8f4..5c996d7 100644 --- a/golang.spec +++ b/golang.spec @@ -43,11 +43,11 @@ %endif %global go_api 1.5 -%global go_version 1.5 +%global go_version 1.5.1 Name: golang -Version: 1.5 -Release: 6%{?dist} +Version: 1.5.1 +Release: 0%{?dist} Summary: The Go Programming Language License: BSD @@ -427,6 +427,9 @@ fi %endif %changelog +* Wed Sep 09 2015 Vincent Batts - 1.5.1-0 +- update to go1.5.1 + * 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. diff --git a/sources b/sources index 259d362..23e64bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3f072baece07fa42d18376419afad323 go1.5.src.tar.gz +4adfbdfca523cc1c229be8a321f3602f go1.5.1.src.tar.gz From ee2b2994868a33e03a50b3817fd9a6c4fb66252d Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 19 Oct 2015 20:32:59 -0400 Subject: [PATCH 072/156] bz1271709 fix from upstream --- golang-1.5.1-a3156aaa12.patch | 309 ++++++++++++++++++++++++++++++++++ golang.spec | 10 +- 2 files changed, 318 insertions(+), 1 deletion(-) create mode 100644 golang-1.5.1-a3156aaa12.patch diff --git a/golang-1.5.1-a3156aaa12.patch b/golang-1.5.1-a3156aaa12.patch new file mode 100644 index 0000000..afff18d --- /dev/null +++ b/golang-1.5.1-a3156aaa12.patch @@ -0,0 +1,309 @@ +commit a3156aaa121446c4136927f8c2139fefe05ba82c +Author: Brad Fitzpatrick +Date: Tue Sep 29 14:26:48 2015 -0700 + + net/http/httptest: change Server to use http.Server.ConnState for accounting + + With this CL, httptest.Server now uses connection-level accounting of + outstanding requests instead of ServeHTTP-level accounting. This is + more robust and results in a non-racy shutdown. + + This is much easier now that net/http.Server has the ConnState hook. + + Fixes #12789 + Fixes #12781 + + Change-Id: I098cf334a6494316acb66cd07df90766df41764b + Reviewed-on: https://go-review.googlesource.com/15151 + Reviewed-by: Andrew Gerrand + Run-TryBot: Brad Fitzpatrick + TryBot-Result: Gobot Gobot + +diff --git a/src/net/http/httptest/server.go b/src/net/http/httptest/server.go +index 96eb0ef..e4f680f 100644 +--- a/src/net/http/httptest/server.go ++++ b/src/net/http/httptest/server.go +@@ -7,13 +7,17 @@ + package httptest + + import ( ++ "bytes" + "crypto/tls" + "flag" + "fmt" ++ "log" + "net" + "net/http" + "os" ++ "runtime" + "sync" ++ "time" + ) + + // A Server is an HTTP server listening on a system-chosen port on the +@@ -34,24 +38,10 @@ type Server struct { + // wg counts the number of outstanding HTTP requests on this server. + // Close blocks until all requests are finished. + wg sync.WaitGroup +-} +- +-// historyListener keeps track of all connections that it's ever +-// accepted. +-type historyListener struct { +- net.Listener +- sync.Mutex // protects history +- history []net.Conn +-} + +-func (hs *historyListener) Accept() (c net.Conn, err error) { +- c, err = hs.Listener.Accept() +- if err == nil { +- hs.Lock() +- hs.history = append(hs.history, c) +- hs.Unlock() +- } +- return ++ mu sync.Mutex // guards closed and conns ++ closed bool ++ conns map[net.Conn]http.ConnState // except terminal states + } + + func newLocalListener() net.Listener { +@@ -103,10 +93,9 @@ func (s *Server) Start() { + if s.URL != "" { + panic("Server already started") + } +- s.Listener = &historyListener{Listener: s.Listener} + s.URL = "http://" + s.Listener.Addr().String() +- s.wrapHandler() +- go s.Config.Serve(s.Listener) ++ s.wrap() ++ s.goServe() + if *serve != "" { + fmt.Fprintln(os.Stderr, "httptest: serving on", s.URL) + select {} +@@ -134,23 +123,10 @@ func (s *Server) StartTLS() { + if len(s.TLS.Certificates) == 0 { + s.TLS.Certificates = []tls.Certificate{cert} + } +- tlsListener := tls.NewListener(s.Listener, s.TLS) +- +- s.Listener = &historyListener{Listener: tlsListener} ++ s.Listener = tls.NewListener(s.Listener, s.TLS) + s.URL = "https://" + s.Listener.Addr().String() +- s.wrapHandler() +- go s.Config.Serve(s.Listener) +-} +- +-func (s *Server) wrapHandler() { +- h := s.Config.Handler +- if h == nil { +- h = http.DefaultServeMux +- } +- s.Config.Handler = &waitGroupHandler{ +- s: s, +- h: h, +- } ++ s.wrap() ++ s.goServe() + } + + // NewTLSServer starts and returns a new Server using TLS. +@@ -161,43 +137,139 @@ func NewTLSServer(handler http.Handler) *Server { + return ts + } + ++type closeIdleTransport interface { ++ CloseIdleConnections() ++} ++ + // Close shuts down the server and blocks until all outstanding + // requests on this server have completed. + func (s *Server) Close() { +- s.Listener.Close() +- s.wg.Wait() +- s.CloseClientConnections() +- if t, ok := http.DefaultTransport.(*http.Transport); ok { ++ s.mu.Lock() ++ if !s.closed { ++ s.closed = true ++ s.Listener.Close() ++ s.Config.SetKeepAlivesEnabled(false) ++ for c, st := range s.conns { ++ if st == http.StateIdle { ++ s.closeConn(c) ++ } ++ } ++ // If this server doesn't shut down in 5 seconds, tell the user why. ++ t := time.AfterFunc(5*time.Second, s.logCloseHangDebugInfo) ++ defer t.Stop() ++ } ++ s.mu.Unlock() ++ ++ // Not part of httptest.Server's correctness, but assume most ++ // users of httptest.Server will be using the standard ++ // transport, so help them out and close any idle connections for them. ++ if t, ok := http.DefaultTransport.(closeIdleTransport); ok { + t.CloseIdleConnections() + } ++ ++ s.wg.Wait() + } + +-// CloseClientConnections closes any currently open HTTP connections +-// to the test Server. ++func (s *Server) logCloseHangDebugInfo() { ++ s.mu.Lock() ++ defer s.mu.Unlock() ++ var buf bytes.Buffer ++ buf.WriteString("httptest.Server blocked in Close after 5 seconds, waiting for connections:\n") ++ for c, st := range s.conns { ++ fmt.Fprintf(&buf, " %T %p %v in state %v\n", c, c, c.RemoteAddr(), st) ++ } ++ log.Print(buf.String()) ++} ++ ++// CloseClientConnections closes any open HTTP connections to the test Server. + func (s *Server) CloseClientConnections() { +- hl, ok := s.Listener.(*historyListener) +- if !ok { +- return ++ s.mu.Lock() ++ defer s.mu.Unlock() ++ for c := range s.conns { ++ s.closeConn(c) + } +- hl.Lock() +- for _, conn := range hl.history { +- conn.Close() ++} ++ ++func (s *Server) goServe() { ++ s.wg.Add(1) ++ go func() { ++ defer s.wg.Done() ++ s.Config.Serve(s.Listener) ++ }() ++} ++ ++// wrap installs the connection state-tracking hook to know which ++// connections are idle. ++func (s *Server) wrap() { ++ oldHook := s.Config.ConnState ++ s.Config.ConnState = func(c net.Conn, cs http.ConnState) { ++ s.mu.Lock() ++ defer s.mu.Unlock() ++ switch cs { ++ case http.StateNew: ++ s.wg.Add(1) ++ if _, exists := s.conns[c]; exists { ++ panic("invalid state transition") ++ } ++ if s.conns == nil { ++ s.conns = make(map[net.Conn]http.ConnState) ++ } ++ s.conns[c] = cs ++ if s.closed { ++ // Probably just a socket-late-binding dial from ++ // the default transport that lost the race (and ++ // thus this connection is now idle and will ++ // never be used). ++ s.closeConn(c) ++ } ++ case http.StateActive: ++ if oldState, ok := s.conns[c]; ok { ++ if oldState != http.StateNew && oldState != http.StateIdle { ++ panic("invalid state transition") ++ } ++ s.conns[c] = cs ++ } ++ case http.StateIdle: ++ if oldState, ok := s.conns[c]; ok { ++ if oldState != http.StateActive { ++ panic("invalid state transition") ++ } ++ s.conns[c] = cs ++ } ++ if s.closed { ++ s.closeConn(c) ++ } ++ case http.StateHijacked, http.StateClosed: ++ s.forgetConn(c) ++ } ++ if oldHook != nil { ++ oldHook(c, cs) ++ } + } +- hl.Unlock() + } + +-// waitGroupHandler wraps a handler, incrementing and decrementing a +-// sync.WaitGroup on each request, to enable Server.Close to block +-// until outstanding requests are finished. +-type waitGroupHandler struct { +- s *Server +- h http.Handler // non-nil ++// closeConn closes c. Except on plan9, which is special. See comment below. ++// s.mu must be held. ++func (s *Server) closeConn(c net.Conn) { ++ if runtime.GOOS == "plan9" { ++ // Go's Plan 9 net package isn't great at unblocking reads when ++ // their underlying TCP connections are closed. Don't trust ++ // that that the ConnState state machine will get to ++ // StateClosed. Instead, just go there directly. Plan 9 may leak ++ // resources if the syscall doesn't end up returning. Oh well. ++ s.forgetConn(c) ++ } ++ go c.Close() + } + +-func (h *waitGroupHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { +- h.s.wg.Add(1) +- defer h.s.wg.Done() // a defer, in case ServeHTTP below panics +- h.h.ServeHTTP(w, r) ++// forgetConn removes c from the set of tracked conns and decrements it from the ++// waitgroup, unless it was previously removed. ++// s.mu must be held. ++func (s *Server) forgetConn(c net.Conn) { ++ if _, ok := s.conns[c]; ok { ++ delete(s.conns, c) ++ s.wg.Done() ++ } + } + + // localhostCert is a PEM-encoded TLS cert with SAN IPs +diff --git a/src/net/http/httptest/server_test.go b/src/net/http/httptest/server_test.go +index 500a9f0..90901ce 100644 +--- a/src/net/http/httptest/server_test.go ++++ b/src/net/http/httptest/server_test.go +@@ -27,3 +27,30 @@ func TestServer(t *testing.T) { + t.Errorf("got %q, want hello", string(got)) + } + } ++ ++// Issue 12781 ++func TestGetAfterClose(t *testing.T) { ++ ts := NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ++ w.Write([]byte("hello")) ++ })) ++ ++ res, err := http.Get(ts.URL) ++ if err != nil { ++ t.Fatal(err) ++ } ++ got, err := ioutil.ReadAll(res.Body) ++ if err != nil { ++ t.Fatal(err) ++ } ++ if string(got) != "hello" { ++ t.Fatalf("got %q, want hello", string(got)) ++ } ++ ++ ts.Close() ++ ++ res, err = http.Get(ts.URL) ++ if err == nil { ++ body, _ := ioutil.ReadAll(res.Body) ++ t.Fatalf("Unexected response after close: %v, %v, %s", res.Status, res.Header, body) ++ } ++} diff --git a/golang.spec b/golang.spec index af418c6..3bdaeff 100644 --- a/golang.spec +++ b/golang.spec @@ -42,7 +42,7 @@ Name: golang Version: 1.5.1 -Release: 0%{?dist} +Release: 1%{?dist} Summary: The Go Programming Language License: BSD @@ -82,6 +82,9 @@ Patch214: go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroup # 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 +# https://bugzilla.redhat.com/show_bug.cgi?id=1271709 +Patch216: ./golang-1.5.1-a3156aaa12.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -206,6 +209,8 @@ Summary: Golang shared object libraries # disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups %patch214 -p1 +%patch216 -p1 + %build # go1.5 bootstrapping. The compiler is written in golang. export GOROOT_BOOTSTRAP=%{goroot} @@ -405,6 +410,9 @@ fi %endif %changelog +* Mon Oct 19 2015 Vincent Batts - 1.5.1-1 +- bz1271709 include patch from upstream fix + * Wed Sep 09 2015 Vincent Batts - 1.5.1-0 - update to go1.5.1 From 27c6fb3111d21909a6a94589649af5889f35e25c Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 19 Oct 2015 20:32:59 -0400 Subject: [PATCH 073/156] bz1271709 fix from upstream --- golang-1.5.1-a3156aaa12.patch | 309 ++++++++++++++++++++++++++++++++++ golang.spec | 10 +- 2 files changed, 318 insertions(+), 1 deletion(-) create mode 100644 golang-1.5.1-a3156aaa12.patch diff --git a/golang-1.5.1-a3156aaa12.patch b/golang-1.5.1-a3156aaa12.patch new file mode 100644 index 0000000..afff18d --- /dev/null +++ b/golang-1.5.1-a3156aaa12.patch @@ -0,0 +1,309 @@ +commit a3156aaa121446c4136927f8c2139fefe05ba82c +Author: Brad Fitzpatrick +Date: Tue Sep 29 14:26:48 2015 -0700 + + net/http/httptest: change Server to use http.Server.ConnState for accounting + + With this CL, httptest.Server now uses connection-level accounting of + outstanding requests instead of ServeHTTP-level accounting. This is + more robust and results in a non-racy shutdown. + + This is much easier now that net/http.Server has the ConnState hook. + + Fixes #12789 + Fixes #12781 + + Change-Id: I098cf334a6494316acb66cd07df90766df41764b + Reviewed-on: https://go-review.googlesource.com/15151 + Reviewed-by: Andrew Gerrand + Run-TryBot: Brad Fitzpatrick + TryBot-Result: Gobot Gobot + +diff --git a/src/net/http/httptest/server.go b/src/net/http/httptest/server.go +index 96eb0ef..e4f680f 100644 +--- a/src/net/http/httptest/server.go ++++ b/src/net/http/httptest/server.go +@@ -7,13 +7,17 @@ + package httptest + + import ( ++ "bytes" + "crypto/tls" + "flag" + "fmt" ++ "log" + "net" + "net/http" + "os" ++ "runtime" + "sync" ++ "time" + ) + + // A Server is an HTTP server listening on a system-chosen port on the +@@ -34,24 +38,10 @@ type Server struct { + // wg counts the number of outstanding HTTP requests on this server. + // Close blocks until all requests are finished. + wg sync.WaitGroup +-} +- +-// historyListener keeps track of all connections that it's ever +-// accepted. +-type historyListener struct { +- net.Listener +- sync.Mutex // protects history +- history []net.Conn +-} + +-func (hs *historyListener) Accept() (c net.Conn, err error) { +- c, err = hs.Listener.Accept() +- if err == nil { +- hs.Lock() +- hs.history = append(hs.history, c) +- hs.Unlock() +- } +- return ++ mu sync.Mutex // guards closed and conns ++ closed bool ++ conns map[net.Conn]http.ConnState // except terminal states + } + + func newLocalListener() net.Listener { +@@ -103,10 +93,9 @@ func (s *Server) Start() { + if s.URL != "" { + panic("Server already started") + } +- s.Listener = &historyListener{Listener: s.Listener} + s.URL = "http://" + s.Listener.Addr().String() +- s.wrapHandler() +- go s.Config.Serve(s.Listener) ++ s.wrap() ++ s.goServe() + if *serve != "" { + fmt.Fprintln(os.Stderr, "httptest: serving on", s.URL) + select {} +@@ -134,23 +123,10 @@ func (s *Server) StartTLS() { + if len(s.TLS.Certificates) == 0 { + s.TLS.Certificates = []tls.Certificate{cert} + } +- tlsListener := tls.NewListener(s.Listener, s.TLS) +- +- s.Listener = &historyListener{Listener: tlsListener} ++ s.Listener = tls.NewListener(s.Listener, s.TLS) + s.URL = "https://" + s.Listener.Addr().String() +- s.wrapHandler() +- go s.Config.Serve(s.Listener) +-} +- +-func (s *Server) wrapHandler() { +- h := s.Config.Handler +- if h == nil { +- h = http.DefaultServeMux +- } +- s.Config.Handler = &waitGroupHandler{ +- s: s, +- h: h, +- } ++ s.wrap() ++ s.goServe() + } + + // NewTLSServer starts and returns a new Server using TLS. +@@ -161,43 +137,139 @@ func NewTLSServer(handler http.Handler) *Server { + return ts + } + ++type closeIdleTransport interface { ++ CloseIdleConnections() ++} ++ + // Close shuts down the server and blocks until all outstanding + // requests on this server have completed. + func (s *Server) Close() { +- s.Listener.Close() +- s.wg.Wait() +- s.CloseClientConnections() +- if t, ok := http.DefaultTransport.(*http.Transport); ok { ++ s.mu.Lock() ++ if !s.closed { ++ s.closed = true ++ s.Listener.Close() ++ s.Config.SetKeepAlivesEnabled(false) ++ for c, st := range s.conns { ++ if st == http.StateIdle { ++ s.closeConn(c) ++ } ++ } ++ // If this server doesn't shut down in 5 seconds, tell the user why. ++ t := time.AfterFunc(5*time.Second, s.logCloseHangDebugInfo) ++ defer t.Stop() ++ } ++ s.mu.Unlock() ++ ++ // Not part of httptest.Server's correctness, but assume most ++ // users of httptest.Server will be using the standard ++ // transport, so help them out and close any idle connections for them. ++ if t, ok := http.DefaultTransport.(closeIdleTransport); ok { + t.CloseIdleConnections() + } ++ ++ s.wg.Wait() + } + +-// CloseClientConnections closes any currently open HTTP connections +-// to the test Server. ++func (s *Server) logCloseHangDebugInfo() { ++ s.mu.Lock() ++ defer s.mu.Unlock() ++ var buf bytes.Buffer ++ buf.WriteString("httptest.Server blocked in Close after 5 seconds, waiting for connections:\n") ++ for c, st := range s.conns { ++ fmt.Fprintf(&buf, " %T %p %v in state %v\n", c, c, c.RemoteAddr(), st) ++ } ++ log.Print(buf.String()) ++} ++ ++// CloseClientConnections closes any open HTTP connections to the test Server. + func (s *Server) CloseClientConnections() { +- hl, ok := s.Listener.(*historyListener) +- if !ok { +- return ++ s.mu.Lock() ++ defer s.mu.Unlock() ++ for c := range s.conns { ++ s.closeConn(c) + } +- hl.Lock() +- for _, conn := range hl.history { +- conn.Close() ++} ++ ++func (s *Server) goServe() { ++ s.wg.Add(1) ++ go func() { ++ defer s.wg.Done() ++ s.Config.Serve(s.Listener) ++ }() ++} ++ ++// wrap installs the connection state-tracking hook to know which ++// connections are idle. ++func (s *Server) wrap() { ++ oldHook := s.Config.ConnState ++ s.Config.ConnState = func(c net.Conn, cs http.ConnState) { ++ s.mu.Lock() ++ defer s.mu.Unlock() ++ switch cs { ++ case http.StateNew: ++ s.wg.Add(1) ++ if _, exists := s.conns[c]; exists { ++ panic("invalid state transition") ++ } ++ if s.conns == nil { ++ s.conns = make(map[net.Conn]http.ConnState) ++ } ++ s.conns[c] = cs ++ if s.closed { ++ // Probably just a socket-late-binding dial from ++ // the default transport that lost the race (and ++ // thus this connection is now idle and will ++ // never be used). ++ s.closeConn(c) ++ } ++ case http.StateActive: ++ if oldState, ok := s.conns[c]; ok { ++ if oldState != http.StateNew && oldState != http.StateIdle { ++ panic("invalid state transition") ++ } ++ s.conns[c] = cs ++ } ++ case http.StateIdle: ++ if oldState, ok := s.conns[c]; ok { ++ if oldState != http.StateActive { ++ panic("invalid state transition") ++ } ++ s.conns[c] = cs ++ } ++ if s.closed { ++ s.closeConn(c) ++ } ++ case http.StateHijacked, http.StateClosed: ++ s.forgetConn(c) ++ } ++ if oldHook != nil { ++ oldHook(c, cs) ++ } + } +- hl.Unlock() + } + +-// waitGroupHandler wraps a handler, incrementing and decrementing a +-// sync.WaitGroup on each request, to enable Server.Close to block +-// until outstanding requests are finished. +-type waitGroupHandler struct { +- s *Server +- h http.Handler // non-nil ++// closeConn closes c. Except on plan9, which is special. See comment below. ++// s.mu must be held. ++func (s *Server) closeConn(c net.Conn) { ++ if runtime.GOOS == "plan9" { ++ // Go's Plan 9 net package isn't great at unblocking reads when ++ // their underlying TCP connections are closed. Don't trust ++ // that that the ConnState state machine will get to ++ // StateClosed. Instead, just go there directly. Plan 9 may leak ++ // resources if the syscall doesn't end up returning. Oh well. ++ s.forgetConn(c) ++ } ++ go c.Close() + } + +-func (h *waitGroupHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { +- h.s.wg.Add(1) +- defer h.s.wg.Done() // a defer, in case ServeHTTP below panics +- h.h.ServeHTTP(w, r) ++// forgetConn removes c from the set of tracked conns and decrements it from the ++// waitgroup, unless it was previously removed. ++// s.mu must be held. ++func (s *Server) forgetConn(c net.Conn) { ++ if _, ok := s.conns[c]; ok { ++ delete(s.conns, c) ++ s.wg.Done() ++ } + } + + // localhostCert is a PEM-encoded TLS cert with SAN IPs +diff --git a/src/net/http/httptest/server_test.go b/src/net/http/httptest/server_test.go +index 500a9f0..90901ce 100644 +--- a/src/net/http/httptest/server_test.go ++++ b/src/net/http/httptest/server_test.go +@@ -27,3 +27,30 @@ func TestServer(t *testing.T) { + t.Errorf("got %q, want hello", string(got)) + } + } ++ ++// Issue 12781 ++func TestGetAfterClose(t *testing.T) { ++ ts := NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ++ w.Write([]byte("hello")) ++ })) ++ ++ res, err := http.Get(ts.URL) ++ if err != nil { ++ t.Fatal(err) ++ } ++ got, err := ioutil.ReadAll(res.Body) ++ if err != nil { ++ t.Fatal(err) ++ } ++ if string(got) != "hello" { ++ t.Fatalf("got %q, want hello", string(got)) ++ } ++ ++ ts.Close() ++ ++ res, err = http.Get(ts.URL) ++ if err == nil { ++ body, _ := ioutil.ReadAll(res.Body) ++ t.Fatalf("Unexected response after close: %v, %v, %s", res.Status, res.Header, body) ++ } ++} diff --git a/golang.spec b/golang.spec index 5c996d7..7d53ef8 100644 --- a/golang.spec +++ b/golang.spec @@ -47,7 +47,7 @@ Name: golang Version: 1.5.1 -Release: 0%{?dist} +Release: 1%{?dist} Summary: The Go Programming Language License: BSD @@ -86,6 +86,9 @@ Patch214: go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroup # 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 +# https://bugzilla.redhat.com/show_bug.cgi?id=1271709 +Patch216: ./golang-1.5.1-a3156aaa12.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -211,6 +214,8 @@ Summary: Golang shared object libraries # disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups %patch214 -p1 +%patch216 -p1 + %build # go1.5 bootstrapping. The compiler is written in golang. export GOROOT_BOOTSTRAP=%{goroot} @@ -427,6 +432,9 @@ fi %endif %changelog +* Mon Oct 19 2015 Vincent Batts - 1.5.1-1 +- bz1271709 include patch from upstream fix + * Wed Sep 09 2015 Vincent Batts - 1.5.1-0 - update to go1.5.1 From c524af8454a51d902fa926de735f6fb951fce0b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Tue, 3 Nov 2015 16:14:15 +0100 Subject: [PATCH 074/156] Rebase to 1.5.2(bz1288263) Spec file clean up Added basic build options --- .gitignore | 2 + golang.spec | 154 +++++++++++++++++++++++++++++++++++++--------------- source.sh | 8 +++ sources | 3 +- 4 files changed, 123 insertions(+), 44 deletions(-) create mode 100755 source.sh diff --git a/.gitignore b/.gitignore index 5c0b29a..676941a 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ /go1.5rc1.src.tar.gz /go1.5.src.tar.gz /go1.5.1.src.tar.gz +/go1.5.2.src.tar.gz +/Mark.Twain-Tom.Sawyer.txt.bz2 diff --git a/golang.spec b/golang.spec index 3bdaeff..69f8968 100644 --- a/golang.spec +++ b/golang.spec @@ -22,8 +22,49 @@ %global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \ /usr/lib/rpm/brp-compress -# let this match the macros in macros.golang +# Golang build options. + +# Buid golang using external/internal(close to cgo disabled) linking. +%ifarch %{golang_arches} +%global external_linker 1 +%else +%global external_linker 0 +%endif + +# Build golang with cgo enabled/disabled(later equals more or less to internal linking). +%ifarch %{golang_arches} +%global cgo_enabled 1 +%else +%global cgo_enabled 0 +%endif + +# Use golang/gcc-go as bootstrap compiler +%ifarch %{golang_arches} +%global golang_bootstrap 1 +%else +%global golang_bootstrap 0 +%endif +# boostrap(with internal linking) using gcc-go fails due to bug in tests(https://github.com/golang/go/issues/12629) +# make check not to fail due to it + +# Controls what ever we fails on failed tests +%ifarch %{golang_arches} +%global fail_on_tests 1 +%else +%global fail_on_tests 0 +%endif + +# TODO get more support for shared objects +# Build golang shared objects for stdlib +%ifarch x86_64 +%global shared 1 +%else +%global shared 0 +%endif + +# Fedora GOROOT %global goroot /usr/lib/%{name} + %ifarch x86_64 %global gohostarch amd64 %endif @@ -36,40 +77,55 @@ %ifarch aarch64 %global gohostarch arm64 %endif +%ifarch ppc64 +%global gohostarch ppc64 +%endif +%ifarch ppc64le +%global gohostarch ppc64le +%endif %global go_api 1.5 -%global go_version 1.5.1 +%global go_version 1.5.2 Name: golang -Version: 1.5.1 +Version: 1.5.2 Release: 1%{?dist} Summary: The Go Programming Language - -License: BSD +# source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain +License: BSD and Public Domain URL: http://golang.org/ +# pre-processed by source.sh to make Mark.Twain-Tom.Sawyer.txt free again Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz +# original removed by source.sh, replace by version from golang master branch with license scrubbed +Source1: Mark.Twain-Tom.Sawyer.txt.bz2 -# go1.5 bootstrapping. The compiler is written in golang. +# The compiler is written in Go. Needs go(1.4+) compiler for build. +%if !%{golang_bootstrap} +BuildRequires: gcc-go >= 5 +%else BuildRequires: golang > 1.4 -BuildRequires: pcre-devel +%endif %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 +# for tests +BuildRequires: pcre-devel, glibc-static Provides: go = %{version}-%{release} Requires: %{name}-bin Requires: %{name}-src = %{version}-%{release} -Requires: go-srpm-macros +Requires: go-srpm-macros Patch0: golang-1.2-verbose-build.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Patch1: golang-1.2-remove-ECC-p224.patch +# use the arch dependent path in the bootstrap +Patch212: golang-1.5-bootstrap-binary-path.patch + # disable TestGdbPython # https://github.com/golang/go/issues/11214 Patch213: go1.5beta1-disable-TestGdbPython.patch @@ -183,7 +239,7 @@ for _,d in pairs({"api", "doc", "include", "lib", "src"}) do end end -%ifarch x86_64 +%if %{shared} %package shared Summary: Golang shared object libraries @@ -211,34 +267,41 @@ Summary: Golang shared object libraries %patch216 -p1 +cp %{SOURCE1} "$(pwd)/src/compress/bzip2/testdata/Mark.Twain-Tom.Sawyer.txt.bz2" + %build -# go1.5 bootstrapping. The compiler is written in golang. +# bootstrap compiler GOROOT +%if !%{golang_bootstrap} +export GOROOT_BOOTSTRAP=/ +%else export GOROOT_BOOTSTRAP=%{goroot} +%endif # set up final install location export GOROOT_FINAL=%{goroot} -# TODO use the system linker to get the system link flags and build-id -# when https://code.google.com/p/go/issues/detail?id=5221 is solved -#export GO_LDFLAGS="-linkmode external -extldflags $RPM_LD_FLAGS" - export GOHOSTOS=linux export GOHOSTARCH=%{gohostarch} pushd src # use our gcc options for this build, but store gcc as default for compiler -CFLAGS="$RPM_OPT_FLAGS" \ -LDFLAGS="$RPM_LD_FLAGS" \ -CC="gcc" \ -CC_FOR_TARGET="gcc" \ -GOOS=linux \ -GOARCH=%{gohostarch} \ - ./make.bash --no-clean +export CFLAGS="$RPM_OPT_FLAGS" +export LDFLAGS="$RPM_LD_FLAGS" +export CC="gcc" +export CC_FOR_TARGET="gcc" +export GOOS=linux +export GOARCH=%{gohostarch} +%if !%{external_linker} +export GO_LDFLAGS="-linkmode internal" +%endif +%if !%{cgo_enabled} +export CGO_ENABLED=0 +%endif +./make.bash --no-clean popd -%ifarch x86_64 -# TODO get linux/386 support for shared objects. -# golang shared objects for stdlib +# build shared std lib +%if %{shared} GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std %endif @@ -282,7 +345,7 @@ 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 +%if %{shared} find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list %endif @@ -330,22 +393,21 @@ cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf export GOROOT=$(pwd -P) export PATH="$GOROOT"/bin:"$PATH" cd src -# skip using CGO for test. causes a SIGABRT on fc21 (bz1086900) -# until this test/issue is fixed -# https://bugzilla.redhat.com/show_bug.cgi?id=1086900 -# CGO for test, which fails in i686 on fc21 inside mock/chroot (bz1087621) -# https://bugzilla.redhat.com/show_bug.cgi?id=1087621 -# 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 - -# XXX reenable. likely go1.5beta2 https://github.com/golang/go/commit/9adf684686bad7c6319080d0b1da8308a77b08c9 -#CGO_ENABLED=0 ./run.bash --no-rebuild - -CC="gcc" \ -CFLAGS="$RPM_OPT_FLAGS" \ -LDFLAGS="$RPM_LD_FLAGS" \ -./run.bash --no-rebuild -v -k +export CC="gcc" +export CFLAGS="$RPM_OPT_FLAGS" +export LDFLAGS="$RPM_LD_FLAGS" +%if !%{external_linker} +export GO_LDFLAGS="-linkmode internal" +%endif +%if !%{cgo_enabled} || !%{external_linker} +export CGO_ENABLED=0 +%endif +%if %{fail_on_tests} +./run.bash --no-rebuild -v -v -v -k +%else +./run.bash --no-rebuild -v -v -v -k || : +%endif cd .. @@ -405,11 +467,17 @@ fi %{_bindir}/go %{_bindir}/gofmt -%ifarch x86_64 +%if %{shared} %files -f go-shared.list shared %endif %changelog +* Tue Dec 08 2015 Jakub Čajka - 1.5.2-1 +- bz1288263 rebase to 1.5.2 +- spec file clean up +- added build options +- scrubbed "Project Gutenberg License" + * Mon Oct 19 2015 Vincent Batts - 1.5.1-1 - bz1271709 include patch from upstream fix diff --git a/source.sh b/source.sh new file mode 100755 index 0000000..9a7f61a --- /dev/null +++ b/source.sh @@ -0,0 +1,8 @@ +#! /bin/bash +tar -xzf $1 +cat ./go/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt |tail -n +25 | head -n 8465 > ./go/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt.new +mv ./go/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt.new ./go/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt +rm -f ./go/src/compress/bzip2/testdata/Mark.Twain-Tom.Sawyer.txt.bz2 +rm $1 +tar -czf $1 ./go +rm -rf ./go diff --git a/sources b/sources index 23e64bc..2940f56 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -4adfbdfca523cc1c229be8a321f3602f go1.5.1.src.tar.gz +5317d2785056450be19dc9623356aefe go1.5.2.src.tar.gz +95da7ca97a8b8f5955fb7eb329784489 Mark.Twain-Tom.Sawyer.txt.bz2 From 8b92652b248cdebc464e89b394c756def7f07bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 11 Dec 2015 12:51:16 +0100 Subject: [PATCH 075/156] bz1290472 Accept x509 certs with negative serial --- bz1290543.patch | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ golang.spec | 11 +++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 bz1290543.patch diff --git a/bz1290543.patch b/bz1290543.patch new file mode 100644 index 0000000..9e8b33d --- /dev/null +++ b/bz1290543.patch @@ -0,0 +1,55 @@ +From a0ea93dea5f5741addc8c96b7ed037d0e359e33f Mon Sep 17 00:00:00 2001 +From: Adam Langley +Date: Fri, 27 Nov 2015 13:50:36 -0800 +Subject: [PATCH] crypto/x509: permit serial numbers to be negative. + +Some software that produces certificates doesn't encode integers +correctly and, about half the time, ends up producing certificates with +serial numbers that are actually negative. + +This buggy software, sadly, appears to be common enough that we should +let these errors pass. This change allows a Certificate.SerialNumber to +be negative. + +Fixes #8265. + +Change-Id: Ief35dae23988fb6d5e2873e3c521366fb03c6af4 +Reviewed-on: https://go-review.googlesource.com/17247 +Reviewed-by: Brad Fitzpatrick +--- + src/crypto/x509/x509.go | 4 ---- + src/crypto/x509/x509_test.go | 6 +++++- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go +index bbc63241..126432d 100644 +--- a/src/crypto/x509/x509.go ++++ b/src/crypto/x509/x509.go +@@ -909,10 +909,6 @@ func parseCertificate(in *certificate) (*Certificate, error) { + return nil, err + } + +- if in.TBSCertificate.SerialNumber.Sign() < 0 { +- return nil, errors.New("x509: negative serial number") +- } +- + out.Version = in.TBSCertificate.Version + 1 + out.SerialNumber = in.TBSCertificate.SerialNumber + +diff --git a/src/crypto/x509/x509_test.go b/src/crypto/x509/x509_test.go +index 61b1773..2c01ec7 100644 +--- a/src/crypto/x509/x509_test.go ++++ b/src/crypto/x509/x509_test.go +@@ -343,7 +343,11 @@ func TestCreateSelfSignedCertificate(t *testing.T) { + for _, test := range tests { + commonName := "test.example.com" + template := Certificate{ +- SerialNumber: big.NewInt(1), ++ // SerialNumber is negative to ensure that negative ++ // values are parsed. This is due to the prevalence of ++ // buggy code that produces certificates with negative ++ // serial numbers. ++ SerialNumber: big.NewInt(-1), + Subject: pkix.Name{ + CommonName: commonName, + Organization: []string{"Σ Acme Co"}, diff --git a/golang.spec b/golang.spec index 69f8968..bbfd7be 100644 --- a/golang.spec +++ b/golang.spec @@ -89,7 +89,7 @@ Name: golang Version: 1.5.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -122,6 +122,10 @@ Patch0: golang-1.2-verbose-build.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Patch1: golang-1.2-remove-ECC-p224.patch +# Accept x509 certs with negative serial +# https://bugzilla.redhat.com/show_bug.cgi?id=1290543 +# https://github.com/golang/go/issues/8265 +Patch2: bz1290543.patch # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch @@ -256,6 +260,8 @@ Summary: Golang shared object libraries # remove the P224 curve %patch1 -p1 +%patch2 -p1 + # use the arch dependent path in the bootstrap %patch212 -p1 @@ -472,6 +478,9 @@ fi %endif %changelog +* Fri Dec 11 2015 Jakub Čajka - 1.5.2-2 +- bz1290472 Accept x509 certs with negative serial + * Tue Dec 08 2015 Jakub Čajka - 1.5.2-1 - bz1288263 rebase to 1.5.2 - spec file clean up From 85525165e1b113f8d1e6d5baddc8a51664c05e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 14 Dec 2015 14:14:53 +0100 Subject: [PATCH 076/156] Fix bz number from previous commit, should be bz1290543 --- golang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index bbfd7be..6348496 100644 --- a/golang.spec +++ b/golang.spec @@ -479,7 +479,7 @@ fi %changelog * Fri Dec 11 2015 Jakub Čajka - 1.5.2-2 -- bz1290472 Accept x509 certs with negative serial +- bz1290543 Accept x509 certs with negative serial * Tue Dec 08 2015 Jakub Čajka - 1.5.2-1 - bz1288263 rebase to 1.5.2 From 672b8a12175adc7bbfe7dc5dc0545a2f371c50dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 14 Jan 2016 15:13:23 +0100 Subject: [PATCH 077/156] rebase to 1.5.3 resolves bz1293451, CVE-2015-8618 --- .gitignore | 1 + golang.spec | 19 ++++++++++++++++--- sources | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 676941a..a2b446d 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ /go1.5.1.src.tar.gz /go1.5.2.src.tar.gz /Mark.Twain-Tom.Sawyer.txt.bz2 +/go1.5.3.src.tar.gz diff --git a/golang.spec b/golang.spec index 6348496..21242f8 100644 --- a/golang.spec +++ b/golang.spec @@ -85,11 +85,11 @@ %endif %global go_api 1.5 -%global go_version 1.5.2 +%global go_version 1.5.3 Name: golang -Version: 1.5.2 -Release: 2%{?dist} +Version: 1.5.3 +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -271,11 +271,18 @@ Summary: Golang shared object libraries # disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups %patch214 -p1 +%patch215 -p1 + %patch216 -p1 cp %{SOURCE1} "$(pwd)/src/compress/bzip2/testdata/Mark.Twain-Tom.Sawyer.txt.bz2" %build +# print out system information +uname -a +cat /proc/cpuinfo +cat /proc/meminfo + # bootstrap compiler GOROOT %if !%{golang_bootstrap} export GOROOT_BOOTSTRAP=/ @@ -478,6 +485,12 @@ fi %endif %changelog +* Thu Jan 14 2016 Jakub Čajka - 1.5.3-1 +- rebase to 1.5.3 +- resolves bz1293451, CVE-2015-8618 +- apply timezone patch, avoid using bundled data +- print out rpm build system info + * Fri Dec 11 2015 Jakub Čajka - 1.5.2-2 - bz1290543 Accept x509 certs with negative serial diff --git a/sources b/sources index 2940f56..d1149f9 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -5317d2785056450be19dc9623356aefe go1.5.2.src.tar.gz +5c07bee28b57345e67c4dfa4074b83e8 go1.5.3.src.tar.gz 95da7ca97a8b8f5955fb7eb329784489 Mark.Twain-Tom.Sawyer.txt.bz2 From d40cd88359c0dbc5116f048561d27738e6b6c51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 28 Jan 2016 13:19:10 +0100 Subject: [PATCH 078/156] Resolves bz1292640, rebase to pre-release 1.6 bootstrap for PowerPC fix rpmlint errors/warning --- .gitignore | 1 + bz1290543.patch | 55 ---- ...EWUSERAndRemapNoRootDisableSetgroups.patch | 13 - golang-1.5-bootstrap-binary-path.patch | 24 +- golang-1.5.1-a3156aaa12.patch | 309 ------------------ golang.spec | 105 +++--- source.sh | 8 - sources | 3 +- 8 files changed, 55 insertions(+), 463 deletions(-) delete mode 100644 bz1290543.patch delete mode 100644 go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch delete mode 100644 golang-1.5.1-a3156aaa12.patch delete mode 100755 source.sh diff --git a/.gitignore b/.gitignore index a2b446d..5b86319 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ /go1.5.2.src.tar.gz /Mark.Twain-Tom.Sawyer.txt.bz2 /go1.5.3.src.tar.gz +/go1.6rc1.src.tar.gz diff --git a/bz1290543.patch b/bz1290543.patch deleted file mode 100644 index 9e8b33d..0000000 --- a/bz1290543.patch +++ /dev/null @@ -1,55 +0,0 @@ -From a0ea93dea5f5741addc8c96b7ed037d0e359e33f Mon Sep 17 00:00:00 2001 -From: Adam Langley -Date: Fri, 27 Nov 2015 13:50:36 -0800 -Subject: [PATCH] crypto/x509: permit serial numbers to be negative. - -Some software that produces certificates doesn't encode integers -correctly and, about half the time, ends up producing certificates with -serial numbers that are actually negative. - -This buggy software, sadly, appears to be common enough that we should -let these errors pass. This change allows a Certificate.SerialNumber to -be negative. - -Fixes #8265. - -Change-Id: Ief35dae23988fb6d5e2873e3c521366fb03c6af4 -Reviewed-on: https://go-review.googlesource.com/17247 -Reviewed-by: Brad Fitzpatrick ---- - src/crypto/x509/x509.go | 4 ---- - src/crypto/x509/x509_test.go | 6 +++++- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go -index bbc63241..126432d 100644 ---- a/src/crypto/x509/x509.go -+++ b/src/crypto/x509/x509.go -@@ -909,10 +909,6 @@ func parseCertificate(in *certificate) (*Certificate, error) { - return nil, err - } - -- if in.TBSCertificate.SerialNumber.Sign() < 0 { -- return nil, errors.New("x509: negative serial number") -- } -- - out.Version = in.TBSCertificate.Version + 1 - out.SerialNumber = in.TBSCertificate.SerialNumber - -diff --git a/src/crypto/x509/x509_test.go b/src/crypto/x509/x509_test.go -index 61b1773..2c01ec7 100644 ---- a/src/crypto/x509/x509_test.go -+++ b/src/crypto/x509/x509_test.go -@@ -343,7 +343,11 @@ func TestCreateSelfSignedCertificate(t *testing.T) { - for _, test := range tests { - commonName := "test.example.com" - template := Certificate{ -- SerialNumber: big.NewInt(1), -+ // SerialNumber is negative to ensure that negative -+ // values are parsed. This is due to the prevalence of -+ // buggy code that produces certificates with negative -+ // serial numbers. -+ SerialNumber: big.NewInt(-1), - Subject: pkix.Name{ - CommonName: commonName, - Organization: []string{"Σ Acme Co"}, diff --git a/go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch b/go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch deleted file mode 100644 index 9b348ad..0000000 --- a/go1.5beta2-disable-TestCloneNEWUSERAndRemapNoRootDisableSetgroups.patch +++ /dev/null @@ -1,13 +0,0 @@ -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.5-bootstrap-binary-path.patch b/golang-1.5-bootstrap-binary-path.patch index 8444727..e452e89 100644 --- a/golang-1.5-bootstrap-binary-path.patch +++ b/golang-1.5-bootstrap-binary-path.patch @@ -1,8 +1,7 @@ -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() { +diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go +--- go/src/cmd/dist/buildtool.go.bootstrap 2015-11-12 06:19:58.000000000 +0100 ++++ go/src/cmd/dist/buildtool.go 2015-11-13 09:54:58.796721027 +0100 +@@ -106,12 +106,20 @@ func bootstrapBuildTools() { os.Setenv("GOBIN", "") os.Setenv("GOOS", "") @@ -25,11 +24,10 @@ index be54ac4..6744fbdc 100644 // 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.' +diff -up go/src/make.bash.bootstrap go/src/make.bash +--- go/src/make.bash.bootstrap 2015-11-13 09:54:58.797721031 +0100 ++++ go/src/make.bash 2015-11-13 10:11:11.633552619 +0100 +@@ -113,8 +113,15 @@ echo '##### Building Go bootstrap tool.' echo cmd/dist export GOROOT="$(cd .. && pwd)" GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4} @@ -45,9 +43,5 @@ index f17648a..77f463c 100755 + 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 + exit 1 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-1.5.1-a3156aaa12.patch b/golang-1.5.1-a3156aaa12.patch deleted file mode 100644 index afff18d..0000000 --- a/golang-1.5.1-a3156aaa12.patch +++ /dev/null @@ -1,309 +0,0 @@ -commit a3156aaa121446c4136927f8c2139fefe05ba82c -Author: Brad Fitzpatrick -Date: Tue Sep 29 14:26:48 2015 -0700 - - net/http/httptest: change Server to use http.Server.ConnState for accounting - - With this CL, httptest.Server now uses connection-level accounting of - outstanding requests instead of ServeHTTP-level accounting. This is - more robust and results in a non-racy shutdown. - - This is much easier now that net/http.Server has the ConnState hook. - - Fixes #12789 - Fixes #12781 - - Change-Id: I098cf334a6494316acb66cd07df90766df41764b - Reviewed-on: https://go-review.googlesource.com/15151 - Reviewed-by: Andrew Gerrand - Run-TryBot: Brad Fitzpatrick - TryBot-Result: Gobot Gobot - -diff --git a/src/net/http/httptest/server.go b/src/net/http/httptest/server.go -index 96eb0ef..e4f680f 100644 ---- a/src/net/http/httptest/server.go -+++ b/src/net/http/httptest/server.go -@@ -7,13 +7,17 @@ - package httptest - - import ( -+ "bytes" - "crypto/tls" - "flag" - "fmt" -+ "log" - "net" - "net/http" - "os" -+ "runtime" - "sync" -+ "time" - ) - - // A Server is an HTTP server listening on a system-chosen port on the -@@ -34,24 +38,10 @@ type Server struct { - // wg counts the number of outstanding HTTP requests on this server. - // Close blocks until all requests are finished. - wg sync.WaitGroup --} -- --// historyListener keeps track of all connections that it's ever --// accepted. --type historyListener struct { -- net.Listener -- sync.Mutex // protects history -- history []net.Conn --} - --func (hs *historyListener) Accept() (c net.Conn, err error) { -- c, err = hs.Listener.Accept() -- if err == nil { -- hs.Lock() -- hs.history = append(hs.history, c) -- hs.Unlock() -- } -- return -+ mu sync.Mutex // guards closed and conns -+ closed bool -+ conns map[net.Conn]http.ConnState // except terminal states - } - - func newLocalListener() net.Listener { -@@ -103,10 +93,9 @@ func (s *Server) Start() { - if s.URL != "" { - panic("Server already started") - } -- s.Listener = &historyListener{Listener: s.Listener} - s.URL = "http://" + s.Listener.Addr().String() -- s.wrapHandler() -- go s.Config.Serve(s.Listener) -+ s.wrap() -+ s.goServe() - if *serve != "" { - fmt.Fprintln(os.Stderr, "httptest: serving on", s.URL) - select {} -@@ -134,23 +123,10 @@ func (s *Server) StartTLS() { - if len(s.TLS.Certificates) == 0 { - s.TLS.Certificates = []tls.Certificate{cert} - } -- tlsListener := tls.NewListener(s.Listener, s.TLS) -- -- s.Listener = &historyListener{Listener: tlsListener} -+ s.Listener = tls.NewListener(s.Listener, s.TLS) - s.URL = "https://" + s.Listener.Addr().String() -- s.wrapHandler() -- go s.Config.Serve(s.Listener) --} -- --func (s *Server) wrapHandler() { -- h := s.Config.Handler -- if h == nil { -- h = http.DefaultServeMux -- } -- s.Config.Handler = &waitGroupHandler{ -- s: s, -- h: h, -- } -+ s.wrap() -+ s.goServe() - } - - // NewTLSServer starts and returns a new Server using TLS. -@@ -161,43 +137,139 @@ func NewTLSServer(handler http.Handler) *Server { - return ts - } - -+type closeIdleTransport interface { -+ CloseIdleConnections() -+} -+ - // Close shuts down the server and blocks until all outstanding - // requests on this server have completed. - func (s *Server) Close() { -- s.Listener.Close() -- s.wg.Wait() -- s.CloseClientConnections() -- if t, ok := http.DefaultTransport.(*http.Transport); ok { -+ s.mu.Lock() -+ if !s.closed { -+ s.closed = true -+ s.Listener.Close() -+ s.Config.SetKeepAlivesEnabled(false) -+ for c, st := range s.conns { -+ if st == http.StateIdle { -+ s.closeConn(c) -+ } -+ } -+ // If this server doesn't shut down in 5 seconds, tell the user why. -+ t := time.AfterFunc(5*time.Second, s.logCloseHangDebugInfo) -+ defer t.Stop() -+ } -+ s.mu.Unlock() -+ -+ // Not part of httptest.Server's correctness, but assume most -+ // users of httptest.Server will be using the standard -+ // transport, so help them out and close any idle connections for them. -+ if t, ok := http.DefaultTransport.(closeIdleTransport); ok { - t.CloseIdleConnections() - } -+ -+ s.wg.Wait() - } - --// CloseClientConnections closes any currently open HTTP connections --// to the test Server. -+func (s *Server) logCloseHangDebugInfo() { -+ s.mu.Lock() -+ defer s.mu.Unlock() -+ var buf bytes.Buffer -+ buf.WriteString("httptest.Server blocked in Close after 5 seconds, waiting for connections:\n") -+ for c, st := range s.conns { -+ fmt.Fprintf(&buf, " %T %p %v in state %v\n", c, c, c.RemoteAddr(), st) -+ } -+ log.Print(buf.String()) -+} -+ -+// CloseClientConnections closes any open HTTP connections to the test Server. - func (s *Server) CloseClientConnections() { -- hl, ok := s.Listener.(*historyListener) -- if !ok { -- return -+ s.mu.Lock() -+ defer s.mu.Unlock() -+ for c := range s.conns { -+ s.closeConn(c) - } -- hl.Lock() -- for _, conn := range hl.history { -- conn.Close() -+} -+ -+func (s *Server) goServe() { -+ s.wg.Add(1) -+ go func() { -+ defer s.wg.Done() -+ s.Config.Serve(s.Listener) -+ }() -+} -+ -+// wrap installs the connection state-tracking hook to know which -+// connections are idle. -+func (s *Server) wrap() { -+ oldHook := s.Config.ConnState -+ s.Config.ConnState = func(c net.Conn, cs http.ConnState) { -+ s.mu.Lock() -+ defer s.mu.Unlock() -+ switch cs { -+ case http.StateNew: -+ s.wg.Add(1) -+ if _, exists := s.conns[c]; exists { -+ panic("invalid state transition") -+ } -+ if s.conns == nil { -+ s.conns = make(map[net.Conn]http.ConnState) -+ } -+ s.conns[c] = cs -+ if s.closed { -+ // Probably just a socket-late-binding dial from -+ // the default transport that lost the race (and -+ // thus this connection is now idle and will -+ // never be used). -+ s.closeConn(c) -+ } -+ case http.StateActive: -+ if oldState, ok := s.conns[c]; ok { -+ if oldState != http.StateNew && oldState != http.StateIdle { -+ panic("invalid state transition") -+ } -+ s.conns[c] = cs -+ } -+ case http.StateIdle: -+ if oldState, ok := s.conns[c]; ok { -+ if oldState != http.StateActive { -+ panic("invalid state transition") -+ } -+ s.conns[c] = cs -+ } -+ if s.closed { -+ s.closeConn(c) -+ } -+ case http.StateHijacked, http.StateClosed: -+ s.forgetConn(c) -+ } -+ if oldHook != nil { -+ oldHook(c, cs) -+ } - } -- hl.Unlock() - } - --// waitGroupHandler wraps a handler, incrementing and decrementing a --// sync.WaitGroup on each request, to enable Server.Close to block --// until outstanding requests are finished. --type waitGroupHandler struct { -- s *Server -- h http.Handler // non-nil -+// closeConn closes c. Except on plan9, which is special. See comment below. -+// s.mu must be held. -+func (s *Server) closeConn(c net.Conn) { -+ if runtime.GOOS == "plan9" { -+ // Go's Plan 9 net package isn't great at unblocking reads when -+ // their underlying TCP connections are closed. Don't trust -+ // that that the ConnState state machine will get to -+ // StateClosed. Instead, just go there directly. Plan 9 may leak -+ // resources if the syscall doesn't end up returning. Oh well. -+ s.forgetConn(c) -+ } -+ go c.Close() - } - --func (h *waitGroupHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { -- h.s.wg.Add(1) -- defer h.s.wg.Done() // a defer, in case ServeHTTP below panics -- h.h.ServeHTTP(w, r) -+// forgetConn removes c from the set of tracked conns and decrements it from the -+// waitgroup, unless it was previously removed. -+// s.mu must be held. -+func (s *Server) forgetConn(c net.Conn) { -+ if _, ok := s.conns[c]; ok { -+ delete(s.conns, c) -+ s.wg.Done() -+ } - } - - // localhostCert is a PEM-encoded TLS cert with SAN IPs -diff --git a/src/net/http/httptest/server_test.go b/src/net/http/httptest/server_test.go -index 500a9f0..90901ce 100644 ---- a/src/net/http/httptest/server_test.go -+++ b/src/net/http/httptest/server_test.go -@@ -27,3 +27,30 @@ func TestServer(t *testing.T) { - t.Errorf("got %q, want hello", string(got)) - } - } -+ -+// Issue 12781 -+func TestGetAfterClose(t *testing.T) { -+ ts := NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { -+ w.Write([]byte("hello")) -+ })) -+ -+ res, err := http.Get(ts.URL) -+ if err != nil { -+ t.Fatal(err) -+ } -+ got, err := ioutil.ReadAll(res.Body) -+ if err != nil { -+ t.Fatal(err) -+ } -+ if string(got) != "hello" { -+ t.Fatalf("got %q, want hello", string(got)) -+ } -+ -+ ts.Close() -+ -+ res, err = http.Get(ts.URL) -+ if err == nil { -+ body, _ := ioutil.ReadAll(res.Body) -+ t.Fatalf("Unexected response after close: %v, %v, %s", res.Status, res.Header, body) -+ } -+} diff --git a/golang.spec b/golang.spec index 21242f8..29a0d61 100644 --- a/golang.spec +++ b/golang.spec @@ -24,15 +24,15 @@ # Golang build options. -# Buid golang using external/internal(close to cgo disabled) linking. -%ifarch %{golang_arches} +# Build golang using external/internal(close to cgo disabled) linking. +%ifarch %{golang_arches} %{power64} %global external_linker 1 %else %global external_linker 0 %endif # Build golang with cgo enabled/disabled(later equals more or less to internal linking). -%ifarch %{golang_arches} +%ifarch %{golang_arches} %{power64} %global cgo_enabled 1 %else %global cgo_enabled 0 @@ -44,19 +44,16 @@ %else %global golang_bootstrap 0 %endif -# boostrap(with internal linking) using gcc-go fails due to bug in tests(https://github.com/golang/go/issues/12629) -# make check not to fail due to it -# Controls what ever we fails on failed tests -%ifarch %{golang_arches} +# Controls what ever we fail on failed tests +%ifarch %{golang_arches} %{power64} %global fail_on_tests 1 %else %global fail_on_tests 0 %endif -# TODO get more support for shared objects # Build golang shared objects for stdlib -%ifarch x86_64 +%ifarch %{ix86} x86_64 ppc64le %{arm} aarch64 %global shared 1 %else %global shared 0 @@ -84,20 +81,17 @@ %global gohostarch ppc64le %endif -%global go_api 1.5 -%global go_version 1.5.3 +%global go_api 1.6 +%global go_version 1.6 Name: golang -Version: 1.5.3 -Release: 1%{?dist} +Version: 1.6 +Release: 0.1.rc1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain URL: http://golang.org/ -# pre-processed by source.sh to make Mark.Twain-Tom.Sawyer.txt free again -Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz -# original removed by source.sh, replace by version from golang master branch with license scrubbed -Source1: Mark.Twain-Tom.Sawyer.txt.bz2 +Source0: https://storage.googleapis.com/golang/go1.6rc1.src.tar.gz # The compiler is written in Go. Needs go(1.4+) compiler for build. %if !%{golang_bootstrap} @@ -114,7 +108,7 @@ BuildRequires: net-tools BuildRequires: pcre-devel, glibc-static Provides: go = %{version}-%{release} -Requires: %{name}-bin +Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-src = %{version}-%{release} Requires: go-srpm-macros @@ -122,10 +116,6 @@ Patch0: golang-1.2-verbose-build.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Patch1: golang-1.2-remove-ECC-p224.patch -# Accept x509 certs with negative serial -# https://bugzilla.redhat.com/show_bug.cgi?id=1290543 -# https://github.com/golang/go/issues/8265 -Patch2: bz1290543.patch # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch @@ -134,17 +124,10 @@ Patch212: golang-1.5-bootstrap-binary-path.patch # https://github.com/golang/go/issues/11214 Patch213: go1.5beta1-disable-TestGdbPython.patch -# disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups -# 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 -# https://bugzilla.redhat.com/show_bug.cgi?id=1271709 -Patch216: ./golang-1.5.1-a3156aaa12.patch - # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -156,7 +139,7 @@ Obsoletes: %{name}-vim < 1.4 Obsoletes: emacs-%{name} < 1.4 # These are the only RHEL/Fedora architectures that we compile this package for -ExclusiveArch: %{golang_arches} +ExclusiveArch: %{golang_arches} %{power64} Source100: golang-gdbinit Source101: golang-prelink.conf @@ -260,23 +243,14 @@ Summary: Golang shared object libraries # remove the P224 curve %patch1 -p1 -%patch2 -p1 - # use the arch dependent path in the bootstrap %patch212 -p1 # disable TestGdbPython %patch213 -p1 -# disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups -%patch214 -p1 - %patch215 -p1 -%patch216 -p1 - -cp %{SOURCE1} "$(pwd)/src/compress/bzip2/testdata/Mark.Twain-Tom.Sawyer.txt.bz2" - %build # print out system information uname -a @@ -346,37 +320,37 @@ tests_list=$cwd/go-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 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 -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 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 + 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 misc/ -type d -printf '%%%dir %{goroot}/%p\n' >> $misc_list + find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list %if %{shared} - find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list - find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list + 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 - 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 + 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 + find lib/ -type d -printf '%%%dir %{goroot}/%p\n' >> $tests_list + find lib/ ! -type d -printf '%{goroot}/%p\n' >> $tests_list popd # remove the doc Makefile 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} +# leave the arch independent pieces in {goroot} mkdir -p $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch} 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 @@ -416,6 +390,10 @@ export GO_LDFLAGS="-linkmode internal" %if !%{cgo_enabled} || !%{external_linker} export CGO_ENABLED=0 %endif + +# make sure to not timeout +export GO_TEST_TIMEOUT_SCALE=2 + %if %{fail_on_tests} ./run.bash --no-rebuild -v -v -v -k %else @@ -426,12 +404,12 @@ cd .. %post bin %{_sbindir}/update-alternatives --install %{_bindir}/go \ - go %{goroot}/bin/go 90 \ - --slave %{_bindir}/gofmt gofmt %{goroot}/bin/gofmt + go %{goroot}/bin/go 90 \ + --slave %{_bindir}/gofmt gofmt %{goroot}/bin/gofmt %preun bin if [ $1 = 0 ]; then - %{_sbindir}/update-alternatives --remove go %{goroot}/bin/go + %{_sbindir}/update-alternatives --remove go %{goroot}/bin/go fi @@ -485,6 +463,11 @@ fi %endif %changelog +* Thu Jan 28 2016 Jakub Čajka - 1.6-0.1.rc1 +- Resolves bz1292640, rebase to pre-release 1.6 +- bootstrap for PowerPC +- fix rpmlint errors/warning + * Thu Jan 14 2016 Jakub Čajka - 1.5.3-1 - rebase to 1.5.3 - resolves bz1293451, CVE-2015-8618 @@ -709,7 +692,7 @@ fi - include sub-packages for compiler toolchains, for all golang supported architectures * Wed Mar 26 2014 Vincent Batts 1.2.1-2 -- provide a system rpm macros. Starting with %gopath +- provide a system rpm macros. Starting with gopath * Tue Mar 04 2014 Adam Miller 1.2.1-1 - Update to latest upstream diff --git a/source.sh b/source.sh deleted file mode 100755 index 9a7f61a..0000000 --- a/source.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/bash -tar -xzf $1 -cat ./go/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt |tail -n +25 | head -n 8465 > ./go/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt.new -mv ./go/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt.new ./go/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt -rm -f ./go/src/compress/bzip2/testdata/Mark.Twain-Tom.Sawyer.txt.bz2 -rm $1 -tar -czf $1 ./go -rm -rf ./go diff --git a/sources b/sources index d1149f9..9529433 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -5c07bee28b57345e67c4dfa4074b83e8 go1.5.3.src.tar.gz -95da7ca97a8b8f5955fb7eb329784489 Mark.Twain-Tom.Sawyer.txt.bz2 +fa18b0a0036159902f8178513bbc6022 go1.6rc1.src.tar.gz From f031dfde9c840c741449c27fb81e6a3a1f55dbbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 29 Jan 2016 12:23:29 +0100 Subject: [PATCH 079/156] disabled cgo and external linking on ppc64 --- golang.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/golang.spec b/golang.spec index 29a0d61..9b173c0 100644 --- a/golang.spec +++ b/golang.spec @@ -25,14 +25,14 @@ # Golang build options. # Build golang using external/internal(close to cgo disabled) linking. -%ifarch %{golang_arches} %{power64} +%ifarch %{ix86} x86_64 ppc64le %{arm} aarch64 %global external_linker 1 %else %global external_linker 0 %endif # Build golang with cgo enabled/disabled(later equals more or less to internal linking). -%ifarch %{golang_arches} %{power64} +%ifarch %{ix86} x86_64 ppc64le %{arm} aarch64 %global cgo_enabled 1 %else %global cgo_enabled 0 @@ -46,7 +46,7 @@ %endif # Controls what ever we fail on failed tests -%ifarch %{golang_arches} %{power64} +%ifarch %{golang_arches} %global fail_on_tests 1 %else %global fail_on_tests 0 @@ -86,7 +86,7 @@ Name: golang Version: 1.6 -Release: 0.1.rc1%{?dist} +Release: 0.2.rc1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -139,7 +139,7 @@ Obsoletes: %{name}-vim < 1.4 Obsoletes: emacs-%{name} < 1.4 # These are the only RHEL/Fedora architectures that we compile this package for -ExclusiveArch: %{golang_arches} %{power64} +ExclusiveArch: %{golang_arches} Source100: golang-gdbinit Source101: golang-prelink.conf @@ -463,6 +463,9 @@ fi %endif %changelog +* Fri Jan 29 2016 Jakub Čajka - 1.6-0.2.rc1 +- disabled cgo and external linking on ppc64 + * Thu Jan 28 2016 Jakub Čajka - 1.6-0.1.rc1 - Resolves bz1292640, rebase to pre-release 1.6 - bootstrap for PowerPC From 30a817d62b9f957e1bad0d7b4464db6ba7f5f825 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 3 Feb 2016 22:43:43 +0000 Subject: [PATCH 080/156] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 9b173c0..fb6ad1d 100644 --- a/golang.spec +++ b/golang.spec @@ -86,7 +86,7 @@ Name: golang Version: 1.6 -Release: 0.2.rc1%{?dist} +Release: 0.3.rc1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -463,6 +463,9 @@ fi %endif %changelog +* Wed Feb 03 2016 Fedora Release Engineering - 1.6-0.3.rc1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Fri Jan 29 2016 Jakub Čajka - 1.6-0.2.rc1 - disabled cgo and external linking on ppc64 From 263126ff1b1a04f81d5c145d4ad1c335d2e634d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 22 Feb 2016 16:02:43 +0100 Subject: [PATCH 081/156] Resolves: bz1304701 - rebase to go1.6 release Resolves: bz1304591 - fix possible stack miss-alignment in callCgoMmap --- .gitignore | 1 + golang.spec | 14 +++++++++++-- mmap-cgo-stackalign.patch | 43 +++++++++++++++++++++++++++++++++++++++ sources | 2 +- 4 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 mmap-cgo-stackalign.patch diff --git a/.gitignore b/.gitignore index 5b86319..6672c7e 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ /Mark.Twain-Tom.Sawyer.txt.bz2 /go1.5.3.src.tar.gz /go1.6rc1.src.tar.gz +/go1.6.src.tar.gz diff --git a/golang.spec b/golang.spec index fb6ad1d..99b955a 100644 --- a/golang.spec +++ b/golang.spec @@ -86,12 +86,12 @@ Name: golang Version: 1.6 -Release: 0.3.rc1%{?dist} +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain URL: http://golang.org/ -Source0: https://storage.googleapis.com/golang/go1.6rc1.src.tar.gz +Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz # The compiler is written in Go. Needs go(1.4+) compiler for build. %if !%{golang_bootstrap} @@ -117,6 +117,10 @@ Patch0: golang-1.2-verbose-build.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Patch1: golang-1.2-remove-ECC-p224.patch +# Resolves RHBZ 1304591 +# https://github.com/golang/go/issues/14384 +Patch100: mmap-cgo-stackalign.patch + # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch @@ -243,6 +247,8 @@ Summary: Golang shared object libraries # remove the P224 curve %patch1 -p1 +%patch100 -p1 + # use the arch dependent path in the bootstrap %patch212 -p1 @@ -463,6 +469,10 @@ fi %endif %changelog +* Mon Feb 22 2016 Jakub Čajka - 1.6-1 +- Resolves: bz1304701 - rebase to go1.6 release +- Resolves: bz1304591 - fix possible stack miss-alignment in callCgoMmap + * Wed Feb 03 2016 Fedora Release Engineering - 1.6-0.3.rc1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/mmap-cgo-stackalign.patch b/mmap-cgo-stackalign.patch new file mode 100644 index 0000000..78e276f --- /dev/null +++ b/mmap-cgo-stackalign.patch @@ -0,0 +1,43 @@ +From 315f4c70f123cfbf061d097543af555547acd9c7 Mon Sep 17 00:00:00 2001 +From: Shenghou Ma +Date: Thu, 18 Feb 2016 16:29:39 -0500 +Subject: [PATCH] runtime: use correct psABI SP alignment before calling libc + mmap + +Fixes #14384. + +Change-Id: Ib025cf2d20754b4c2db52f0a8a4717fd303371d6 +Reviewed-on: https://go-review.googlesource.com/19660 +Run-TryBot: Minux Ma +TryBot-Result: Gobot Gobot +Reviewed-by: Ian Lance Taylor +Reviewed-by: Austin Clements +--- + src/runtime/sys_linux_amd64.s | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s +index aed85cb..f407078 100644 +--- a/src/runtime/sys_linux_amd64.s ++++ b/src/runtime/sys_linux_amd64.s +@@ -258,7 +258,7 @@ TEXT runtime·sysMmap(SB),NOSPLIT,$0 + + // Call the function stored in _cgo_mmap using the GCC calling convention. + // This must be called on the system stack. +-TEXT runtime·callCgoMmap(SB),NOSPLIT,$0 ++TEXT runtime·callCgoMmap(SB),NOSPLIT,$16 + MOVQ addr+0(FP), DI + MOVQ n+8(FP), SI + MOVL prot+16(FP), DX +@@ -266,7 +266,11 @@ TEXT runtime·callCgoMmap(SB),NOSPLIT,$0 + MOVL fd+24(FP), R8 + MOVL off+28(FP), R9 + MOVQ _cgo_mmap(SB), AX ++ MOVQ SP, BX ++ ANDQ $~15, SP // alignment as per amd64 psABI ++ MOVQ BX, 0(SP) + CALL AX ++ MOVQ 0(SP), SP + MOVQ AX, ret+32(FP) + RET + diff --git a/sources b/sources index 9529433..b55b080 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -fa18b0a0036159902f8178513bbc6022 go1.6rc1.src.tar.gz +e67833ea37fbc002fbe38efe6c1bcd98 go1.6.src.tar.gz From b2c2028475cceff431aa5f3bbd4ff1214bc8ff0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 13 Apr 2016 14:44:04 +0200 Subject: [PATCH 082/156] rebase to 1.6.1 Resolves: bz1324344 - CVE-2016-3959 Resolves: bz1324951 - prelink is gone, /etc/prelink.conf.d/* is no longer used Resolves: bz1326366 - wrong epoll_event struct for ppc64le/ppc64 --- .gitignore | 1 + golang-1.6-epoll-power64.patch | 206 +++++++++++++++++++++++++++++++++ golang-prelink.conf | 3 - golang.spec | 24 ++-- sources | 2 +- 5 files changed, 221 insertions(+), 15 deletions(-) create mode 100644 golang-1.6-epoll-power64.patch delete mode 100644 golang-prelink.conf diff --git a/.gitignore b/.gitignore index 6672c7e..59f2e85 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ /go1.5.3.src.tar.gz /go1.6rc1.src.tar.gz /go1.6.src.tar.gz +/go1.6.1.src.tar.gz diff --git a/golang-1.6-epoll-power64.patch b/golang-1.6-epoll-power64.patch new file mode 100644 index 0000000..fdf9bc8 --- /dev/null +++ b/golang-1.6-epoll-power64.patch @@ -0,0 +1,206 @@ +diff -up go/src/syscall/types_linux.go.than go/src/syscall/types_linux.go +--- go/src/syscall/types_linux.go.than 2016-04-12 09:49:46.699333091 -0400 ++++ go/src/syscall/types_linux.go 2016-04-12 09:50:18.859856525 -0400 +@@ -105,6 +105,9 @@ struct my_epoll_event { + // alignment requirements of EABI + int32_t padFd; + #endif ++#ifdef __powerpc64__ ++ int32_t _padFd; ++#endif + int32_t fd; + int32_t pad; + }; +diff -up go/src/syscall/ztypes_linux_ppc64.go.than go/src/syscall/ztypes_linux_ppc64.go +--- go/src/syscall/ztypes_linux_ppc64.go.than 2016-04-12 09:50:27.499997298 -0400 ++++ go/src/syscall/ztypes_linux_ppc64.go 2016-04-12 09:54:27.593909191 -0400 +@@ -113,9 +113,9 @@ type Stat_t struct { + Atim Timespec + Mtim Timespec + Ctim Timespec +- X__unused4 uint64 +- X__unused5 uint64 +- X__unused6 uint64 ++ _ uint64 ++ _ uint64 ++ _ uint64 + } + + type Statfs_t struct { +@@ -143,7 +143,7 @@ type Dirent struct { + } + + type Fsid struct { +- X__val [2]int32 ++ _ [2]int32 + } + + type Flock_t struct { +@@ -247,7 +247,6 @@ type Cmsghdr struct { + Len uint64 + Level int32 + Type int32 +- X__cmsg_data [0]uint8 + } + + type Inet4Pktinfo struct { +@@ -361,7 +360,7 @@ const ( + IFLA_LINKINFO = 0x12 + IFLA_NET_NS_PID = 0x13 + IFLA_IFALIAS = 0x14 +- IFLA_MAX = 0x22 ++ IFLA_MAX = 0x25 + RT_SCOPE_UNIVERSE = 0x0 + RT_SCOPE_SITE = 0xc8 + RT_SCOPE_LINK = 0xfd +@@ -454,7 +453,7 @@ type RtAttr struct { + + type IfInfomsg struct { + Family uint8 +- X__ifi_pad uint8 ++ _ uint8 + Type uint16 + Index int32 + Flags uint32 +@@ -511,7 +510,6 @@ type InotifyEvent struct { + Mask uint32 + Cookie uint32 + Len uint32 +- Name [0]uint8 + } + + const SizeofInotifyEvent = 0x10 +@@ -532,6 +530,15 @@ type PtraceRegs struct { + Result uint64 + } + ++type ptracePsw struct { ++} ++ ++type ptraceFpregs struct { ++} ++ ++type ptracePer struct { ++} ++ + type FdSet struct { + Bits [16]int64 + } +@@ -551,7 +558,7 @@ type Sysinfo_t struct { + Totalhigh uint64 + Freehigh uint64 + Unit uint32 +- X_f [0]uint8 ++ _ [0]uint8 + Pad_cgo_1 [4]byte + } + +@@ -575,6 +582,7 @@ type Ustat_t struct { + + type EpollEvent struct { + Events uint32 ++ _ int32 + Fd int32 + Pad int32 + } +diff -up go/src/syscall/ztypes_linux_ppc64le.go.than go/src/syscall/ztypes_linux_ppc64le.go +--- go/src/syscall/ztypes_linux_ppc64le.go.than 2016-04-12 09:54:37.134064629 -0400 ++++ go/src/syscall/ztypes_linux_ppc64le.go 2016-04-12 09:58:11.097550772 -0400 +@@ -105,7 +105,7 @@ type Stat_t struct { + Mode uint32 + Uid uint32 + Gid uint32 +- X__pad2 int32 ++ _ int32 + Rdev uint64 + Size int64 + Blksize int64 +@@ -113,9 +113,9 @@ type Stat_t struct { + Atim Timespec + Mtim Timespec + Ctim Timespec +- X__glibc_reserved4 uint64 +- X__glibc_reserved5 uint64 +- X__glibc_reserved6 uint64 ++ _ uint64 ++ _ uint64 ++ _ uint64 + } + + type Statfs_t struct { +@@ -143,7 +143,7 @@ type Dirent struct { + } + + type Fsid struct { +- X__val [2]int32 ++ _ [2]int32 + } + + type Flock_t struct { +@@ -247,7 +247,6 @@ type Cmsghdr struct { + Len uint64 + Level int32 + Type int32 +- X__cmsg_data [0]uint8 + } + + type Inet4Pktinfo struct { +@@ -361,7 +360,7 @@ const ( + IFLA_LINKINFO = 0x12 + IFLA_NET_NS_PID = 0x13 + IFLA_IFALIAS = 0x14 +- IFLA_MAX = 0x22 ++ IFLA_MAX = 0x23 + RT_SCOPE_UNIVERSE = 0x0 + RT_SCOPE_SITE = 0xc8 + RT_SCOPE_LINK = 0xfd +@@ -454,7 +453,7 @@ type RtAttr struct { + + type IfInfomsg struct { + Family uint8 +- X__ifi_pad uint8 ++ _ uint8 + Type uint16 + Index int32 + Flags uint32 +@@ -511,7 +510,6 @@ type InotifyEvent struct { + Mask uint32 + Cookie uint32 + Len uint32 +- Name [0]uint8 + } + + const SizeofInotifyEvent = 0x10 +@@ -532,6 +530,15 @@ type PtraceRegs struct { + Result uint64 + } + ++type ptracePsw struct { ++} ++ ++type ptraceFpregs struct { ++} ++ ++type ptracePer struct { ++} ++ + type FdSet struct { + Bits [16]int64 + } +@@ -551,7 +558,7 @@ type Sysinfo_t struct { + Totalhigh uint64 + Freehigh uint64 + Unit uint32 +- X_f [0]uint8 ++ _ [0]uint8 + Pad_cgo_1 [4]byte + } + +@@ -575,6 +582,7 @@ type Ustat_t struct { + + type EpollEvent struct { + Events uint32 ++ _ int32 + Fd int32 + Pad int32 + } diff --git a/golang-prelink.conf b/golang-prelink.conf deleted file mode 100644 index 471e8e6..0000000 --- a/golang-prelink.conf +++ /dev/null @@ -1,3 +0,0 @@ -# there are ELF files in src which are testdata and shouldn't be modified --b /usr/lib/golang/src --b /usr/lib64/golang/src diff --git a/golang.spec b/golang.spec index 99b955a..c45e69d 100644 --- a/golang.spec +++ b/golang.spec @@ -82,10 +82,10 @@ %endif %global go_api 1.6 -%global go_version 1.6 +%global go_version 1.6.1 Name: golang -Version: 1.6 +Version: 1.6.1 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -121,6 +121,10 @@ Patch1: golang-1.2-remove-ECC-p224.patch # https://github.com/golang/go/issues/14384 Patch100: mmap-cgo-stackalign.patch +# Resolves RHBZ 1326366 +# https://github.com/golang/go/issues/15135 +Patch101: golang-1.6-epoll-power64.patch + # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch @@ -146,7 +150,6 @@ Obsoletes: emacs-%{name} < 1.4 ExclusiveArch: %{golang_arches} Source100: golang-gdbinit -Source101: golang-prelink.conf %description %{summary}. @@ -248,6 +251,7 @@ Summary: Golang shared object libraries %patch1 -p1 %patch100 -p1 +%patch101 -p1 -b .epoll # use the arch dependent path in the bootstrap %patch212 -p1 @@ -377,11 +381,6 @@ ln -sf /etc/alternatives/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang.gdb -# prelink blacklist -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d -cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf - - %check export GOROOT=$(pwd -P) export PATH="$GOROOT"/bin:"$PATH" @@ -449,9 +448,6 @@ fi # gdbinit (for gdb debugging) %{_sysconfdir}/gdbinit.d -# prelink blacklist -%{_sysconfdir}/prelink.conf.d - %files -f go-src.list src %files -f go-docs.list docs @@ -469,6 +465,12 @@ fi %endif %changelog +* Wed Apr 13 2016 Jakub Čajka - 1.6.1-1 +- rebase to 1.6.1 +- Resolves: bz1324344 - CVE-2016-3959 +- Resolves: bz1324951 - prelink is gone, /etc/prelink.conf.d/* is no longer used +- Resolves: bz1326366 - wrong epoll_event struct for ppc64le/ppc64 + * Mon Feb 22 2016 Jakub Čajka - 1.6-1 - Resolves: bz1304701 - rebase to go1.6 release - Resolves: bz1304591 - fix possible stack miss-alignment in callCgoMmap diff --git a/sources b/sources index b55b080..a8c62a7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e67833ea37fbc002fbe38efe6c1bcd98 go1.6.src.tar.gz +29e1b0369825a56d79f6bd4eb29b0864 go1.6.1.src.tar.gz From 04b972ebf4d5fa702950210f171c9a7a7ced6328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Tue, 26 Apr 2016 17:36:25 +0200 Subject: [PATCH 083/156] Rebase to 1.6.2 --- .gitignore | 1 + golang-1.6-epoll-power64.patch | 206 --------------------------------- golang.spec | 19 +-- mmap-cgo-stackalign.patch | 43 ------- sources | 2 +- 5 files changed, 8 insertions(+), 263 deletions(-) delete mode 100644 golang-1.6-epoll-power64.patch delete mode 100644 mmap-cgo-stackalign.patch diff --git a/.gitignore b/.gitignore index 59f2e85..0d5a242 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ /go1.6rc1.src.tar.gz /go1.6.src.tar.gz /go1.6.1.src.tar.gz +/go1.6.2.src.tar.gz diff --git a/golang-1.6-epoll-power64.patch b/golang-1.6-epoll-power64.patch deleted file mode 100644 index fdf9bc8..0000000 --- a/golang-1.6-epoll-power64.patch +++ /dev/null @@ -1,206 +0,0 @@ -diff -up go/src/syscall/types_linux.go.than go/src/syscall/types_linux.go ---- go/src/syscall/types_linux.go.than 2016-04-12 09:49:46.699333091 -0400 -+++ go/src/syscall/types_linux.go 2016-04-12 09:50:18.859856525 -0400 -@@ -105,6 +105,9 @@ struct my_epoll_event { - // alignment requirements of EABI - int32_t padFd; - #endif -+#ifdef __powerpc64__ -+ int32_t _padFd; -+#endif - int32_t fd; - int32_t pad; - }; -diff -up go/src/syscall/ztypes_linux_ppc64.go.than go/src/syscall/ztypes_linux_ppc64.go ---- go/src/syscall/ztypes_linux_ppc64.go.than 2016-04-12 09:50:27.499997298 -0400 -+++ go/src/syscall/ztypes_linux_ppc64.go 2016-04-12 09:54:27.593909191 -0400 -@@ -113,9 +113,9 @@ type Stat_t struct { - Atim Timespec - Mtim Timespec - Ctim Timespec -- X__unused4 uint64 -- X__unused5 uint64 -- X__unused6 uint64 -+ _ uint64 -+ _ uint64 -+ _ uint64 - } - - type Statfs_t struct { -@@ -143,7 +143,7 @@ type Dirent struct { - } - - type Fsid struct { -- X__val [2]int32 -+ _ [2]int32 - } - - type Flock_t struct { -@@ -247,7 +247,6 @@ type Cmsghdr struct { - Len uint64 - Level int32 - Type int32 -- X__cmsg_data [0]uint8 - } - - type Inet4Pktinfo struct { -@@ -361,7 +360,7 @@ const ( - IFLA_LINKINFO = 0x12 - IFLA_NET_NS_PID = 0x13 - IFLA_IFALIAS = 0x14 -- IFLA_MAX = 0x22 -+ IFLA_MAX = 0x25 - RT_SCOPE_UNIVERSE = 0x0 - RT_SCOPE_SITE = 0xc8 - RT_SCOPE_LINK = 0xfd -@@ -454,7 +453,7 @@ type RtAttr struct { - - type IfInfomsg struct { - Family uint8 -- X__ifi_pad uint8 -+ _ uint8 - Type uint16 - Index int32 - Flags uint32 -@@ -511,7 +510,6 @@ type InotifyEvent struct { - Mask uint32 - Cookie uint32 - Len uint32 -- Name [0]uint8 - } - - const SizeofInotifyEvent = 0x10 -@@ -532,6 +530,15 @@ type PtraceRegs struct { - Result uint64 - } - -+type ptracePsw struct { -+} -+ -+type ptraceFpregs struct { -+} -+ -+type ptracePer struct { -+} -+ - type FdSet struct { - Bits [16]int64 - } -@@ -551,7 +558,7 @@ type Sysinfo_t struct { - Totalhigh uint64 - Freehigh uint64 - Unit uint32 -- X_f [0]uint8 -+ _ [0]uint8 - Pad_cgo_1 [4]byte - } - -@@ -575,6 +582,7 @@ type Ustat_t struct { - - type EpollEvent struct { - Events uint32 -+ _ int32 - Fd int32 - Pad int32 - } -diff -up go/src/syscall/ztypes_linux_ppc64le.go.than go/src/syscall/ztypes_linux_ppc64le.go ---- go/src/syscall/ztypes_linux_ppc64le.go.than 2016-04-12 09:54:37.134064629 -0400 -+++ go/src/syscall/ztypes_linux_ppc64le.go 2016-04-12 09:58:11.097550772 -0400 -@@ -105,7 +105,7 @@ type Stat_t struct { - Mode uint32 - Uid uint32 - Gid uint32 -- X__pad2 int32 -+ _ int32 - Rdev uint64 - Size int64 - Blksize int64 -@@ -113,9 +113,9 @@ type Stat_t struct { - Atim Timespec - Mtim Timespec - Ctim Timespec -- X__glibc_reserved4 uint64 -- X__glibc_reserved5 uint64 -- X__glibc_reserved6 uint64 -+ _ uint64 -+ _ uint64 -+ _ uint64 - } - - type Statfs_t struct { -@@ -143,7 +143,7 @@ type Dirent struct { - } - - type Fsid struct { -- X__val [2]int32 -+ _ [2]int32 - } - - type Flock_t struct { -@@ -247,7 +247,6 @@ type Cmsghdr struct { - Len uint64 - Level int32 - Type int32 -- X__cmsg_data [0]uint8 - } - - type Inet4Pktinfo struct { -@@ -361,7 +360,7 @@ const ( - IFLA_LINKINFO = 0x12 - IFLA_NET_NS_PID = 0x13 - IFLA_IFALIAS = 0x14 -- IFLA_MAX = 0x22 -+ IFLA_MAX = 0x23 - RT_SCOPE_UNIVERSE = 0x0 - RT_SCOPE_SITE = 0xc8 - RT_SCOPE_LINK = 0xfd -@@ -454,7 +453,7 @@ type RtAttr struct { - - type IfInfomsg struct { - Family uint8 -- X__ifi_pad uint8 -+ _ uint8 - Type uint16 - Index int32 - Flags uint32 -@@ -511,7 +510,6 @@ type InotifyEvent struct { - Mask uint32 - Cookie uint32 - Len uint32 -- Name [0]uint8 - } - - const SizeofInotifyEvent = 0x10 -@@ -532,6 +530,15 @@ type PtraceRegs struct { - Result uint64 - } - -+type ptracePsw struct { -+} -+ -+type ptraceFpregs struct { -+} -+ -+type ptracePer struct { -+} -+ - type FdSet struct { - Bits [16]int64 - } -@@ -551,7 +558,7 @@ type Sysinfo_t struct { - Totalhigh uint64 - Freehigh uint64 - Unit uint32 -- X_f [0]uint8 -+ _ [0]uint8 - Pad_cgo_1 [4]byte - } - -@@ -575,6 +582,7 @@ type Ustat_t struct { - - type EpollEvent struct { - Events uint32 -+ _ int32 - Fd int32 - Pad int32 - } diff --git a/golang.spec b/golang.spec index c45e69d..c9ac2ff 100644 --- a/golang.spec +++ b/golang.spec @@ -82,10 +82,10 @@ %endif %global go_api 1.6 -%global go_version 1.6.1 +%global go_version 1.6.2 Name: golang -Version: 1.6.1 +Version: 1.6.2 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -117,14 +117,6 @@ Patch0: golang-1.2-verbose-build.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Patch1: golang-1.2-remove-ECC-p224.patch -# Resolves RHBZ 1304591 -# https://github.com/golang/go/issues/14384 -Patch100: mmap-cgo-stackalign.patch - -# Resolves RHBZ 1326366 -# https://github.com/golang/go/issues/15135 -Patch101: golang-1.6-epoll-power64.patch - # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch @@ -250,9 +242,6 @@ Summary: Golang shared object libraries # remove the P224 curve %patch1 -p1 -%patch100 -p1 -%patch101 -p1 -b .epoll - # use the arch dependent path in the bootstrap %patch212 -p1 @@ -465,6 +454,10 @@ fi %endif %changelog +* Tue Apr 26 2016 Jakub Čajka - 1.6.2-1 +- rebase to 1.6.2 +- Resolves: bz1329206 - golang-1.6.2.src is available + * Wed Apr 13 2016 Jakub Čajka - 1.6.1-1 - rebase to 1.6.1 - Resolves: bz1324344 - CVE-2016-3959 diff --git a/mmap-cgo-stackalign.patch b/mmap-cgo-stackalign.patch deleted file mode 100644 index 78e276f..0000000 --- a/mmap-cgo-stackalign.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 315f4c70f123cfbf061d097543af555547acd9c7 Mon Sep 17 00:00:00 2001 -From: Shenghou Ma -Date: Thu, 18 Feb 2016 16:29:39 -0500 -Subject: [PATCH] runtime: use correct psABI SP alignment before calling libc - mmap - -Fixes #14384. - -Change-Id: Ib025cf2d20754b4c2db52f0a8a4717fd303371d6 -Reviewed-on: https://go-review.googlesource.com/19660 -Run-TryBot: Minux Ma -TryBot-Result: Gobot Gobot -Reviewed-by: Ian Lance Taylor -Reviewed-by: Austin Clements ---- - src/runtime/sys_linux_amd64.s | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s -index aed85cb..f407078 100644 ---- a/src/runtime/sys_linux_amd64.s -+++ b/src/runtime/sys_linux_amd64.s -@@ -258,7 +258,7 @@ TEXT runtime·sysMmap(SB),NOSPLIT,$0 - - // Call the function stored in _cgo_mmap using the GCC calling convention. - // This must be called on the system stack. --TEXT runtime·callCgoMmap(SB),NOSPLIT,$0 -+TEXT runtime·callCgoMmap(SB),NOSPLIT,$16 - MOVQ addr+0(FP), DI - MOVQ n+8(FP), SI - MOVL prot+16(FP), DX -@@ -266,7 +266,11 @@ TEXT runtime·callCgoMmap(SB),NOSPLIT,$0 - MOVL fd+24(FP), R8 - MOVL off+28(FP), R9 - MOVQ _cgo_mmap(SB), AX -+ MOVQ SP, BX -+ ANDQ $~15, SP // alignment as per amd64 psABI -+ MOVQ BX, 0(SP) - CALL AX -+ MOVQ 0(SP), SP - MOVQ AX, ret+32(FP) - RET - diff --git a/sources b/sources index a8c62a7..a6c0083 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -29e1b0369825a56d79f6bd4eb29b0864 go1.6.1.src.tar.gz +d1b50fa98d9a71eeee829051411e6207 go1.6.2.src.tar.gz From d36359a723b2b53c2dce6c578bba00f2a466fa58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Tue, 19 Jul 2016 14:15:19 +0200 Subject: [PATCH 084/156] rebase to 1.7rc2 added s390x build improved shared lib packaging Resolves: bz1357602 - CVE-2016-5386 Resolves: bz1342090, bz1342090 --- .gitignore | 1 + go1.5beta1-disable-TestGdbPython.patch | 15 ++++--- golang-1.2-remove-ECC-p224.patch | 54 +++++++++++++------------- golang-1.5-bootstrap-binary-path.patch | 39 ++++++++++++------- golang.spec | 54 +++++++++++++++++++------- sources | 2 +- 6 files changed, 101 insertions(+), 64 deletions(-) diff --git a/.gitignore b/.gitignore index 0d5a242..1a16e43 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ /go1.6.src.tar.gz /go1.6.1.src.tar.gz /go1.6.2.src.tar.gz +/go1.7rc2.src.tar.gz diff --git a/go1.5beta1-disable-TestGdbPython.patch b/go1.5beta1-disable-TestGdbPython.patch index 8e0491f..89d7d68 100644 --- a/go1.5beta1-disable-TestGdbPython.patch +++ b/go1.5beta1-disable-TestGdbPython.patch @@ -1,13 +1,12 @@ -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() { +diff -up go/src/runtime/runtime-gdb_test.go.gdb go/src/runtime/runtime-gdb_test.go +--- go/src/runtime/runtime-gdb_test.go.gdb 2016-04-28 10:31:13.005689813 +0200 ++++ go/src/runtime/runtime-gdb_test.go 2016-04-28 10:32:12.202935125 +0200 +@@ -72,7 +72,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") - } + checkGdbEnvironment(t) + checkGdbVersion(t) + checkGdbPython(t) diff --git a/golang-1.2-remove-ECC-p224.patch b/golang-1.2-remove-ECC-p224.patch index 85abbb3..2b2d1a1 100644 --- a/golang-1.2-remove-ECC-p224.patch +++ b/golang-1.2-remove-ECC-p224.patch @@ -1,9 +1,3 @@ -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 @@ -17,7 +11,7 @@ index 5e3dea5..1a1ee83 100644 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 +index fc25fd7..356e617 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) { @@ -33,7 +27,7 @@ index 169944d..c653464 100644 testKeyGeneration(t, elliptic.P384(), "p384") testKeyGeneration(t, elliptic.P521(), "p521") } -@@ -63,11 +62,10 @@ func testSignAndVerify(t *testing.T, c elliptic.Curve, tag string) { +@@ -98,11 +97,10 @@ func testSignAndVerify(t *testing.T, c elliptic.Curve, tag string) { } func TestSignAndVerify(t *testing.T) { @@ -46,7 +40,7 @@ index 169944d..c653464 100644 testSignAndVerify(t, elliptic.P384(), "p384") testSignAndVerify(t, elliptic.P521(), "p521") } -@@ -100,11 +98,10 @@ func testNonceSafety(t *testing.T, c elliptic.Curve, tag string) { +@@ -135,11 +133,10 @@ func testNonceSafety(t *testing.T, c elliptic.Curve, tag string) { } func TestNonceSafety(t *testing.T) { @@ -59,7 +53,7 @@ index 169944d..c653464 100644 testNonceSafety(t, elliptic.P384(), "p384") testNonceSafety(t, elliptic.P521(), "p521") } -@@ -135,11 +132,10 @@ func testINDCCA(t *testing.T, c elliptic.Curve, tag string) { +@@ -170,11 +167,10 @@ func testINDCCA(t *testing.T, c elliptic.Curve, tag string) { } func TestINDCCA(t *testing.T) { @@ -72,7 +66,7 @@ index 169944d..c653464 100644 testINDCCA(t, elliptic.P384(), "p384") testINDCCA(t, elliptic.P521(), "p521") } -@@ -201,8 +197,6 @@ func TestVectors(t *testing.T) { +@@ -236,8 +232,6 @@ func TestVectors(t *testing.T) { parts := strings.SplitN(line, ",", 2) switch parts[0] { @@ -81,6 +75,14 @@ index 169944d..c653464 100644 case "P-256": pub.Curve = elliptic.P256() case "P-384": +@@ -314,7 +308,6 @@ func testNegativeInputs(t *testing.T, curve elliptic.Curve, tag string) { + } + + func TestNegativeInputs(t *testing.T) { +- testNegativeInputs(t, elliptic.P224(), "p224") + testNegativeInputs(t, elliptic.P256(), "p256") + testNegativeInputs(t, elliptic.P384(), "p384") + testNegativeInputs(t, elliptic.P521(), "p521") diff --git a/src/crypto/elliptic/bottombits.go b/src/crypto/elliptic/bottombits.go new file mode 100644 index 0000000..4544722 @@ -92,10 +94,10 @@ index 0000000..4544722 +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 +index c02df45..f713ad7 100644 --- a/src/crypto/elliptic/elliptic.go +++ b/src/crypto/elliptic/elliptic.go -@@ -331,7 +331,6 @@ var p384 *CurveParams +@@ -338,7 +338,6 @@ var p384 *CurveParams var p521 *CurveParams func initAll() { @@ -104,7 +106,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..e0034fc 100644 +index 7f3f1a2..833668e 100644 --- a/src/crypto/elliptic/elliptic_test.go +++ b/src/crypto/elliptic/elliptic_test.go @@ -6,27 +6,25 @@ package elliptic @@ -240,7 +242,7 @@ index 7e27913..e0034fc 100644 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) { +@@ -454,14 +405,14 @@ func BenchmarkScalarMultP256(b *testing.B) { } func TestMarshal(t *testing.T) { @@ -259,7 +261,7 @@ index 7e27913..e0034fc 100644 if xx == nil { t.Error("failed to unmarshal") return -@@ -459,13 +410,3 @@ func TestMarshal(t *testing.T) { +@@ -471,13 +422,3 @@ func TestMarshal(t *testing.T) { return } } @@ -275,11 +277,11 @@ index 7e27913..e0034fc 100644 -} diff --git a/src/crypto/elliptic/p224.go b/src/crypto/elliptic/p224.go deleted file mode 100644 -index 2d3fac7..0000000 +index de266ca..0000000 --- a/src/crypto/elliptic/p224.go +++ /dev/null @@ -1,765 +0,0 @@ --// Copyright 2012 The Go Authors. All rights reserved. +-// 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. - @@ -1046,11 +1048,11 @@ index 2d3fac7..0000000 -} diff --git a/src/crypto/elliptic/p224_test.go b/src/crypto/elliptic/p224_test.go deleted file mode 100644 -index 4b26d16..0000000 +index 8b4fa04..0000000 --- a/src/crypto/elliptic/p224_test.go +++ /dev/null @@ -1,47 +0,0 @@ --// Copyright 2012 The Go Authors. All rights reserved. +-// 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. - @@ -1120,10 +1122,10 @@ 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..428053a 100644 +index 9e6d67d..580831e 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go -@@ -308,9 +308,6 @@ func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm +@@ -340,9 +340,6 @@ func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm // RFC 5480, 2.1.1.1. Named Curve // @@ -1133,7 +1135,7 @@ index be6c013..428053a 100644 // 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 +@@ -355,7 +352,6 @@ func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm // // NB: secp256r1 is equivalent to prime256v1 var ( @@ -1141,7 +1143,7 @@ index be6c013..428053a 100644 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 ( +@@ -363,8 +359,6 @@ var ( func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { switch { @@ -1150,7 +1152,7 @@ index be6c013..428053a 100644 case oid.Equal(oidNamedCurveP256): return elliptic.P256() case oid.Equal(oidNamedCurveP384): -@@ -345,8 +339,6 @@ func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { +@@ -377,8 +371,6 @@ func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) { switch curve { @@ -1159,7 +1161,7 @@ index be6c013..428053a 100644 case elliptic.P256(): return oidNamedCurveP256, true case elliptic.P384(): -@@ -1466,7 +1458,7 @@ func signingParamsForPublicKey(pub interface{}, requestedSigAlgo SignatureAlgori +@@ -1508,7 +1500,7 @@ func signingParamsForPublicKey(pub interface{}, requestedSigAlgo SignatureAlgori pubType = ECDSA switch pub.Curve { diff --git a/golang-1.5-bootstrap-binary-path.patch b/golang-1.5-bootstrap-binary-path.patch index e452e89..5ef35ac 100644 --- a/golang-1.5-bootstrap-binary-path.patch +++ b/golang-1.5-bootstrap-binary-path.patch @@ -1,16 +1,16 @@ diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go ---- go/src/cmd/dist/buildtool.go.bootstrap 2015-11-12 06:19:58.000000000 +0100 -+++ go/src/cmd/dist/buildtool.go 2015-11-13 09:54:58.796721027 +0100 -@@ -106,12 +106,20 @@ func bootstrapBuildTools() { +--- go/src/cmd/dist/buildtool.go.bootstrap 2016-06-06 14:26:37.638374670 +0200 ++++ go/src/cmd/dist/buildtool.go 2016-06-06 14:30:33.873262307 +0200 +@@ -111,15 +111,23 @@ func bootstrapBuildTools() { + defer os.Setenv("GOBIN", os.Getenv("GOBIN")) 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("GOOS", "") + os.Setenv("GOHOSTOS", "") + os.Setenv("GOARCH", "") os.Setenv("GOHOSTARCH", "") + bingopath := pathf("%s/bin/%s_%s/go", goroot_bootstrap, hostos, hostarch) @@ -18,16 +18,18 @@ diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go + 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/...") + // Run Go 1.4 to build binaries. Use -gcflags=-l to disable inlining to + // workaround bugs in Go 1.4's compiler. See discussion thread: + // https://groups.google.com/d/msg/golang-dev/Ss7mCKsvk8w/Gsq7VYI0AwAJ +- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-gcflags=-l", "-v", "bootstrap/...") ++ run(workspace, ShowOutput|CheckExit, bingopath, "install", "-gcflags=-l", "-v", "bootstrap/...") // Copy binaries into tool binary directory. for _, name := range bootstrapDirs { diff -up go/src/make.bash.bootstrap go/src/make.bash ---- go/src/make.bash.bootstrap 2015-11-13 09:54:58.797721031 +0100 -+++ go/src/make.bash 2015-11-13 10:11:11.633552619 +0100 -@@ -113,8 +113,15 @@ echo '##### Building Go bootstrap tool.' +--- go/src/make.bash.bootstrap 2016-06-06 14:26:37.628374633 +0200 ++++ go/src/make.bash 2016-06-06 14:26:37.638374670 +0200 +@@ -118,8 +118,15 @@ echo '##### Building Go bootstrap tool.' echo cmd/dist export GOROOT="$(cd .. && pwd)" GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4} @@ -45,3 +47,12 @@ diff -up go/src/make.bash.bootstrap go/src/make.bash echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 exit 1 fi +@@ -128,8 +135,6 @@ if [ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]; + echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 + exit 1 + 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 c9ac2ff..3d0c8a1 100644 --- a/golang.spec +++ b/golang.spec @@ -22,17 +22,19 @@ %global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \ /usr/lib/rpm/brp-compress +%global golibdir %{_libdir}/golang + # Golang build options. # Build golang using external/internal(close to cgo disabled) linking. -%ifarch %{ix86} x86_64 ppc64le %{arm} aarch64 +%ifarch %{ix86} x86_64 ppc64le %{arm} aarch64 s390x %global external_linker 1 %else %global external_linker 0 %endif # Build golang with cgo enabled/disabled(later equals more or less to internal linking). -%ifarch %{ix86} x86_64 ppc64le %{arm} aarch64 +%ifarch %{ix86} x86_64 ppc64le %{arm} aarch64 s390x %global cgo_enabled 1 %else %global cgo_enabled 0 @@ -46,7 +48,7 @@ %endif # Controls what ever we fail on failed tests -%ifarch %{golang_arches} +%ifarch %{ix86} x86_64 %{arm} aarch64 %{power64} %global fail_on_tests 1 %else %global fail_on_tests 0 @@ -80,13 +82,16 @@ %ifarch ppc64le %global gohostarch ppc64le %endif +%ifarch s390x +%global gohostarch s390x +%endif -%global go_api 1.6 -%global go_version 1.6.2 +%global go_api 1.7 +%global go_version 1.7rc2 Name: golang -Version: 1.6.2 -Release: 1%{?dist} +Version: 1.7 +Release: 0.0.rc2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -105,7 +110,7 @@ BuildRequires: hostname BuildRequires: net-tools %endif # for tests -BuildRequires: pcre-devel, glibc-static +BuildRequires: pcre-devel, glibc-static, perl Provides: go = %{version}-%{release} Requires: %{name}-bin = %{version}-%{release} @@ -139,7 +144,7 @@ Obsoletes: %{name}-vim < 1.4 Obsoletes: emacs-%{name} < 1.4 # These are the only RHEL/Fedora architectures that we compile this package for -ExclusiveArch: %{golang_arches} +ExclusiveArch: %{golang_arches} s390x Source100: golang-gdbinit @@ -237,16 +242,16 @@ Summary: Golang shared object libraries %setup -q -n go # increase verbosity of build -%patch0 -p1 +%patch0 -p1 -b .verbose # remove the P224 curve -%patch1 -p1 +%patch1 -p1 -b .curve # use the arch dependent path in the bootstrap -%patch212 -p1 +%patch212 -p1 -b .bootstrap # disable TestGdbPython -%patch213 -p1 +%patch213 -p1 -b .gdb %patch215 -p1 @@ -332,8 +337,20 @@ pushd $RPM_BUILD_ROOT%{goroot} find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list %if %{shared} - find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list - find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list + mkdir -p %{buildroot}/%{_libdir}/ + mkdir -p %{buildroot}/%{golibdir}/ + for file in $(find . -iname "*.so" ); do + chmod 755 $file + mv $file %{buildroot}/%{golibdir} + pushd $(dirname $file) + ln -fs %{golibdir}/$(basename $file) $(basename $file) + popd + echo "%%{goroot}/$file" >> $shared_list + echo "%%{golibdir}/$(basename $file)" >> $shared_list + done + + 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 @@ -454,6 +471,13 @@ fi %endif %changelog +* Tue Jul 19 2016 Jakub Čajka - 1.7-0.0.rc2 +- rebase to 1.7rc2 +- added s390x build +- improved shared lib packaging +- Resolves: bz1357602 - CVE-2016-5386 +- Resolves: bz1342090, bz1342090 + * Tue Apr 26 2016 Jakub Čajka - 1.6.2-1 - rebase to 1.6.2 - Resolves: bz1329206 - golang-1.6.2.src is available diff --git a/sources b/sources index a6c0083..6eb9a3a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d1b50fa98d9a71eeee829051411e6207 go1.6.2.src.tar.gz +c5cd29076e50111d299c2411ded5b427 go1.7rc2.src.tar.gz From 00c920284f705e576b9a3b67833d7a1f05e977cd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 21 Jul 2016 12:33:14 +0000 Subject: [PATCH 085/156] - https://fedoraproject.org/wiki/Changes/golang1.7 --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 3d0c8a1..dd2efee 100644 --- a/golang.spec +++ b/golang.spec @@ -91,7 +91,7 @@ Name: golang Version: 1.7 -Release: 0.0.rc2%{?dist} +Release: 0.1.rc2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -471,6 +471,9 @@ fi %endif %changelog +* Thu Jul 21 2016 Fedora Release Engineering - 1.7-0.1.rc2 +- https://fedoraproject.org/wiki/Changes/golang1.7 + * Tue Jul 19 2016 Jakub Čajka - 1.7-0.0.rc2 - rebase to 1.7rc2 - added s390x build From cf2fb88587d4606d71167c6333b9fa727d2d9a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 3 Aug 2016 13:47:09 +0200 Subject: [PATCH 086/156] rebase to go1.7rc5 Resolves: BZ#1342090 --- .gitignore | 1 + golang.spec | 8 ++++++-- sources | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1a16e43..44e9ea0 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ /go1.6.1.src.tar.gz /go1.6.2.src.tar.gz /go1.7rc2.src.tar.gz +/go1.7rc5.src.tar.gz diff --git a/golang.spec b/golang.spec index dd2efee..f6e34db 100644 --- a/golang.spec +++ b/golang.spec @@ -87,11 +87,11 @@ %endif %global go_api 1.7 -%global go_version 1.7rc2 +%global go_version 1.7rc5 Name: golang Version: 1.7 -Release: 0.1.rc2%{?dist} +Release: 0.2.rc5%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -471,6 +471,10 @@ fi %endif %changelog +* Wed Aug 03 2016 Jakub Čajka - 1.7-0.2.rc5 +- rebase to go1.7rc5 +- Resolves: BZ#1342090 + * Thu Jul 21 2016 Fedora Release Engineering - 1.7-0.1.rc2 - https://fedoraproject.org/wiki/Changes/golang1.7 diff --git a/sources b/sources index 6eb9a3a..cad0e66 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c5cd29076e50111d299c2411ded5b427 go1.7rc2.src.tar.gz +c3938621323bbab261f9ade7c0ca4599 go1.7rc5.src.tar.gz From 6896a58aa31cbb3c7ada9aba432d88cf2750c605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 8 Aug 2016 10:38:08 +0200 Subject: [PATCH 087/156] Obsolete golang-vet and golang-cover from golang-googlecode-tools package vet/cover binaries are provided by golang-bin rpm (thanks to jchaloup) --- golang.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/golang.spec b/golang.spec index f6e34db..564932d 100644 --- a/golang.spec +++ b/golang.spec @@ -91,7 +91,7 @@ Name: golang Version: 1.7 -Release: 0.2.rc5%{?dist} +Release: 0.3.rc5%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -144,7 +144,7 @@ Obsoletes: %{name}-vim < 1.4 Obsoletes: emacs-%{name} < 1.4 # These are the only RHEL/Fedora architectures that we compile this package for -ExclusiveArch: %{golang_arches} s390x +ExclusiveArch: %{golang_arches} Source100: golang-gdbinit @@ -210,6 +210,9 @@ Obsoletes: %{name}-pkg-netbsd-arm < 1.4.99 Obsoletes: %{name}-pkg-openbsd-386 < 1.4.99 Obsoletes: %{name}-pkg-openbsd-amd64 < 1.4.99 +Obsoletes: golang-vet < 0-12.1 +Obsoletes: golang-cover < 0-12.1 + Requires(post): %{_sbindir}/update-alternatives Requires(postun): %{_sbindir}/update-alternatives @@ -471,6 +474,12 @@ fi %endif %changelog +* Mon Aug 08 2016 Jakub Čajka - 1.7-0.3.rc5 +- Obsolete golang-vet and golang-cover from golang-googlecode-tools package + vet/cover binaries are provided by golang-bin rpm (thanks to jchaloup) +- clean up exclusive arch after s390x boostrap +- resolves: #1268206 + * Wed Aug 03 2016 Jakub Čajka - 1.7-0.2.rc5 - rebase to go1.7rc5 - Resolves: BZ#1342090 From 1fe98693987470eb955c3b96705cb5d87dcf98f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 26 Aug 2016 12:22:53 +0200 Subject: [PATCH 088/156] update to released version --- .gitignore | 1 + golang.spec | 8 ++++++-- sources | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 44e9ea0..20a4ca3 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ /go1.6.2.src.tar.gz /go1.7rc2.src.tar.gz /go1.7rc5.src.tar.gz +/go1.7.src.tar.gz diff --git a/golang.spec b/golang.spec index 564932d..06d031b 100644 --- a/golang.spec +++ b/golang.spec @@ -87,11 +87,11 @@ %endif %global go_api 1.7 -%global go_version 1.7rc5 +%global go_version 1.7 Name: golang Version: 1.7 -Release: 0.3.rc5%{?dist} +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -474,6 +474,10 @@ fi %endif %changelog +* Tue Aug 23 2016 Jakub Čajka - 1.7-1 +- update to released version +- related: BZ#1342090, BZ#1357394 + * Mon Aug 08 2016 Jakub Čajka - 1.7-0.3.rc5 - Obsolete golang-vet and golang-cover from golang-googlecode-tools package vet/cover binaries are provided by golang-bin rpm (thanks to jchaloup) diff --git a/sources b/sources index cad0e66..6489aad 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c3938621323bbab261f9ade7c0ca4599 go1.7rc5.src.tar.gz +a30c3bd1a7fcc6a48acfb74936a19b4c go1.7.src.tar.gz From 8bda509c5f3498720fb7831f22eac5696381be89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 8 Sep 2016 17:54:31 +0200 Subject: [PATCH 089/156] rebase to 1.7.1 Resolves: BZ#1374103 --- .gitignore | 1 + golang.spec | 8 ++++++-- sources | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 20a4ca3..b01c064 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ /go1.7rc2.src.tar.gz /go1.7rc5.src.tar.gz /go1.7.src.tar.gz +/go1.7.1.src.tar.gz diff --git a/golang.spec b/golang.spec index 06d031b..b7a5f97 100644 --- a/golang.spec +++ b/golang.spec @@ -87,10 +87,10 @@ %endif %global go_api 1.7 -%global go_version 1.7 +%global go_version 1.7.1 Name: golang -Version: 1.7 +Version: 1.7.1 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -474,6 +474,10 @@ fi %endif %changelog +* Thu Sep 08 2016 Jakub Čajka - 1.7.1-1 +- rebase to 1.7.1 +- Resolves: BZ#1374103 + * Tue Aug 23 2016 Jakub Čajka - 1.7-1 - update to released version - related: BZ#1342090, BZ#1357394 diff --git a/sources b/sources index 6489aad..f3a3cd9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a30c3bd1a7fcc6a48acfb74936a19b4c go1.7.src.tar.gz +433e2158e5c28fe24b11622df393cc46 go1.7.1.src.tar.gz From fd042bef95564711068e5b1e3caed2400491413f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 23 Sep 2016 15:27:32 +0200 Subject: [PATCH 090/156] rebase to go1.7.1 Resolves: BZ#1293449 - CVE-2015-8618, BZ#1357601 - CVE-2016-5386, BZ#1324345 - CVE-2016-3959, BZ#1376555 --- .gitignore | 1 + go1.5beta1-disable-TestGdbPython.patch | 15 +++-- golang-1.2-remove-ECC-p224.patch | 54 +++++++++-------- golang-1.5-bootstrap-binary-path.patch | 41 +++++++------ golang.spec | 84 +++++++++++++++----------- sources | 2 +- 6 files changed, 108 insertions(+), 89 deletions(-) diff --git a/.gitignore b/.gitignore index 5c0b29a..4908d1b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ /go1.5rc1.src.tar.gz /go1.5.src.tar.gz /go1.5.1.src.tar.gz +/go1.7.1.src.tar.gz diff --git a/go1.5beta1-disable-TestGdbPython.patch b/go1.5beta1-disable-TestGdbPython.patch index 8e0491f..89d7d68 100644 --- a/go1.5beta1-disable-TestGdbPython.patch +++ b/go1.5beta1-disable-TestGdbPython.patch @@ -1,13 +1,12 @@ -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() { +diff -up go/src/runtime/runtime-gdb_test.go.gdb go/src/runtime/runtime-gdb_test.go +--- go/src/runtime/runtime-gdb_test.go.gdb 2016-04-28 10:31:13.005689813 +0200 ++++ go/src/runtime/runtime-gdb_test.go 2016-04-28 10:32:12.202935125 +0200 +@@ -72,7 +72,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") - } + checkGdbEnvironment(t) + checkGdbVersion(t) + checkGdbPython(t) diff --git a/golang-1.2-remove-ECC-p224.patch b/golang-1.2-remove-ECC-p224.patch index 85abbb3..2b2d1a1 100644 --- a/golang-1.2-remove-ECC-p224.patch +++ b/golang-1.2-remove-ECC-p224.patch @@ -1,9 +1,3 @@ -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 @@ -17,7 +11,7 @@ index 5e3dea5..1a1ee83 100644 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 +index fc25fd7..356e617 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) { @@ -33,7 +27,7 @@ index 169944d..c653464 100644 testKeyGeneration(t, elliptic.P384(), "p384") testKeyGeneration(t, elliptic.P521(), "p521") } -@@ -63,11 +62,10 @@ func testSignAndVerify(t *testing.T, c elliptic.Curve, tag string) { +@@ -98,11 +97,10 @@ func testSignAndVerify(t *testing.T, c elliptic.Curve, tag string) { } func TestSignAndVerify(t *testing.T) { @@ -46,7 +40,7 @@ index 169944d..c653464 100644 testSignAndVerify(t, elliptic.P384(), "p384") testSignAndVerify(t, elliptic.P521(), "p521") } -@@ -100,11 +98,10 @@ func testNonceSafety(t *testing.T, c elliptic.Curve, tag string) { +@@ -135,11 +133,10 @@ func testNonceSafety(t *testing.T, c elliptic.Curve, tag string) { } func TestNonceSafety(t *testing.T) { @@ -59,7 +53,7 @@ index 169944d..c653464 100644 testNonceSafety(t, elliptic.P384(), "p384") testNonceSafety(t, elliptic.P521(), "p521") } -@@ -135,11 +132,10 @@ func testINDCCA(t *testing.T, c elliptic.Curve, tag string) { +@@ -170,11 +167,10 @@ func testINDCCA(t *testing.T, c elliptic.Curve, tag string) { } func TestINDCCA(t *testing.T) { @@ -72,7 +66,7 @@ index 169944d..c653464 100644 testINDCCA(t, elliptic.P384(), "p384") testINDCCA(t, elliptic.P521(), "p521") } -@@ -201,8 +197,6 @@ func TestVectors(t *testing.T) { +@@ -236,8 +232,6 @@ func TestVectors(t *testing.T) { parts := strings.SplitN(line, ",", 2) switch parts[0] { @@ -81,6 +75,14 @@ index 169944d..c653464 100644 case "P-256": pub.Curve = elliptic.P256() case "P-384": +@@ -314,7 +308,6 @@ func testNegativeInputs(t *testing.T, curve elliptic.Curve, tag string) { + } + + func TestNegativeInputs(t *testing.T) { +- testNegativeInputs(t, elliptic.P224(), "p224") + testNegativeInputs(t, elliptic.P256(), "p256") + testNegativeInputs(t, elliptic.P384(), "p384") + testNegativeInputs(t, elliptic.P521(), "p521") diff --git a/src/crypto/elliptic/bottombits.go b/src/crypto/elliptic/bottombits.go new file mode 100644 index 0000000..4544722 @@ -92,10 +94,10 @@ index 0000000..4544722 +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 +index c02df45..f713ad7 100644 --- a/src/crypto/elliptic/elliptic.go +++ b/src/crypto/elliptic/elliptic.go -@@ -331,7 +331,6 @@ var p384 *CurveParams +@@ -338,7 +338,6 @@ var p384 *CurveParams var p521 *CurveParams func initAll() { @@ -104,7 +106,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..e0034fc 100644 +index 7f3f1a2..833668e 100644 --- a/src/crypto/elliptic/elliptic_test.go +++ b/src/crypto/elliptic/elliptic_test.go @@ -6,27 +6,25 @@ package elliptic @@ -240,7 +242,7 @@ index 7e27913..e0034fc 100644 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) { +@@ -454,14 +405,14 @@ func BenchmarkScalarMultP256(b *testing.B) { } func TestMarshal(t *testing.T) { @@ -259,7 +261,7 @@ index 7e27913..e0034fc 100644 if xx == nil { t.Error("failed to unmarshal") return -@@ -459,13 +410,3 @@ func TestMarshal(t *testing.T) { +@@ -471,13 +422,3 @@ func TestMarshal(t *testing.T) { return } } @@ -275,11 +277,11 @@ index 7e27913..e0034fc 100644 -} diff --git a/src/crypto/elliptic/p224.go b/src/crypto/elliptic/p224.go deleted file mode 100644 -index 2d3fac7..0000000 +index de266ca..0000000 --- a/src/crypto/elliptic/p224.go +++ /dev/null @@ -1,765 +0,0 @@ --// Copyright 2012 The Go Authors. All rights reserved. +-// 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. - @@ -1046,11 +1048,11 @@ index 2d3fac7..0000000 -} diff --git a/src/crypto/elliptic/p224_test.go b/src/crypto/elliptic/p224_test.go deleted file mode 100644 -index 4b26d16..0000000 +index 8b4fa04..0000000 --- a/src/crypto/elliptic/p224_test.go +++ /dev/null @@ -1,47 +0,0 @@ --// Copyright 2012 The Go Authors. All rights reserved. +-// 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. - @@ -1120,10 +1122,10 @@ 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..428053a 100644 +index 9e6d67d..580831e 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go -@@ -308,9 +308,6 @@ func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm +@@ -340,9 +340,6 @@ func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm // RFC 5480, 2.1.1.1. Named Curve // @@ -1133,7 +1135,7 @@ index be6c013..428053a 100644 // 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 +@@ -355,7 +352,6 @@ func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm // // NB: secp256r1 is equivalent to prime256v1 var ( @@ -1141,7 +1143,7 @@ index be6c013..428053a 100644 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 ( +@@ -363,8 +359,6 @@ var ( func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { switch { @@ -1150,7 +1152,7 @@ index be6c013..428053a 100644 case oid.Equal(oidNamedCurveP256): return elliptic.P256() case oid.Equal(oidNamedCurveP384): -@@ -345,8 +339,6 @@ func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { +@@ -377,8 +371,6 @@ func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) { switch curve { @@ -1159,7 +1161,7 @@ index be6c013..428053a 100644 case elliptic.P256(): return oidNamedCurveP256, true case elliptic.P384(): -@@ -1466,7 +1458,7 @@ func signingParamsForPublicKey(pub interface{}, requestedSigAlgo SignatureAlgori +@@ -1508,7 +1500,7 @@ func signingParamsForPublicKey(pub interface{}, requestedSigAlgo SignatureAlgori pubType = ECDSA switch pub.Curve { diff --git a/golang-1.5-bootstrap-binary-path.patch b/golang-1.5-bootstrap-binary-path.patch index 8444727..5ef35ac 100644 --- a/golang-1.5-bootstrap-binary-path.patch +++ b/golang-1.5-bootstrap-binary-path.patch @@ -1,17 +1,16 @@ -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() { +diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go +--- go/src/cmd/dist/buildtool.go.bootstrap 2016-06-06 14:26:37.638374670 +0200 ++++ go/src/cmd/dist/buildtool.go 2016-06-06 14:30:33.873262307 +0200 +@@ -111,15 +111,23 @@ func bootstrapBuildTools() { + defer os.Setenv("GOBIN", os.Getenv("GOBIN")) 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("GOOS", "") + os.Setenv("GOHOSTOS", "") + os.Setenv("GOARCH", "") os.Setenv("GOHOSTARCH", "") + bingopath := pathf("%s/bin/%s_%s/go", goroot_bootstrap, hostos, hostarch) @@ -19,17 +18,18 @@ index be54ac4..6744fbdc 100644 + 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/...") + // Run Go 1.4 to build binaries. Use -gcflags=-l to disable inlining to + // workaround bugs in Go 1.4's compiler. See discussion thread: + // https://groups.google.com/d/msg/golang-dev/Ss7mCKsvk8w/Gsq7VYI0AwAJ +- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-gcflags=-l", "-v", "bootstrap/...") ++ run(workspace, ShowOutput|CheckExit, bingopath, "install", "-gcflags=-l", "-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.' +diff -up go/src/make.bash.bootstrap go/src/make.bash +--- go/src/make.bash.bootstrap 2016-06-06 14:26:37.628374633 +0200 ++++ go/src/make.bash 2016-06-06 14:26:37.638374670 +0200 +@@ -118,8 +118,15 @@ echo '##### Building Go bootstrap tool.' echo cmd/dist export GOROOT="$(cd .. && pwd)" GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4} @@ -45,6 +45,11 @@ index f17648a..77f463c 100755 + 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 + exit 1 + fi +@@ -128,8 +135,6 @@ if [ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]; + echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 + exit 1 fi -rm -f cmd/dist/dist -GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist diff --git a/golang.spec b/golang.spec index 7d53ef8..fe273f9 100644 --- a/golang.spec +++ b/golang.spec @@ -29,6 +29,7 @@ %global goroot /usr/lib/%{name} %global gopath %{_datadir}/gocode %global go_arches %{ix86} x86_64 %{arm} aarch64 +%global golibdir %{_libdir}/golang %ifarch x86_64 %global gohostarch amd64 %endif @@ -42,30 +43,29 @@ %global gohostarch arm64 %endif -%global go_api 1.5 -%global go_version 1.5.1 +%global go_api 1.7 +%global go_version 1.7.1 Name: golang -Version: 1.5.1 +Version: 1.7.1 Release: 1%{?dist} Summary: The Go Programming Language - -License: BSD +# source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain +License: BSD and Public Domain URL: http://golang.org/ 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: pcre-devel, glibc-static, perl %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 Provides: go = %{version}-%{release} +Provides: go-srpm-macros Requires: %{name}-bin Requires: %{name}-src = %{version}-%{release} @@ -74,21 +74,17 @@ Patch0: golang-1.2-verbose-build.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Patch1: golang-1.2-remove-ECC-p224.patch +# use the arch dependent path in the bootstrap +Patch212: golang-1.5-bootstrap-binary-path.patch + # disable TestGdbPython # https://github.com/golang/go/issues/11214 Patch213: go1.5beta1-disable-TestGdbPython.patch -# disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups -# 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 -# https://bugzilla.redhat.com/show_bug.cgi?id=1271709 -Patch216: ./golang-1.5.1-a3156aaa12.patch - # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -168,6 +164,9 @@ Obsoletes: %{name}-pkg-netbsd-arm < 1.4.99 Obsoletes: %{name}-pkg-openbsd-386 < 1.4.99 Obsoletes: %{name}-pkg-openbsd-amd64 < 1.4.99 +Obsoletes: golang-vet < 0-12.1 +Obsoletes: golang-cover < 0-12.1 + Requires(post): %{_sbindir}/update-alternatives Requires(postun): %{_sbindir}/update-alternatives @@ -200,23 +199,26 @@ Summary: Golang shared object libraries %setup -q -n go # increase verbosity of build -%patch0 -p1 +%patch0 -p1 -b .verbose # remove the P224 curve -%patch1 -p1 +%patch1 -p1 -b .curve # use the arch dependent path in the bootstrap -%patch212 -p1 +%patch212 -p1 -b .bootstrap # disable TestGdbPython -%patch213 -p1 +%patch213 -p1 -b .gdb -# disable TestCloneNEWUSERAndRemapNoRootDisableSetgroups -%patch214 -p1 +%patch215 -p1 -%patch216 -p1 %build +# print out system information +uname -a +cat /proc/cpuinfo +cat /proc/meminfo + # go1.5 bootstrapping. The compiler is written in golang. export GOROOT_BOOTSTRAP=%{goroot} @@ -288,6 +290,18 @@ pushd $RPM_BUILD_ROOT%{goroot} find misc/ ! -type d -printf '%{goroot}/%p\n' >> $misc_list %ifarch x86_64 + mkdir -p %{buildroot}/%{_libdir}/ + mkdir -p %{buildroot}/%{golibdir}/ + for file in $(find . -iname "*.so" ); do + chmod 755 $file + mv $file %{buildroot}/%{golibdir} + pushd $(dirname $file) + ln -fs %{golibdir}/$(basename $file) $(basename $file) + popd + echo "%%{goroot}/$file" >> $shared_list + echo "%%{golibdir}/$(basename $file)" >> $shared_list + done + find pkg/*_dynlink/ -type d -printf '%%%dir %{goroot}/%p\n' >> $shared_list find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list %endif @@ -305,7 +319,7 @@ popd 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} +# leave the arch independent pieces in {goroot} mkdir -p $RPM_BUILD_ROOT%{goroot}/bin/linux_%{gohostarch} 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 @@ -345,22 +359,15 @@ cp -av %{SOURCE102} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.golang export GOROOT=$(pwd -P) export PATH="$GOROOT"/bin:"$PATH" cd src -# skip using CGO for test. causes a SIGABRT on fc21 (bz1086900) -# until this test/issue is fixed -# https://bugzilla.redhat.com/show_bug.cgi?id=1086900 -# CGO for test, which fails in i686 on fc21 inside mock/chroot (bz1087621) -# https://bugzilla.redhat.com/show_bug.cgi?id=1087621 -# 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 +export CC="gcc" +export CFLAGS="$RPM_OPT_FLAGS" +export LDFLAGS="$RPM_LD_FLAGS" -# XXX reenable. likely go1.5beta2 https://github.com/golang/go/commit/9adf684686bad7c6319080d0b1da8308a77b08c9 -#CGO_ENABLED=0 ./run.bash --no-rebuild +# make sure to not timeout +export GO_TEST_TIMEOUT_SCALE=2 -CC="gcc" \ -CFLAGS="$RPM_OPT_FLAGS" \ -LDFLAGS="$RPM_LD_FLAGS" \ -./run.bash --no-rebuild -v -k +./run.bash --no-rebuild -v -v -v -k cd .. @@ -432,6 +439,11 @@ fi %endif %changelog +* Fri Sep 16 2016 Jakub Čajka - 1.7.1-1 +- rebase to go1.7.1 +- Resolves: BZ#1293449 - CVE-2015-8618, BZ#1357601 - CVE-2016-5386, +BZ#1324345 - CVE-2016-3959, BZ#1376555 + * Mon Oct 19 2015 Vincent Batts - 1.5.1-1 - bz1271709 include patch from upstream fix diff --git a/sources b/sources index 23e64bc..f3a3cd9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4adfbdfca523cc1c229be8a321f3602f go1.5.1.src.tar.gz +433e2158e5c28fe24b11622df393cc46 go1.7.1.src.tar.gz From d97861652790783d450152baa3f1c2737d0436e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 23 Sep 2016 17:48:07 +0200 Subject: [PATCH 091/156] fix link failure due to relocation overflows on PPC64X --- golang.spec | 12 +- ppc64x-overflow-1.patch | 457 ++++++++++++++++++++++++++++++++++++++++ ppc64x-overflow-2.patch | 150 +++++++++++++ 3 files changed, 618 insertions(+), 1 deletion(-) create mode 100644 ppc64x-overflow-1.patch create mode 100644 ppc64x-overflow-2.patch diff --git a/golang.spec b/golang.spec index b7a5f97..3aa8dc0 100644 --- a/golang.spec +++ b/golang.spec @@ -91,7 +91,7 @@ Name: golang Version: 1.7.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -133,6 +133,10 @@ Patch213: go1.5beta1-disable-TestGdbPython.patch # 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 +#PPC64X relocation overflow fix +Patch216: ppc64x-overflow-1.patch +Patch217: ppc64x-overflow-2.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -258,6 +262,9 @@ Summary: Golang shared object libraries %patch215 -p1 +%patch216 -p1 +%patch217 -p1 + %build # print out system information uname -a @@ -474,6 +481,9 @@ fi %endif %changelog +* Fri Sep 23 2016 Jakub Čajka - 1.7.1-2 +- fix link failure due to relocation overflows on PPC64X + * Thu Sep 08 2016 Jakub Čajka - 1.7.1-1 - rebase to 1.7.1 - Resolves: BZ#1374103 diff --git a/ppc64x-overflow-1.patch b/ppc64x-overflow-1.patch new file mode 100644 index 0000000..35e3e3d --- /dev/null +++ b/ppc64x-overflow-1.patch @@ -0,0 +1,457 @@ +From d6beea7f9ea1aa2ae5abca7fccb252767820aa13 Mon Sep 17 00:00:00 2001 +From: Lynn Boger +Date: Tue, 26 Jul 2016 08:51:10 -0500 +Subject: [PATCH] cmd/link: split large elf text sections for ppc64x + +Some applications built with Go on ppc64x with +external linking can fail to link with relocation +truncation errors, due to the way that the golang +compiler generates a single go.o file containing +a single large text section to send to the GNU +linker. If the size of the single text section is +greater than 2^26, this can lead to link errors +due to 24 bit offset field in the bl (call) +instruction. + +This fix solves the problem by splitting into +multiple text sections when this limit is reached. +When this is done then the GNU linker can fix the +long calls and insert jump tables where needed. +--- + src/cmd/link/internal/ld/data.go | 52 +++++++++++++++++++++++++++++-- + src/cmd/link/internal/ld/elf.go | 60 ++++++++++++++++++++++++++++++++--- + src/cmd/link/internal/ld/lib.go | 20 ++++++++++++ + src/cmd/link/internal/ld/symtab.go | 64 ++++++++++++++++++++++++++++++++++++++ + src/cmd/link/internal/ppc64/asm.go | 12 ++++--- + src/runtime/symtab.go | 34 +++++++++++++++----- + src/runtime/type.go | 16 +++++++++- + 7 files changed, 237 insertions(+), 21 deletions(-) + +diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go +index 57a0dad..58ce18c 100644 +--- a/src/cmd/link/internal/ld/data.go ++++ b/src/cmd/link/internal/ld/data.go +@@ -527,7 +527,15 @@ func relocsym(s *LSym) { + o = Symaddr(r.Sym) + r.Add - int64(r.Sym.Sect.Vaddr) + + case obj.R_ADDROFF: +- o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add ++ ++ // The method offset tables using this relocation expect the offset to be relative ++ // to the start of the first text section, even if there are multiple. ++ ++ if Linkmode == LinkExternal && r.Sym.Sect.Name == ".text" && r.Sym.Sect.Vaddr != Segtext.Vaddr { ++ o = Symaddr(r.Sym) - int64(Segtext.Vaddr) + r.Add ++ } else { ++ o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add ++ } + + // r->sym can be null when CALL $(constant) is transformed from absolute PC to relative PC call. + case obj.R_CALL, obj.R_GOTPCREL, obj.R_PCREL: +@@ -1926,6 +1934,7 @@ func textaddress() { + } + va := uint64(INITTEXT) + sect.Vaddr = va ++ n := 1 + for _, sym := range Ctxt.Textp { + sym.Sect = sect + if sym.Type&obj.SSUB != 0 { +@@ -1948,9 +1957,30 @@ func textaddress() { + } else { + va += uint64(sym.Size) + } ++ // On ppc64x a text section should not be larger than 2^26 bytes due to the size of ++ // call target offset field in the bl instruction. Splitting into text ++ // sections smaller than this limit allows the GNU linker to modify the long calls ++ // appropriately. The limit allows for the space for linker tables. ++ ++ // Only break at outermost syms. ++ ++ if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > uint64(0x1c00000) { ++ ++ // Set the length for the previous text section ++ sect.Length = va - sect.Vaddr ++ ++ // Create new section, set the starting Vaddr ++ sect = addsection(&Segtext, ".text", 05) ++ sect.Vaddr = va ++ ++ // Create a symbol for the start and end of the secondary text section ++ Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0).Sect = sect ++ n++ ++ } + } + + sect.Length = va - sect.Vaddr ++ Linklookup(Ctxt, "runtime.etext", 0).Sect = sect + } + + // assign addresses +@@ -2057,11 +2087,27 @@ func address() { + Segdwarf.Filelen = va - Segdwarf.Vaddr + + text := Segtext.Sect ++ lasttext := text + var rodata *Section + if Segrodata.Sect != nil { + rodata = Segrodata.Sect + } else { +- rodata = text.Next ++ // Could be multiple .text sections ++ n := 1 ++ for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next { ++ if sect.Name != ".text" { ++ break ++ } ++ lasttext = sect ++ symname := fmt.Sprintf("runtime.text.%d", n) ++ xdefine(symname, obj.STEXT, int64(sect.Vaddr)) ++ n++ ++ } ++ ++ rodata = lasttext.Next ++ if rodata != nil && rodata.Name != ".rodata" { ++ Diag("Unexpected section order in text segment") ++ } + } + var relrodata *Section + typelink := rodata.Next +@@ -2108,7 +2154,7 @@ func address() { + } + + xdefine("runtime.text", obj.STEXT, int64(text.Vaddr)) +- xdefine("runtime.etext", obj.STEXT, int64(text.Vaddr+text.Length)) ++ xdefine("runtime.etext", obj.STEXT, int64(lasttext.Vaddr+lasttext.Length)) + if HEADTYPE == obj.Hwindows { + xdefine(".text", obj.STEXT, int64(text.Vaddr)) + } +diff --git a/src/cmd/link/internal/ld/elf.go b/src/cmd/link/internal/ld/elf.go +index 39d3609..ecb00c2 100644 +--- a/src/cmd/link/internal/ld/elf.go ++++ b/src/cmd/link/internal/ld/elf.go +@@ -1623,6 +1623,25 @@ func elfshname(name string) *ElfShdr { + return nil + } + ++// Create an ElfShdr for the section with name. ++// A new one is created even if one already exists with ++// the same name. ++func elfshnamedup(name string) *ElfShdr { ++ var off int ++ var sh *ElfShdr ++ ++ for i := 0; i < nelfstr; i++ { ++ if name == elfstr[i].s { ++ off = elfstr[i].off ++ sh = newElfShdr(int64(off)) ++ return sh ++ } ++ } ++ Diag("cannot find elf name %s", name) ++ errorexit() ++ return nil ++} ++ + func elfshalloc(sect *Section) *ElfShdr { + sh := elfshname(sect.Name) + sect.Elfsect = sh +@@ -1630,7 +1649,17 @@ func elfshalloc(sect *Section) *ElfShdr { + } + + func elfshbits(sect *Section) *ElfShdr { +- sh := elfshalloc(sect) ++ var sh *ElfShdr ++ ++ if sect.Name == ".text" { ++ if sect.Elfsect == nil { ++ sect.Elfsect = elfshnamedup(sect.Name) ++ } ++ sh = sect.Elfsect ++ } else { ++ sh = elfshalloc(sect) ++ } ++ + // If this section has already been set up as a note, we assume type_ and + // flags are already correct, but the other fields still need filling in. + if sh.type_ == SHT_NOTE { +@@ -1706,6 +1735,15 @@ func elfshreloc(sect *Section) *ElfShdr { + } + + sh := elfshname(elfRelType + sect.Name) ++ ++ // There could be multiple text sections but each needs ++ // its own .rela.text. ++ if sect.Name == ".text" { ++ if sh.info != 0 && sh.info != uint32(sect.Elfsect.shnum) { ++ sh = elfshnamedup(elfRelType + sect.Name) ++ } ++ } ++ + sh.type_ = uint32(typ) + sh.entsize = uint64(SysArch.RegSize) * 2 + if typ == SHT_RELA { +@@ -1776,9 +1814,12 @@ func Elfemitreloc() { + Cput(0) + } + +- elfrelocsect(Segtext.Sect, Ctxt.Textp) +- for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next { +- elfrelocsect(sect, datap) ++ for sect := Segtext.Sect; sect != nil; sect = sect.Next { ++ if sect.Name == ".text" { ++ elfrelocsect(sect, Ctxt.Textp) ++ } else { ++ elfrelocsect(sect, datap) ++ } + } + for sect := Segrodata.Sect; sect != nil; sect = sect.Next { + elfrelocsect(sect, datap) +@@ -2109,7 +2150,16 @@ func Asmbelfsetup() { + elfshname("") + + for sect := Segtext.Sect; sect != nil; sect = sect.Next { +- elfshalloc(sect) ++ ++ // There could be multiple .text sections. Instead check the Elfsect ++ // field to determine if already has an ElfShdr and if not, create one. ++ if sect.Name == ".text" { ++ if sect.Elfsect == nil { ++ sect.Elfsect = elfshnamedup(sect.Name) ++ } ++ } else { ++ elfshalloc(sect) ++ } + } + for sect := Segrodata.Sect; sect != nil; sect = sect.Next { + elfshalloc(sect) +diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go +index 14f4fa9..709e7ca 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -1956,6 +1956,26 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) { + if s.Type == obj.STEXT { + put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil) + } ++ n := 0 ++ ++ // Generate base addresses for all text sections if there are multiple ++ for sect := Segtext.Sect; sect != nil; sect = sect.Next { ++ if n == 0 { ++ n++ ++ continue ++ } ++ if sect.Name != ".text" { ++ break ++ } ++ s = Linkrlookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0) ++ if s == nil { ++ break ++ } ++ if s.Type == obj.STEXT { ++ put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil) ++ } ++ n++ ++ } + s = Linklookup(Ctxt, "runtime.etext", 0) + if s.Type == obj.STEXT { + put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil) +diff --git a/src/cmd/link/internal/ld/symtab.go b/src/cmd/link/internal/ld/symtab.go +index 06d7792..80eb33d 100644 +--- a/src/cmd/link/internal/ld/symtab.go ++++ b/src/cmd/link/internal/ld/symtab.go +@@ -315,6 +315,62 @@ func (libs byPkg) Swap(a, b int) { + libs[a], libs[b] = libs[b], libs[a] + } + ++// Create a table with information on the text sections. ++ ++func textsectionmap() uint32 { ++ ++ t := Linklookup(Ctxt, "runtime.textsectionmap", 0) ++ t.Type = obj.SRODATA ++ t.Attr |= AttrReachable ++ nsections := int64(0) ++ ++ for sect := Segtext.Sect; sect != nil; sect = sect.Next { ++ if sect.Name == ".text" { ++ nsections++ ++ } else { ++ break ++ } ++ } ++ Symgrow(Ctxt, t, nsections*3*8) ++ ++ off := int64(0) ++ n := 0 ++ ++ // The vaddr for each text section is the difference between the section's ++ // Vaddr and the Vaddr for the first text section as determined at compile ++ // time. ++ ++ // The symbol name for the start address of the first text section is ++ // runtime.text. Additional text sections are named runtime.text.n where n is the ++ // order of creation starting with 1. These symbols provide the section's ++ // start address after relocation by the linker. ++ ++ textbase := Segtext.Sect.Vaddr ++ for sect := Segtext.Sect; sect != nil; sect = sect.Next { ++ if sect.Name != ".text" { ++ break ++ } ++ off = setuintxx(Ctxt, t, off, sect.Vaddr-textbase, int64(SysArch.IntSize)) ++ off = setuintxx(Ctxt, t, off, sect.Length, int64(SysArch.IntSize)) ++ if n == 0 { ++ s := Linkrlookup(Ctxt, "runtime.text", 0) ++ if s == nil { ++ Diag("Unable to find symbol runtime.text\n") ++ } ++ off = setaddr(Ctxt, t, off, s) ++ ++ } else { ++ s := Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0) ++ if s == nil { ++ Diag("Unable to find symbol runtime.text.%d\n", n) ++ } ++ off = setaddr(Ctxt, t, off, s) ++ } ++ n++ ++ } ++ return uint32(n) ++} ++ + func symtab() { + dosymtype() + +@@ -489,6 +545,8 @@ func symtab() { + adduint(Ctxt, abihashgostr, uint64(hashsym.Size)) + } + ++ nsections := textsectionmap() ++ + // Information about the layout of the executable image for the + // runtime to use. Any changes here must be matched by changes to + // the definition of moduledata in runtime/symtab.go. +@@ -527,6 +585,12 @@ func symtab() { + Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.gcbss", 0)) + Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.types", 0)) + Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.etypes", 0)) ++ ++ // text section information ++ Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.textsectionmap", 0)) ++ adduint(Ctxt, moduledata, uint64(nsections)) ++ adduint(Ctxt, moduledata, uint64(nsections)) ++ + // The typelinks slice + Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.typelink", 0)) + adduint(Ctxt, moduledata, uint64(ntypelinks)) +diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go +index bd2e23f..ab59fa8 100644 +--- a/src/cmd/link/internal/ppc64/asm.go ++++ b/src/cmd/link/internal/ppc64/asm.go +@@ -813,12 +813,14 @@ func asmb() { + ld.Asmbelfsetup() + } + +- sect := ld.Segtext.Sect +- ld.Cseek(int64(sect.Vaddr - ld.Segtext.Vaddr + ld.Segtext.Fileoff)) +- ld.Codeblk(int64(sect.Vaddr), int64(sect.Length)) +- for sect = sect.Next; sect != nil; sect = sect.Next { ++ for sect := ld.Segtext.Sect; sect != nil; sect = sect.Next { + ld.Cseek(int64(sect.Vaddr - ld.Segtext.Vaddr + ld.Segtext.Fileoff)) +- ld.Datblk(int64(sect.Vaddr), int64(sect.Length)) ++ // Might have multiple text sections ++ if sect.Name == ".text" { ++ ld.Codeblk(int64(sect.Vaddr), int64(sect.Length)) ++ } else { ++ ld.Datblk(int64(sect.Vaddr), int64(sect.Length)) ++ } + } + + if ld.Segrodata.Filelen > 0 { +diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go +index 4f6fae2..23e80ce 100644 +--- a/src/runtime/symtab.go ++++ b/src/runtime/symtab.go +@@ -195,8 +195,9 @@ type moduledata struct { + end, gcdata, gcbss uintptr + types, etypes uintptr + +- typelinks []int32 // offsets from types +- itablinks []*itab ++ textsectmap []textsect ++ typelinks []int32 // offsets from types ++ itablinks []*itab + + modulename string + modulehashes []modulehash +@@ -226,6 +227,14 @@ type functab struct { + funcoff uintptr + } + ++// Mapping information for secondary text sections ++ ++type textsect struct { ++ vaddr uint64 // prelinked section vaddr ++ length uint64 // section length ++ baseaddr uintptr // relocated section address ++} ++ + const minfunc = 16 // minimum function size + const pcbucketsize = 256 * minfunc // size of bucket in the pc->func lookup table + +@@ -368,12 +377,23 @@ func findfunc(pc uintptr) *_func { + ffb := (*findfuncbucket)(add(unsafe.Pointer(datap.findfunctab), b*unsafe.Sizeof(findfuncbucket{}))) + idx := ffb.idx + uint32(ffb.subbuckets[i]) + if pc < datap.ftab[idx].entry { +- throw("findfunc: bad findfunctab entry") +- } + +- // linear search to find func with pc >= entry. +- for datap.ftab[idx+1].entry <= pc { +- idx++ ++ // If there are multiple text sections then the buckets for the secondary ++ // text sections will be off because the addresses in those text sections ++ // were relocated to higher addresses. Search back to find it. ++ ++ for datap.ftab[idx].entry > pc && idx > 0 { ++ idx-- ++ } ++ if idx == 0 { ++ throw("findfunc: bad findfunctab entry idx") ++ } ++ } else { ++ ++ // linear search to find func with pc >= entry. ++ for datap.ftab[idx+1].entry <= pc { ++ idx++ ++ } + } + return (*_func)(unsafe.Pointer(&datap.pclntable[datap.ftab[idx].funcoff])) + } +diff --git a/src/runtime/type.go b/src/runtime/type.go +index 5ef11a4..f641adc 100644 +--- a/src/runtime/type.go ++++ b/src/runtime/type.go +@@ -257,7 +257,21 @@ func (t *_type) textOff(off textOff) unsafe.Pointer { + } + return res + } +- res := md.text + uintptr(off) ++ res := uintptr(0) ++ ++ // Find the text section range that contains the offset to determine the section's base ++ // address. In cases where there are multiple text sections, the base address might be ++ // relocated by the linker. ++ ++ for i := 0; i < len(md.textsectmap); i++ { ++ sectaddr := md.textsectmap[i].vaddr ++ sectlen := md.textsectmap[i].length ++ if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen { ++ res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr) ++ break ++ } ++ } ++ + if res > md.etext { + println("runtime: textOff", hex(off), "out of range", hex(md.text), "-", hex(md.etext)) + throw("runtime: text offset out of range") diff --git a/ppc64x-overflow-2.patch b/ppc64x-overflow-2.patch new file mode 100644 index 0000000..35dfc0e --- /dev/null +++ b/ppc64x-overflow-2.patch @@ -0,0 +1,150 @@ +From a5b97a846d70cd8db7f33c24f2b9159f935ce318 Mon Sep 17 00:00:00 2001 +From: Lynn Boger +Date: Tue, 13 Sep 2016 15:13:08 -0500 +Subject: [PATCH] cmd/compile: large text sections on ppc64le + +Additional fixes as submitted upstream. +--- + src/cmd/link/internal/ld/data.go | 24 ++++++++++++------------ + src/cmd/link/internal/ld/lib.go | 2 +- + src/cmd/link/internal/ld/symtab.go | 2 +- + src/runtime/type.go | 28 ++++++++++++++++++---------- + 4 files changed, 32 insertions(+), 24 deletions(-) + +diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go +index 58ce18c..d8e43ff 100644 +--- a/src/cmd/link/internal/ld/data.go ++++ b/src/cmd/link/internal/ld/data.go +@@ -531,7 +531,7 @@ func relocsym(s *LSym) { + // The method offset tables using this relocation expect the offset to be relative + // to the start of the first text section, even if there are multiple. + +- if Linkmode == LinkExternal && r.Sym.Sect.Name == ".text" && r.Sym.Sect.Vaddr != Segtext.Vaddr { ++ if r.Sym.Sect.Name == ".text" { + o = Symaddr(r.Sym) - int64(Segtext.Vaddr) + r.Add + } else { + o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add +@@ -1928,7 +1928,6 @@ func textaddress() { + + sect.Align = int32(Funcalign) + Linklookup(Ctxt, "runtime.text", 0).Sect = sect +- Linklookup(Ctxt, "runtime.etext", 0).Sect = sect + if HEADTYPE == obj.Hwindows { + Linklookup(Ctxt, ".text", 0).Sect = sect + } +@@ -1964,7 +1963,7 @@ func textaddress() { + + // Only break at outermost syms. + +- if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > uint64(0x1c00000) { ++ if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > 0x1c00000 { + + // Set the length for the previous text section + sect.Length = va - sect.Vaddr +@@ -1973,7 +1972,7 @@ func textaddress() { + sect = addsection(&Segtext, ".text", 05) + sect.Vaddr = va + +- // Create a symbol for the start and end of the secondary text section ++ // Create a symbol for the start of the secondary text section + Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0).Sect = sect + n++ + } +@@ -2093,15 +2092,8 @@ func address() { + rodata = Segrodata.Sect + } else { + // Could be multiple .text sections +- n := 1 +- for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next { +- if sect.Name != ".text" { +- break +- } ++ for sect := Segtext.Sect.Next; sect != nil && sect.Name == ".text"; sect = sect.Next { + lasttext = sect +- symname := fmt.Sprintf("runtime.text.%d", n) +- xdefine(symname, obj.STEXT, int64(sect.Vaddr)) +- n++ + } + + rodata = lasttext.Next +@@ -2155,6 +2147,14 @@ func address() { + + xdefine("runtime.text", obj.STEXT, int64(text.Vaddr)) + xdefine("runtime.etext", obj.STEXT, int64(lasttext.Vaddr+lasttext.Length)) ++ ++ n := 1 ++ for sect := Segtext.Sect.Next; sect != nil && sect.Name == ".text"; sect = sect.Next { ++ symname := fmt.Sprintf("runtime.text.%d", n) ++ xdefine(symname, obj.STEXT, int64(sect.Vaddr)) ++ n++ ++ } ++ + if HEADTYPE == obj.Hwindows { + xdefine(".text", obj.STEXT, int64(text.Vaddr)) + } +diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go +index 709e7ca..c37ef92 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -1958,7 +1958,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) { + } + n := 0 + +- // Generate base addresses for all text sections if there are multiple ++ // Generate base addresses for all text sections if there are multiple. + for sect := Segtext.Sect; sect != nil; sect = sect.Next { + if n == 0 { + n++ +diff --git a/src/cmd/link/internal/ld/symtab.go b/src/cmd/link/internal/ld/symtab.go +index 80eb33d..ec26f88 100644 +--- a/src/cmd/link/internal/ld/symtab.go ++++ b/src/cmd/link/internal/ld/symtab.go +@@ -331,7 +331,7 @@ func textsectionmap() uint32 { + break + } + } +- Symgrow(Ctxt, t, nsections*3*8) ++ Symgrow(Ctxt, t, nsections*(2*int64(SysArch.IntSize)+int64(SysArch.PtrSize))) + + off := int64(0) + n := 0 +diff --git a/src/runtime/type.go b/src/runtime/type.go +index f641adc..d4df5a9 100644 +--- a/src/runtime/type.go ++++ b/src/runtime/type.go +@@ -259,17 +259,25 @@ func (t *_type) textOff(off textOff) unsafe.Pointer { + } + res := uintptr(0) + +- // Find the text section range that contains the offset to determine the section's base +- // address. In cases where there are multiple text sections, the base address might be +- // relocated by the linker. +- +- for i := 0; i < len(md.textsectmap); i++ { +- sectaddr := md.textsectmap[i].vaddr +- sectlen := md.textsectmap[i].length +- if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen { +- res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr) +- break ++ // The text, or instruction stream is generated as one large buffer. The off (offset) for a method is ++ // its offset within this buffer. If the total text size gets too large, there can be issues on platforms like ppc64 if ++ // the target of calls are too far for the call instruction. To resolve the large text issue, the text is split ++ // into multiple text sections to allow the linker to generate long calls when necessary. When this happens, the vaddr ++ // for each text section is set to its offset within the text. Each method's offset is compared against the section ++ // vaddrs and sizes to determine the containing section. Then the section relative offset is added to the section's ++ // relocated baseaddr to compute the method addess. ++ ++ if len(md.textsectmap) > 1 { ++ for i := 0; i < len(md.textsectmap); i++ { ++ sectaddr := md.textsectmap[i].vaddr ++ sectlen := md.textsectmap[i].length ++ if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen { ++ res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr) ++ break ++ } + } ++ } else { ++ res = md.text + uintptr(off) + } + + if res > md.etext { From 663103c2f11d6ca9ef76cadcbd1950c6ab6e0dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 20 Oct 2016 12:21:38 +0200 Subject: [PATCH 092/156] Resolves: BZ#1387067 - golang-1.7.3 is available added fix for tests failing with latest tzdata --- .gitignore | 1 + golang.spec | 15 ++++++++++++--- sources | 2 +- tzdata-fix.patch | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 tzdata-fix.patch diff --git a/.gitignore b/.gitignore index b01c064..43a2a7e 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ /go1.7rc5.src.tar.gz /go1.7.src.tar.gz /go1.7.1.src.tar.gz +/go1.7.3.src.tar.gz diff --git a/golang.spec b/golang.spec index 3aa8dc0..4e30243 100644 --- a/golang.spec +++ b/golang.spec @@ -87,11 +87,11 @@ %endif %global go_api 1.7 -%global go_version 1.7.1 +%global go_version 1.7.3 Name: golang -Version: 1.7.1 -Release: 2%{?dist} +Version: 1.7.3 +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -137,6 +137,9 @@ Patch215: ./go1.5-zoneinfo_testing_only.patch Patch216: ppc64x-overflow-1.patch Patch217: ppc64x-overflow-2.patch +# Fix for https://github.com/golang/go/issues/17276 +Patch218: tzdata-fix.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -265,6 +268,8 @@ Summary: Golang shared object libraries %patch216 -p1 %patch217 -p1 +%patch218 -p1 + %build # print out system information uname -a @@ -481,6 +486,10 @@ fi %endif %changelog +* Thu Oct 20 2016 Jakub Čajka - 1.7.3-1 +- Resolves: BZ#1387067 - golang-1.7.3 is available +- added fix for tests failing with latest tzdata + * Fri Sep 23 2016 Jakub Čajka - 1.7.1-2 - fix link failure due to relocation overflows on PPC64X diff --git a/sources b/sources index f3a3cd9..8390332 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -433e2158e5c28fe24b11622df393cc46 go1.7.1.src.tar.gz +83d1b7bd4281479ab7d153e5152c9fc9 go1.7.3.src.tar.gz diff --git a/tzdata-fix.patch b/tzdata-fix.patch new file mode 100644 index 0000000..b7e6e41 --- /dev/null +++ b/tzdata-fix.patch @@ -0,0 +1,34 @@ +From c5434f2973a87acff76bac359236e690d632ce95 Mon Sep 17 00:00:00 2001 +From: Alberto Donizetti +Date: Thu, 29 Sep 2016 13:59:10 +0200 +Subject: [PATCH] time: update test for tzdata-2016g + +Fixes #17276 + +Change-Id: I0188cf9bc5fdb48c71ad929cc54206d03e0b96e4 +Reviewed-on: https://go-review.googlesource.com/29995 +Reviewed-by: Brad Fitzpatrick +Run-TryBot: Brad Fitzpatrick +TryBot-Result: Gobot Gobot +--- + src/time/time_test.go | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/time/time_test.go b/src/time/time_test.go +index 68236fd..2e47d08 100644 +--- a/src/time/time_test.go ++++ b/src/time/time_test.go +@@ -943,8 +943,11 @@ func TestLoadFixed(t *testing.T) { + // but Go and most other systems use "east is positive". + // So GMT+1 corresponds to -3600 in the Go zone, not +3600. + name, offset := Now().In(loc).Zone() +- if name != "GMT+1" || offset != -1*60*60 { +- t.Errorf("Now().In(loc).Zone() = %q, %d, want %q, %d", name, offset, "GMT+1", -1*60*60) ++ // The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1" ++ // on earlier versions; we accept both. (Issue #17276). ++ if !(name == "GMT+1" || name == "-01") || offset != -1*60*60 { ++ t.Errorf("Now().In(loc).Zone() = %q, %d, want %q or %q, %d", ++ name, offset, "GMT+1", "-01", -1*60*60) + } + } + From 414707a1eb0b3e9b7db27f43b0cba65e070f8621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 21 Oct 2016 12:00:50 +0200 Subject: [PATCH 093/156] rebase to go1.7.3 Fix possible relocation overflows on ppc Fix failing test due to latest tzdata --- .gitignore | 1 + golang.spec | 20 +- ppc64x-overflow-1.patch | 457 ++++++++++++++++++++++++++++++++++++++++ ppc64x-overflow-2.patch | 150 +++++++++++++ sources | 2 +- tzdata-fix.patch | 34 +++ 6 files changed, 661 insertions(+), 3 deletions(-) create mode 100644 ppc64x-overflow-1.patch create mode 100644 ppc64x-overflow-2.patch create mode 100644 tzdata-fix.patch diff --git a/.gitignore b/.gitignore index 4908d1b..72f9827 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ /go1.5.src.tar.gz /go1.5.1.src.tar.gz /go1.7.1.src.tar.gz +/go1.7.3.src.tar.gz diff --git a/golang.spec b/golang.spec index fe273f9..662dbb9 100644 --- a/golang.spec +++ b/golang.spec @@ -44,10 +44,10 @@ %endif %global go_api 1.7 -%global go_version 1.7.1 +%global go_version 1.7.3 Name: golang -Version: 1.7.1 +Version: 1.7.3 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -85,6 +85,13 @@ Patch213: go1.5beta1-disable-TestGdbPython.patch # 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 +#PPC64X relocation overflow fix +Patch216: ppc64x-overflow-1.patch +Patch217: ppc64x-overflow-2.patch + +# Fix for https://github.com/golang/go/issues/17276 +Patch218: tzdata-fix.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -212,6 +219,10 @@ Summary: Golang shared object libraries %patch215 -p1 +%patch216 -p1 +%patch217 -p1 + +%patch218 -p1 %build # print out system information @@ -439,6 +450,11 @@ fi %endif %changelog +* Fri Oct 21 2016 Jakub Čajka - 1.7.3-1 +- rebase to go1.7.3 +- Fix possible relocation overflows on ppc +- Fix failing test due to latest tzdata + * Fri Sep 16 2016 Jakub Čajka - 1.7.1-1 - rebase to go1.7.1 - Resolves: BZ#1293449 - CVE-2015-8618, BZ#1357601 - CVE-2016-5386, diff --git a/ppc64x-overflow-1.patch b/ppc64x-overflow-1.patch new file mode 100644 index 0000000..35e3e3d --- /dev/null +++ b/ppc64x-overflow-1.patch @@ -0,0 +1,457 @@ +From d6beea7f9ea1aa2ae5abca7fccb252767820aa13 Mon Sep 17 00:00:00 2001 +From: Lynn Boger +Date: Tue, 26 Jul 2016 08:51:10 -0500 +Subject: [PATCH] cmd/link: split large elf text sections for ppc64x + +Some applications built with Go on ppc64x with +external linking can fail to link with relocation +truncation errors, due to the way that the golang +compiler generates a single go.o file containing +a single large text section to send to the GNU +linker. If the size of the single text section is +greater than 2^26, this can lead to link errors +due to 24 bit offset field in the bl (call) +instruction. + +This fix solves the problem by splitting into +multiple text sections when this limit is reached. +When this is done then the GNU linker can fix the +long calls and insert jump tables where needed. +--- + src/cmd/link/internal/ld/data.go | 52 +++++++++++++++++++++++++++++-- + src/cmd/link/internal/ld/elf.go | 60 ++++++++++++++++++++++++++++++++--- + src/cmd/link/internal/ld/lib.go | 20 ++++++++++++ + src/cmd/link/internal/ld/symtab.go | 64 ++++++++++++++++++++++++++++++++++++++ + src/cmd/link/internal/ppc64/asm.go | 12 ++++--- + src/runtime/symtab.go | 34 +++++++++++++++----- + src/runtime/type.go | 16 +++++++++- + 7 files changed, 237 insertions(+), 21 deletions(-) + +diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go +index 57a0dad..58ce18c 100644 +--- a/src/cmd/link/internal/ld/data.go ++++ b/src/cmd/link/internal/ld/data.go +@@ -527,7 +527,15 @@ func relocsym(s *LSym) { + o = Symaddr(r.Sym) + r.Add - int64(r.Sym.Sect.Vaddr) + + case obj.R_ADDROFF: +- o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add ++ ++ // The method offset tables using this relocation expect the offset to be relative ++ // to the start of the first text section, even if there are multiple. ++ ++ if Linkmode == LinkExternal && r.Sym.Sect.Name == ".text" && r.Sym.Sect.Vaddr != Segtext.Vaddr { ++ o = Symaddr(r.Sym) - int64(Segtext.Vaddr) + r.Add ++ } else { ++ o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add ++ } + + // r->sym can be null when CALL $(constant) is transformed from absolute PC to relative PC call. + case obj.R_CALL, obj.R_GOTPCREL, obj.R_PCREL: +@@ -1926,6 +1934,7 @@ func textaddress() { + } + va := uint64(INITTEXT) + sect.Vaddr = va ++ n := 1 + for _, sym := range Ctxt.Textp { + sym.Sect = sect + if sym.Type&obj.SSUB != 0 { +@@ -1948,9 +1957,30 @@ func textaddress() { + } else { + va += uint64(sym.Size) + } ++ // On ppc64x a text section should not be larger than 2^26 bytes due to the size of ++ // call target offset field in the bl instruction. Splitting into text ++ // sections smaller than this limit allows the GNU linker to modify the long calls ++ // appropriately. The limit allows for the space for linker tables. ++ ++ // Only break at outermost syms. ++ ++ if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > uint64(0x1c00000) { ++ ++ // Set the length for the previous text section ++ sect.Length = va - sect.Vaddr ++ ++ // Create new section, set the starting Vaddr ++ sect = addsection(&Segtext, ".text", 05) ++ sect.Vaddr = va ++ ++ // Create a symbol for the start and end of the secondary text section ++ Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0).Sect = sect ++ n++ ++ } + } + + sect.Length = va - sect.Vaddr ++ Linklookup(Ctxt, "runtime.etext", 0).Sect = sect + } + + // assign addresses +@@ -2057,11 +2087,27 @@ func address() { + Segdwarf.Filelen = va - Segdwarf.Vaddr + + text := Segtext.Sect ++ lasttext := text + var rodata *Section + if Segrodata.Sect != nil { + rodata = Segrodata.Sect + } else { +- rodata = text.Next ++ // Could be multiple .text sections ++ n := 1 ++ for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next { ++ if sect.Name != ".text" { ++ break ++ } ++ lasttext = sect ++ symname := fmt.Sprintf("runtime.text.%d", n) ++ xdefine(symname, obj.STEXT, int64(sect.Vaddr)) ++ n++ ++ } ++ ++ rodata = lasttext.Next ++ if rodata != nil && rodata.Name != ".rodata" { ++ Diag("Unexpected section order in text segment") ++ } + } + var relrodata *Section + typelink := rodata.Next +@@ -2108,7 +2154,7 @@ func address() { + } + + xdefine("runtime.text", obj.STEXT, int64(text.Vaddr)) +- xdefine("runtime.etext", obj.STEXT, int64(text.Vaddr+text.Length)) ++ xdefine("runtime.etext", obj.STEXT, int64(lasttext.Vaddr+lasttext.Length)) + if HEADTYPE == obj.Hwindows { + xdefine(".text", obj.STEXT, int64(text.Vaddr)) + } +diff --git a/src/cmd/link/internal/ld/elf.go b/src/cmd/link/internal/ld/elf.go +index 39d3609..ecb00c2 100644 +--- a/src/cmd/link/internal/ld/elf.go ++++ b/src/cmd/link/internal/ld/elf.go +@@ -1623,6 +1623,25 @@ func elfshname(name string) *ElfShdr { + return nil + } + ++// Create an ElfShdr for the section with name. ++// A new one is created even if one already exists with ++// the same name. ++func elfshnamedup(name string) *ElfShdr { ++ var off int ++ var sh *ElfShdr ++ ++ for i := 0; i < nelfstr; i++ { ++ if name == elfstr[i].s { ++ off = elfstr[i].off ++ sh = newElfShdr(int64(off)) ++ return sh ++ } ++ } ++ Diag("cannot find elf name %s", name) ++ errorexit() ++ return nil ++} ++ + func elfshalloc(sect *Section) *ElfShdr { + sh := elfshname(sect.Name) + sect.Elfsect = sh +@@ -1630,7 +1649,17 @@ func elfshalloc(sect *Section) *ElfShdr { + } + + func elfshbits(sect *Section) *ElfShdr { +- sh := elfshalloc(sect) ++ var sh *ElfShdr ++ ++ if sect.Name == ".text" { ++ if sect.Elfsect == nil { ++ sect.Elfsect = elfshnamedup(sect.Name) ++ } ++ sh = sect.Elfsect ++ } else { ++ sh = elfshalloc(sect) ++ } ++ + // If this section has already been set up as a note, we assume type_ and + // flags are already correct, but the other fields still need filling in. + if sh.type_ == SHT_NOTE { +@@ -1706,6 +1735,15 @@ func elfshreloc(sect *Section) *ElfShdr { + } + + sh := elfshname(elfRelType + sect.Name) ++ ++ // There could be multiple text sections but each needs ++ // its own .rela.text. ++ if sect.Name == ".text" { ++ if sh.info != 0 && sh.info != uint32(sect.Elfsect.shnum) { ++ sh = elfshnamedup(elfRelType + sect.Name) ++ } ++ } ++ + sh.type_ = uint32(typ) + sh.entsize = uint64(SysArch.RegSize) * 2 + if typ == SHT_RELA { +@@ -1776,9 +1814,12 @@ func Elfemitreloc() { + Cput(0) + } + +- elfrelocsect(Segtext.Sect, Ctxt.Textp) +- for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next { +- elfrelocsect(sect, datap) ++ for sect := Segtext.Sect; sect != nil; sect = sect.Next { ++ if sect.Name == ".text" { ++ elfrelocsect(sect, Ctxt.Textp) ++ } else { ++ elfrelocsect(sect, datap) ++ } + } + for sect := Segrodata.Sect; sect != nil; sect = sect.Next { + elfrelocsect(sect, datap) +@@ -2109,7 +2150,16 @@ func Asmbelfsetup() { + elfshname("") + + for sect := Segtext.Sect; sect != nil; sect = sect.Next { +- elfshalloc(sect) ++ ++ // There could be multiple .text sections. Instead check the Elfsect ++ // field to determine if already has an ElfShdr and if not, create one. ++ if sect.Name == ".text" { ++ if sect.Elfsect == nil { ++ sect.Elfsect = elfshnamedup(sect.Name) ++ } ++ } else { ++ elfshalloc(sect) ++ } + } + for sect := Segrodata.Sect; sect != nil; sect = sect.Next { + elfshalloc(sect) +diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go +index 14f4fa9..709e7ca 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -1956,6 +1956,26 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) { + if s.Type == obj.STEXT { + put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil) + } ++ n := 0 ++ ++ // Generate base addresses for all text sections if there are multiple ++ for sect := Segtext.Sect; sect != nil; sect = sect.Next { ++ if n == 0 { ++ n++ ++ continue ++ } ++ if sect.Name != ".text" { ++ break ++ } ++ s = Linkrlookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0) ++ if s == nil { ++ break ++ } ++ if s.Type == obj.STEXT { ++ put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil) ++ } ++ n++ ++ } + s = Linklookup(Ctxt, "runtime.etext", 0) + if s.Type == obj.STEXT { + put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil) +diff --git a/src/cmd/link/internal/ld/symtab.go b/src/cmd/link/internal/ld/symtab.go +index 06d7792..80eb33d 100644 +--- a/src/cmd/link/internal/ld/symtab.go ++++ b/src/cmd/link/internal/ld/symtab.go +@@ -315,6 +315,62 @@ func (libs byPkg) Swap(a, b int) { + libs[a], libs[b] = libs[b], libs[a] + } + ++// Create a table with information on the text sections. ++ ++func textsectionmap() uint32 { ++ ++ t := Linklookup(Ctxt, "runtime.textsectionmap", 0) ++ t.Type = obj.SRODATA ++ t.Attr |= AttrReachable ++ nsections := int64(0) ++ ++ for sect := Segtext.Sect; sect != nil; sect = sect.Next { ++ if sect.Name == ".text" { ++ nsections++ ++ } else { ++ break ++ } ++ } ++ Symgrow(Ctxt, t, nsections*3*8) ++ ++ off := int64(0) ++ n := 0 ++ ++ // The vaddr for each text section is the difference between the section's ++ // Vaddr and the Vaddr for the first text section as determined at compile ++ // time. ++ ++ // The symbol name for the start address of the first text section is ++ // runtime.text. Additional text sections are named runtime.text.n where n is the ++ // order of creation starting with 1. These symbols provide the section's ++ // start address after relocation by the linker. ++ ++ textbase := Segtext.Sect.Vaddr ++ for sect := Segtext.Sect; sect != nil; sect = sect.Next { ++ if sect.Name != ".text" { ++ break ++ } ++ off = setuintxx(Ctxt, t, off, sect.Vaddr-textbase, int64(SysArch.IntSize)) ++ off = setuintxx(Ctxt, t, off, sect.Length, int64(SysArch.IntSize)) ++ if n == 0 { ++ s := Linkrlookup(Ctxt, "runtime.text", 0) ++ if s == nil { ++ Diag("Unable to find symbol runtime.text\n") ++ } ++ off = setaddr(Ctxt, t, off, s) ++ ++ } else { ++ s := Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0) ++ if s == nil { ++ Diag("Unable to find symbol runtime.text.%d\n", n) ++ } ++ off = setaddr(Ctxt, t, off, s) ++ } ++ n++ ++ } ++ return uint32(n) ++} ++ + func symtab() { + dosymtype() + +@@ -489,6 +545,8 @@ func symtab() { + adduint(Ctxt, abihashgostr, uint64(hashsym.Size)) + } + ++ nsections := textsectionmap() ++ + // Information about the layout of the executable image for the + // runtime to use. Any changes here must be matched by changes to + // the definition of moduledata in runtime/symtab.go. +@@ -527,6 +585,12 @@ func symtab() { + Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.gcbss", 0)) + Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.types", 0)) + Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.etypes", 0)) ++ ++ // text section information ++ Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.textsectionmap", 0)) ++ adduint(Ctxt, moduledata, uint64(nsections)) ++ adduint(Ctxt, moduledata, uint64(nsections)) ++ + // The typelinks slice + Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.typelink", 0)) + adduint(Ctxt, moduledata, uint64(ntypelinks)) +diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go +index bd2e23f..ab59fa8 100644 +--- a/src/cmd/link/internal/ppc64/asm.go ++++ b/src/cmd/link/internal/ppc64/asm.go +@@ -813,12 +813,14 @@ func asmb() { + ld.Asmbelfsetup() + } + +- sect := ld.Segtext.Sect +- ld.Cseek(int64(sect.Vaddr - ld.Segtext.Vaddr + ld.Segtext.Fileoff)) +- ld.Codeblk(int64(sect.Vaddr), int64(sect.Length)) +- for sect = sect.Next; sect != nil; sect = sect.Next { ++ for sect := ld.Segtext.Sect; sect != nil; sect = sect.Next { + ld.Cseek(int64(sect.Vaddr - ld.Segtext.Vaddr + ld.Segtext.Fileoff)) +- ld.Datblk(int64(sect.Vaddr), int64(sect.Length)) ++ // Might have multiple text sections ++ if sect.Name == ".text" { ++ ld.Codeblk(int64(sect.Vaddr), int64(sect.Length)) ++ } else { ++ ld.Datblk(int64(sect.Vaddr), int64(sect.Length)) ++ } + } + + if ld.Segrodata.Filelen > 0 { +diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go +index 4f6fae2..23e80ce 100644 +--- a/src/runtime/symtab.go ++++ b/src/runtime/symtab.go +@@ -195,8 +195,9 @@ type moduledata struct { + end, gcdata, gcbss uintptr + types, etypes uintptr + +- typelinks []int32 // offsets from types +- itablinks []*itab ++ textsectmap []textsect ++ typelinks []int32 // offsets from types ++ itablinks []*itab + + modulename string + modulehashes []modulehash +@@ -226,6 +227,14 @@ type functab struct { + funcoff uintptr + } + ++// Mapping information for secondary text sections ++ ++type textsect struct { ++ vaddr uint64 // prelinked section vaddr ++ length uint64 // section length ++ baseaddr uintptr // relocated section address ++} ++ + const minfunc = 16 // minimum function size + const pcbucketsize = 256 * minfunc // size of bucket in the pc->func lookup table + +@@ -368,12 +377,23 @@ func findfunc(pc uintptr) *_func { + ffb := (*findfuncbucket)(add(unsafe.Pointer(datap.findfunctab), b*unsafe.Sizeof(findfuncbucket{}))) + idx := ffb.idx + uint32(ffb.subbuckets[i]) + if pc < datap.ftab[idx].entry { +- throw("findfunc: bad findfunctab entry") +- } + +- // linear search to find func with pc >= entry. +- for datap.ftab[idx+1].entry <= pc { +- idx++ ++ // If there are multiple text sections then the buckets for the secondary ++ // text sections will be off because the addresses in those text sections ++ // were relocated to higher addresses. Search back to find it. ++ ++ for datap.ftab[idx].entry > pc && idx > 0 { ++ idx-- ++ } ++ if idx == 0 { ++ throw("findfunc: bad findfunctab entry idx") ++ } ++ } else { ++ ++ // linear search to find func with pc >= entry. ++ for datap.ftab[idx+1].entry <= pc { ++ idx++ ++ } + } + return (*_func)(unsafe.Pointer(&datap.pclntable[datap.ftab[idx].funcoff])) + } +diff --git a/src/runtime/type.go b/src/runtime/type.go +index 5ef11a4..f641adc 100644 +--- a/src/runtime/type.go ++++ b/src/runtime/type.go +@@ -257,7 +257,21 @@ func (t *_type) textOff(off textOff) unsafe.Pointer { + } + return res + } +- res := md.text + uintptr(off) ++ res := uintptr(0) ++ ++ // Find the text section range that contains the offset to determine the section's base ++ // address. In cases where there are multiple text sections, the base address might be ++ // relocated by the linker. ++ ++ for i := 0; i < len(md.textsectmap); i++ { ++ sectaddr := md.textsectmap[i].vaddr ++ sectlen := md.textsectmap[i].length ++ if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen { ++ res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr) ++ break ++ } ++ } ++ + if res > md.etext { + println("runtime: textOff", hex(off), "out of range", hex(md.text), "-", hex(md.etext)) + throw("runtime: text offset out of range") diff --git a/ppc64x-overflow-2.patch b/ppc64x-overflow-2.patch new file mode 100644 index 0000000..35dfc0e --- /dev/null +++ b/ppc64x-overflow-2.patch @@ -0,0 +1,150 @@ +From a5b97a846d70cd8db7f33c24f2b9159f935ce318 Mon Sep 17 00:00:00 2001 +From: Lynn Boger +Date: Tue, 13 Sep 2016 15:13:08 -0500 +Subject: [PATCH] cmd/compile: large text sections on ppc64le + +Additional fixes as submitted upstream. +--- + src/cmd/link/internal/ld/data.go | 24 ++++++++++++------------ + src/cmd/link/internal/ld/lib.go | 2 +- + src/cmd/link/internal/ld/symtab.go | 2 +- + src/runtime/type.go | 28 ++++++++++++++++++---------- + 4 files changed, 32 insertions(+), 24 deletions(-) + +diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go +index 58ce18c..d8e43ff 100644 +--- a/src/cmd/link/internal/ld/data.go ++++ b/src/cmd/link/internal/ld/data.go +@@ -531,7 +531,7 @@ func relocsym(s *LSym) { + // The method offset tables using this relocation expect the offset to be relative + // to the start of the first text section, even if there are multiple. + +- if Linkmode == LinkExternal && r.Sym.Sect.Name == ".text" && r.Sym.Sect.Vaddr != Segtext.Vaddr { ++ if r.Sym.Sect.Name == ".text" { + o = Symaddr(r.Sym) - int64(Segtext.Vaddr) + r.Add + } else { + o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add +@@ -1928,7 +1928,6 @@ func textaddress() { + + sect.Align = int32(Funcalign) + Linklookup(Ctxt, "runtime.text", 0).Sect = sect +- Linklookup(Ctxt, "runtime.etext", 0).Sect = sect + if HEADTYPE == obj.Hwindows { + Linklookup(Ctxt, ".text", 0).Sect = sect + } +@@ -1964,7 +1963,7 @@ func textaddress() { + + // Only break at outermost syms. + +- if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > uint64(0x1c00000) { ++ if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > 0x1c00000 { + + // Set the length for the previous text section + sect.Length = va - sect.Vaddr +@@ -1973,7 +1972,7 @@ func textaddress() { + sect = addsection(&Segtext, ".text", 05) + sect.Vaddr = va + +- // Create a symbol for the start and end of the secondary text section ++ // Create a symbol for the start of the secondary text section + Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0).Sect = sect + n++ + } +@@ -2093,15 +2092,8 @@ func address() { + rodata = Segrodata.Sect + } else { + // Could be multiple .text sections +- n := 1 +- for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next { +- if sect.Name != ".text" { +- break +- } ++ for sect := Segtext.Sect.Next; sect != nil && sect.Name == ".text"; sect = sect.Next { + lasttext = sect +- symname := fmt.Sprintf("runtime.text.%d", n) +- xdefine(symname, obj.STEXT, int64(sect.Vaddr)) +- n++ + } + + rodata = lasttext.Next +@@ -2155,6 +2147,14 @@ func address() { + + xdefine("runtime.text", obj.STEXT, int64(text.Vaddr)) + xdefine("runtime.etext", obj.STEXT, int64(lasttext.Vaddr+lasttext.Length)) ++ ++ n := 1 ++ for sect := Segtext.Sect.Next; sect != nil && sect.Name == ".text"; sect = sect.Next { ++ symname := fmt.Sprintf("runtime.text.%d", n) ++ xdefine(symname, obj.STEXT, int64(sect.Vaddr)) ++ n++ ++ } ++ + if HEADTYPE == obj.Hwindows { + xdefine(".text", obj.STEXT, int64(text.Vaddr)) + } +diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go +index 709e7ca..c37ef92 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -1958,7 +1958,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) { + } + n := 0 + +- // Generate base addresses for all text sections if there are multiple ++ // Generate base addresses for all text sections if there are multiple. + for sect := Segtext.Sect; sect != nil; sect = sect.Next { + if n == 0 { + n++ +diff --git a/src/cmd/link/internal/ld/symtab.go b/src/cmd/link/internal/ld/symtab.go +index 80eb33d..ec26f88 100644 +--- a/src/cmd/link/internal/ld/symtab.go ++++ b/src/cmd/link/internal/ld/symtab.go +@@ -331,7 +331,7 @@ func textsectionmap() uint32 { + break + } + } +- Symgrow(Ctxt, t, nsections*3*8) ++ Symgrow(Ctxt, t, nsections*(2*int64(SysArch.IntSize)+int64(SysArch.PtrSize))) + + off := int64(0) + n := 0 +diff --git a/src/runtime/type.go b/src/runtime/type.go +index f641adc..d4df5a9 100644 +--- a/src/runtime/type.go ++++ b/src/runtime/type.go +@@ -259,17 +259,25 @@ func (t *_type) textOff(off textOff) unsafe.Pointer { + } + res := uintptr(0) + +- // Find the text section range that contains the offset to determine the section's base +- // address. In cases where there are multiple text sections, the base address might be +- // relocated by the linker. +- +- for i := 0; i < len(md.textsectmap); i++ { +- sectaddr := md.textsectmap[i].vaddr +- sectlen := md.textsectmap[i].length +- if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen { +- res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr) +- break ++ // The text, or instruction stream is generated as one large buffer. The off (offset) for a method is ++ // its offset within this buffer. If the total text size gets too large, there can be issues on platforms like ppc64 if ++ // the target of calls are too far for the call instruction. To resolve the large text issue, the text is split ++ // into multiple text sections to allow the linker to generate long calls when necessary. When this happens, the vaddr ++ // for each text section is set to its offset within the text. Each method's offset is compared against the section ++ // vaddrs and sizes to determine the containing section. Then the section relative offset is added to the section's ++ // relocated baseaddr to compute the method addess. ++ ++ if len(md.textsectmap) > 1 { ++ for i := 0; i < len(md.textsectmap); i++ { ++ sectaddr := md.textsectmap[i].vaddr ++ sectlen := md.textsectmap[i].length ++ if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen { ++ res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr) ++ break ++ } + } ++ } else { ++ res = md.text + uintptr(off) + } + + if res > md.etext { diff --git a/sources b/sources index f3a3cd9..8390332 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -433e2158e5c28fe24b11622df393cc46 go1.7.1.src.tar.gz +83d1b7bd4281479ab7d153e5152c9fc9 go1.7.3.src.tar.gz diff --git a/tzdata-fix.patch b/tzdata-fix.patch new file mode 100644 index 0000000..b7e6e41 --- /dev/null +++ b/tzdata-fix.patch @@ -0,0 +1,34 @@ +From c5434f2973a87acff76bac359236e690d632ce95 Mon Sep 17 00:00:00 2001 +From: Alberto Donizetti +Date: Thu, 29 Sep 2016 13:59:10 +0200 +Subject: [PATCH] time: update test for tzdata-2016g + +Fixes #17276 + +Change-Id: I0188cf9bc5fdb48c71ad929cc54206d03e0b96e4 +Reviewed-on: https://go-review.googlesource.com/29995 +Reviewed-by: Brad Fitzpatrick +Run-TryBot: Brad Fitzpatrick +TryBot-Result: Gobot Gobot +--- + src/time/time_test.go | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/time/time_test.go b/src/time/time_test.go +index 68236fd..2e47d08 100644 +--- a/src/time/time_test.go ++++ b/src/time/time_test.go +@@ -943,8 +943,11 @@ func TestLoadFixed(t *testing.T) { + // but Go and most other systems use "east is positive". + // So GMT+1 corresponds to -3600 in the Go zone, not +3600. + name, offset := Now().In(loc).Zone() +- if name != "GMT+1" || offset != -1*60*60 { +- t.Errorf("Now().In(loc).Zone() = %q, %d, want %q, %d", name, offset, "GMT+1", -1*60*60) ++ // The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1" ++ // on earlier versions; we accept both. (Issue #17276). ++ if !(name == "GMT+1" || name == "-01") || offset != -1*60*60 { ++ t.Errorf("Now().In(loc).Zone() = %q, %d, want %q or %q, %d", ++ name, offset, "GMT+1", "-01", -1*60*60) + } + } + From 85dfe1791720d1379105b38a2cd642d8cb960092 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Thu, 17 Nov 2016 16:08:36 -0500 Subject: [PATCH 094/156] re-enable the NIST P-224 curve --- golang-1.2-remove-ECC-p224.patch | 1172 ------------------------------ golang.spec | 11 +- 2 files changed, 4 insertions(+), 1179 deletions(-) delete mode 100644 golang-1.2-remove-ECC-p224.patch diff --git a/golang-1.2-remove-ECC-p224.patch b/golang-1.2-remove-ECC-p224.patch deleted file mode 100644 index 2b2d1a1..0000000 --- a/golang-1.2-remove-ECC-p224.patch +++ /dev/null @@ -1,1172 +0,0 @@ -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 fc25fd7..356e617 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") - } -@@ -98,11 +97,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") - } -@@ -135,11 +133,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") - } -@@ -170,11 +167,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") - } -@@ -236,8 +232,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": -@@ -314,7 +308,6 @@ func testNegativeInputs(t *testing.T, curve elliptic.Curve, tag string) { - } - - func TestNegativeInputs(t *testing.T) { -- testNegativeInputs(t, elliptic.P224(), "p224") - testNegativeInputs(t, elliptic.P256(), "p256") - testNegativeInputs(t, elliptic.P384(), "p384") - testNegativeInputs(t, elliptic.P521(), "p521") -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 c02df45..f713ad7 100644 ---- a/src/crypto/elliptic/elliptic.go -+++ b/src/crypto/elliptic/elliptic.go -@@ -338,7 +338,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 7f3f1a2..833668e 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++ { -@@ -454,14 +405,14 @@ func BenchmarkScalarMultP256(b *testing.B) { - } - - func TestMarshal(t *testing.T) { -- p224 := P224() -- _, x, y, err := GenerateKey(p224, 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(p256, x, y) -+ xx, yy := Unmarshal(p256, serialized) - if xx == nil { - t.Error("failed to unmarshal") - return -@@ -471,13 +422,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 de266ca..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 8b4fa04..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 9e6d67d..580831e 100644 ---- a/src/crypto/x509/x509.go -+++ b/src/crypto/x509/x509.go -@@ -340,9 +340,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 } -@@ -355,7 +352,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} -@@ -363,8 +359,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): -@@ -377,8 +371,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(): -@@ -1508,7 +1500,7 @@ func signingParamsForPublicKey(pub interface{}, requestedSigAlgo SignatureAlgori - pubType = ECDSA - - switch pub.Curve { -- case elliptic.P224(), elliptic.P256(): -+ case elliptic.P256(): - hashFunc = crypto.SHA256 - sigAlgo.Algorithm = oidSignatureECDSAWithSHA256 - case elliptic.P384(): diff --git a/golang.spec b/golang.spec index 4e30243..8afdcd8 100644 --- a/golang.spec +++ b/golang.spec @@ -91,7 +91,7 @@ Name: golang Version: 1.7.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -119,9 +119,6 @@ Requires: go-srpm-macros Patch0: golang-1.2-verbose-build.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1038683 -Patch1: golang-1.2-remove-ECC-p224.patch - # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch @@ -254,9 +251,6 @@ Summary: Golang shared object libraries # increase verbosity of build %patch0 -p1 -b .verbose -# remove the P224 curve -%patch1 -p1 -b .curve - # use the arch dependent path in the bootstrap %patch212 -p1 -b .bootstrap @@ -486,6 +480,9 @@ fi %endif %changelog +* Thu Nov 17 2016 Tom Callaway - 1.7.3-2 +- re-enable the NIST P-224 curve + * Thu Oct 20 2016 Jakub Čajka - 1.7.3-1 - Resolves: BZ#1387067 - golang-1.7.3 is available - added fix for tests failing with latest tzdata From 45a3692f231069585527548bc26471644e5347db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 18 Nov 2016 11:21:08 +0100 Subject: [PATCH 095/156] enable back p224 curve(see BZ#1038683) --- golang-1.2-remove-ECC-p224.patch | 1172 ------------------------------ golang.spec | 11 +- 2 files changed, 4 insertions(+), 1179 deletions(-) delete mode 100644 golang-1.2-remove-ECC-p224.patch diff --git a/golang-1.2-remove-ECC-p224.patch b/golang-1.2-remove-ECC-p224.patch deleted file mode 100644 index 2b2d1a1..0000000 --- a/golang-1.2-remove-ECC-p224.patch +++ /dev/null @@ -1,1172 +0,0 @@ -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 fc25fd7..356e617 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") - } -@@ -98,11 +97,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") - } -@@ -135,11 +133,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") - } -@@ -170,11 +167,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") - } -@@ -236,8 +232,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": -@@ -314,7 +308,6 @@ func testNegativeInputs(t *testing.T, curve elliptic.Curve, tag string) { - } - - func TestNegativeInputs(t *testing.T) { -- testNegativeInputs(t, elliptic.P224(), "p224") - testNegativeInputs(t, elliptic.P256(), "p256") - testNegativeInputs(t, elliptic.P384(), "p384") - testNegativeInputs(t, elliptic.P521(), "p521") -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 c02df45..f713ad7 100644 ---- a/src/crypto/elliptic/elliptic.go -+++ b/src/crypto/elliptic/elliptic.go -@@ -338,7 +338,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 7f3f1a2..833668e 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++ { -@@ -454,14 +405,14 @@ func BenchmarkScalarMultP256(b *testing.B) { - } - - func TestMarshal(t *testing.T) { -- p224 := P224() -- _, x, y, err := GenerateKey(p224, 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(p256, x, y) -+ xx, yy := Unmarshal(p256, serialized) - if xx == nil { - t.Error("failed to unmarshal") - return -@@ -471,13 +422,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 de266ca..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 8b4fa04..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 9e6d67d..580831e 100644 ---- a/src/crypto/x509/x509.go -+++ b/src/crypto/x509/x509.go -@@ -340,9 +340,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 } -@@ -355,7 +352,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} -@@ -363,8 +359,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): -@@ -377,8 +371,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(): -@@ -1508,7 +1500,7 @@ func signingParamsForPublicKey(pub interface{}, requestedSigAlgo SignatureAlgori - pubType = ECDSA - - switch pub.Curve { -- case elliptic.P224(), elliptic.P256(): -+ case elliptic.P256(): - hashFunc = crypto.SHA256 - sigAlgo.Algorithm = oidSignatureECDSAWithSHA256 - case elliptic.P384(): diff --git a/golang.spec b/golang.spec index 662dbb9..460c082 100644 --- a/golang.spec +++ b/golang.spec @@ -48,7 +48,7 @@ Name: golang Version: 1.7.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -71,9 +71,6 @@ 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 - # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch @@ -208,9 +205,6 @@ Summary: Golang shared object libraries # increase verbosity of build %patch0 -p1 -b .verbose -# remove the P224 curve -%patch1 -p1 -b .curve - # use the arch dependent path in the bootstrap %patch212 -p1 -b .bootstrap @@ -450,6 +444,9 @@ fi %endif %changelog +* Fri Nov 18 2016 Jakub Čajka - 1.7.3-2 +- enable back p224 curve(see BZ#1038683) + * Fri Oct 21 2016 Jakub Čajka - 1.7.3-1 - rebase to go1.7.3 - Fix possible relocation overflows on ppc From 66c8bd859325fa595ac56f819cb625e9df19b734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 2 Dec 2016 12:06:39 +0100 Subject: [PATCH 096/156] Bump to 1.7.4 Resolves: BZ#1400732 --- .gitignore | 1 + golang.spec | 10 +++++++--- sources | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 43a2a7e..5019b0d 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ /go1.7.src.tar.gz /go1.7.1.src.tar.gz /go1.7.3.src.tar.gz +/go1.7.4.src.tar.gz diff --git a/golang.spec b/golang.spec index 8afdcd8..1b595ab 100644 --- a/golang.spec +++ b/golang.spec @@ -87,11 +87,11 @@ %endif %global go_api 1.7 -%global go_version 1.7.3 +%global go_version 1.7.4 Name: golang -Version: 1.7.3 -Release: 2%{?dist} +Version: 1.7.4 +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -480,6 +480,10 @@ fi %endif %changelog +* Fri Dec 02 2016 Jakub Čajka - 1.7.4-1 +- Bump to 1.7.4 +- Resolves: BZ#1400732 + * Thu Nov 17 2016 Tom Callaway - 1.7.3-2 - re-enable the NIST P-224 curve diff --git a/sources b/sources index 8390332..a66d54c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -83d1b7bd4281479ab7d153e5152c9fc9 go1.7.3.src.tar.gz +49c1076428a5d3b5ad7ac65233fcca2f go1.7.4.src.tar.gz From e3d5bfee3fd0699a378638692b8b1cd2766c863d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 5 Dec 2016 14:21:12 +0100 Subject: [PATCH 097/156] Bump to 1.7.4 Resolves: BZ#1400732 --- .gitignore | 1 + golang.spec | 10 +++++++--- sources | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 72f9827..ec82f39 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ /go1.5.1.src.tar.gz /go1.7.1.src.tar.gz /go1.7.3.src.tar.gz +/go1.7.4.src.tar.gz diff --git a/golang.spec b/golang.spec index 460c082..35324fe 100644 --- a/golang.spec +++ b/golang.spec @@ -44,11 +44,11 @@ %endif %global go_api 1.7 -%global go_version 1.7.3 +%global go_version 1.7.4 Name: golang -Version: 1.7.3 -Release: 2%{?dist} +Version: 1.7.4 +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -444,6 +444,10 @@ fi %endif %changelog +* Mon Dec 05 2016 Jakub Čajka - 1.7.4-1 +- Bump to 1.7.4 +- Resolves: BZ#1400732 + * Fri Nov 18 2016 Jakub Čajka - 1.7.3-2 - enable back p224 curve(see BZ#1038683) diff --git a/sources b/sources index 8390332..a66d54c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -83d1b7bd4281479ab7d153e5152c9fc9 go1.7.3.src.tar.gz +49c1076428a5d3b5ad7ac65233fcca2f go1.7.4.src.tar.gz From 0dbd49fdd719776427e8929807dcc4d76d0565cb Mon Sep 17 00:00:00 2001 From: Jakub Cajka Date: Fri, 20 Jan 2017 14:51:16 +0100 Subject: [PATCH 098/156] Resolves: BZ#1404679 expose IfInfomsg.X__ifi_pad on s390x --- golang.spec | 11 +++++++- s390x-expose-IfInfomsg-X__ifi_pad.patch | 36 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 s390x-expose-IfInfomsg-X__ifi_pad.patch diff --git a/golang.spec b/golang.spec index 1b595ab..eddcba8 100644 --- a/golang.spec +++ b/golang.spec @@ -91,7 +91,7 @@ Name: golang Version: 1.7.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -137,6 +137,9 @@ Patch217: ppc64x-overflow-2.patch # Fix for https://github.com/golang/go/issues/17276 Patch218: tzdata-fix.patch +# Proposed patch by mmunday https://golang.org/cl/35262 +Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -264,6 +267,8 @@ Summary: Golang shared object libraries %patch218 -p1 +%patch219 -p1 + %build # print out system information uname -a @@ -480,6 +485,10 @@ fi %endif %changelog +* Fri Jan 20 2017 Jakub Čajka - 1.7.4-2 +- Resolves: BZ#1404679 +- expose IfInfomsg.X__ifi_pad on s390x + * Fri Dec 02 2016 Jakub Čajka - 1.7.4-1 - Bump to 1.7.4 - Resolves: BZ#1400732 diff --git a/s390x-expose-IfInfomsg-X__ifi_pad.patch b/s390x-expose-IfInfomsg-X__ifi_pad.patch new file mode 100644 index 0000000..ec53077 --- /dev/null +++ b/s390x-expose-IfInfomsg-X__ifi_pad.patch @@ -0,0 +1,36 @@ +From 84b8c9ceaa5257f7ff4ab059ff208246ecdfe9d9 Mon Sep 17 00:00:00 2001 +From: Michael Munday +Date: Tue, 17 Jan 2017 11:33:38 -0500 +Subject: [PATCH] syscall: expose IfInfomsg.X__ifi_pad on s390x + +Exposing this field on s390x improves compatibility with the other +linux architectures, all of which already expose it. + +Fixes #18628 and updates #18632. + +Change-Id: I08e8e1eb705f898cd8822f8bee0d61ce11d514b5 +--- + +diff --git a/src/syscall/ztypes_linux_s390x.go b/src/syscall/ztypes_linux_s390x.go +index 63c4a83..b589425 100644 +--- a/src/syscall/ztypes_linux_s390x.go ++++ b/src/syscall/ztypes_linux_s390x.go +@@ -449,12 +449,12 @@ + } + + type IfInfomsg struct { +- Family uint8 +- _ uint8 +- Type uint16 +- Index int32 +- Flags uint32 +- Change uint32 ++ Family uint8 ++ X__ifi_pad uint8 ++ Type uint16 ++ Index int32 ++ Flags uint32 ++ Change uint32 + } + + type IfAddrmsg struct { From 100fcef237a5deb09cc6bf1b86ba2c6c264311e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 27 Jan 2017 11:39:40 +0100 Subject: [PATCH 099/156] rebase to go1.8rc3 Resolves: BZ#1411242 --- .gitignore | 1 + go1.5beta1-disable-TestGdbPython.patch | 12 - golang-1.5-bootstrap-binary-path.patch | 20 +- golang.spec | 31 +- ppc64x-overflow-1.patch | 457 ------------------------- ppc64x-overflow-2.patch | 150 -------- sources | 2 +- tzdata-fix.patch | 34 -- 8 files changed, 21 insertions(+), 686 deletions(-) delete mode 100644 go1.5beta1-disable-TestGdbPython.patch delete mode 100644 ppc64x-overflow-1.patch delete mode 100644 ppc64x-overflow-2.patch delete mode 100644 tzdata-fix.patch diff --git a/.gitignore b/.gitignore index 5019b0d..3554a3c 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ /go1.7.1.src.tar.gz /go1.7.3.src.tar.gz /go1.7.4.src.tar.gz +/go1.8rc3.src.tar.gz diff --git a/go1.5beta1-disable-TestGdbPython.patch b/go1.5beta1-disable-TestGdbPython.patch deleted file mode 100644 index 89d7d68..0000000 --- a/go1.5beta1-disable-TestGdbPython.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up go/src/runtime/runtime-gdb_test.go.gdb go/src/runtime/runtime-gdb_test.go ---- go/src/runtime/runtime-gdb_test.go.gdb 2016-04-28 10:31:13.005689813 +0200 -+++ go/src/runtime/runtime-gdb_test.go 2016-04-28 10:32:12.202935125 +0200 -@@ -72,7 +72,7 @@ func main() { - } - ` - --func TestGdbPython(t *testing.T) { -+func testGdbPython(t *testing.T) { - checkGdbEnvironment(t) - checkGdbVersion(t) - checkGdbPython(t) diff --git a/golang-1.5-bootstrap-binary-path.patch b/golang-1.5-bootstrap-binary-path.patch index 5ef35ac..d0e1f34 100644 --- a/golang-1.5-bootstrap-binary-path.patch +++ b/golang-1.5-bootstrap-binary-path.patch @@ -1,7 +1,7 @@ diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go ---- go/src/cmd/dist/buildtool.go.bootstrap 2016-06-06 14:26:37.638374670 +0200 -+++ go/src/cmd/dist/buildtool.go 2016-06-06 14:30:33.873262307 +0200 -@@ -111,15 +111,23 @@ func bootstrapBuildTools() { +--- go/src/cmd/dist/buildtool.go.bootstrap 2016-10-24 12:54:57.620563325 +0200 ++++ go/src/cmd/dist/buildtool.go 2016-10-24 13:12:25.036466602 +0200 +@@ -131,17 +131,25 @@ func bootstrapBuildTools() { defer os.Setenv("GOBIN", os.Getenv("GOBIN")) os.Setenv("GOBIN", "") @@ -21,15 +21,17 @@ diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go // Run Go 1.4 to build binaries. Use -gcflags=-l to disable inlining to // workaround bugs in Go 1.4's compiler. See discussion thread: // https://groups.google.com/d/msg/golang-dev/Ss7mCKsvk8w/Gsq7VYI0AwAJ -- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-gcflags=-l", "-v", "bootstrap/...") -+ run(workspace, ShowOutput|CheckExit, bingopath, "install", "-gcflags=-l", "-v", "bootstrap/...") + // Use the math_big_pure_go build tag to disable the assembly in math/big + // which may contain unsupported instructions. +- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-gcflags=-l", "-tags=math_big_pure_go", "-v", "bootstrap/cmd/...") ++ run(workspace, ShowOutput|CheckExit, bingopath, "install", "-gcflags=-l", "-v", "-tags=math_big_pure_go", "bootstrap/...") // Copy binaries into tool binary directory. for _, name := range bootstrapDirs { diff -up go/src/make.bash.bootstrap go/src/make.bash ---- go/src/make.bash.bootstrap 2016-06-06 14:26:37.628374633 +0200 -+++ go/src/make.bash 2016-06-06 14:26:37.638374670 +0200 -@@ -118,8 +118,15 @@ echo '##### Building Go bootstrap tool.' +--- go/src/make.bash.bootstrap 2016-10-24 12:54:57.606563267 +0200 ++++ go/src/make.bash 2016-10-24 12:54:57.620563325 +0200 +@@ -120,8 +120,15 @@ echo '##### Building Go bootstrap tool.' echo cmd/dist export GOROOT="$(cd .. && pwd)" GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4} @@ -47,7 +49,7 @@ diff -up go/src/make.bash.bootstrap go/src/make.bash echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 exit 1 fi -@@ -128,8 +135,6 @@ if [ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]; +@@ -130,8 +137,6 @@ if [ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]; echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 exit 1 fi diff --git a/golang.spec b/golang.spec index eddcba8..1b2bca0 100644 --- a/golang.spec +++ b/golang.spec @@ -86,12 +86,12 @@ %global gohostarch s390x %endif -%global go_api 1.7 -%global go_version 1.7.4 +%global go_api 1.8 +%global go_version 1.8rc3 Name: golang -Version: 1.7.4 -Release: 2%{?dist} +Version: 1.8 +Release: 0.rc3.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -122,21 +122,10 @@ Patch0: golang-1.2-verbose-build.patch # use the arch dependent path in the bootstrap Patch212: golang-1.5-bootstrap-binary-path.patch -# disable TestGdbPython -# https://github.com/golang/go/issues/11214 -Patch213: go1.5beta1-disable-TestGdbPython.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 -#PPC64X relocation overflow fix -Patch216: ppc64x-overflow-1.patch -Patch217: ppc64x-overflow-2.patch - -# Fix for https://github.com/golang/go/issues/17276 -Patch218: tzdata-fix.patch - # Proposed patch by mmunday https://golang.org/cl/35262 Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch @@ -257,16 +246,8 @@ Summary: Golang shared object libraries # use the arch dependent path in the bootstrap %patch212 -p1 -b .bootstrap -# disable TestGdbPython -%patch213 -p1 -b .gdb - %patch215 -p1 -%patch216 -p1 -%patch217 -p1 - -%patch218 -p1 - %patch219 -p1 %build @@ -485,6 +466,10 @@ fi %endif %changelog +* Fri Jan 27 2017 Jakub Čajka - 1.8-0.rc3.1 +- rebase to go1.8rc3 +- Resolves: BZ#1411242 + * Fri Jan 20 2017 Jakub Čajka - 1.7.4-2 - Resolves: BZ#1404679 - expose IfInfomsg.X__ifi_pad on s390x diff --git a/ppc64x-overflow-1.patch b/ppc64x-overflow-1.patch deleted file mode 100644 index 35e3e3d..0000000 --- a/ppc64x-overflow-1.patch +++ /dev/null @@ -1,457 +0,0 @@ -From d6beea7f9ea1aa2ae5abca7fccb252767820aa13 Mon Sep 17 00:00:00 2001 -From: Lynn Boger -Date: Tue, 26 Jul 2016 08:51:10 -0500 -Subject: [PATCH] cmd/link: split large elf text sections for ppc64x - -Some applications built with Go on ppc64x with -external linking can fail to link with relocation -truncation errors, due to the way that the golang -compiler generates a single go.o file containing -a single large text section to send to the GNU -linker. If the size of the single text section is -greater than 2^26, this can lead to link errors -due to 24 bit offset field in the bl (call) -instruction. - -This fix solves the problem by splitting into -multiple text sections when this limit is reached. -When this is done then the GNU linker can fix the -long calls and insert jump tables where needed. ---- - src/cmd/link/internal/ld/data.go | 52 +++++++++++++++++++++++++++++-- - src/cmd/link/internal/ld/elf.go | 60 ++++++++++++++++++++++++++++++++--- - src/cmd/link/internal/ld/lib.go | 20 ++++++++++++ - src/cmd/link/internal/ld/symtab.go | 64 ++++++++++++++++++++++++++++++++++++++ - src/cmd/link/internal/ppc64/asm.go | 12 ++++--- - src/runtime/symtab.go | 34 +++++++++++++++----- - src/runtime/type.go | 16 +++++++++- - 7 files changed, 237 insertions(+), 21 deletions(-) - -diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go -index 57a0dad..58ce18c 100644 ---- a/src/cmd/link/internal/ld/data.go -+++ b/src/cmd/link/internal/ld/data.go -@@ -527,7 +527,15 @@ func relocsym(s *LSym) { - o = Symaddr(r.Sym) + r.Add - int64(r.Sym.Sect.Vaddr) - - case obj.R_ADDROFF: -- o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add -+ -+ // The method offset tables using this relocation expect the offset to be relative -+ // to the start of the first text section, even if there are multiple. -+ -+ if Linkmode == LinkExternal && r.Sym.Sect.Name == ".text" && r.Sym.Sect.Vaddr != Segtext.Vaddr { -+ o = Symaddr(r.Sym) - int64(Segtext.Vaddr) + r.Add -+ } else { -+ o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add -+ } - - // r->sym can be null when CALL $(constant) is transformed from absolute PC to relative PC call. - case obj.R_CALL, obj.R_GOTPCREL, obj.R_PCREL: -@@ -1926,6 +1934,7 @@ func textaddress() { - } - va := uint64(INITTEXT) - sect.Vaddr = va -+ n := 1 - for _, sym := range Ctxt.Textp { - sym.Sect = sect - if sym.Type&obj.SSUB != 0 { -@@ -1948,9 +1957,30 @@ func textaddress() { - } else { - va += uint64(sym.Size) - } -+ // On ppc64x a text section should not be larger than 2^26 bytes due to the size of -+ // call target offset field in the bl instruction. Splitting into text -+ // sections smaller than this limit allows the GNU linker to modify the long calls -+ // appropriately. The limit allows for the space for linker tables. -+ -+ // Only break at outermost syms. -+ -+ if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > uint64(0x1c00000) { -+ -+ // Set the length for the previous text section -+ sect.Length = va - sect.Vaddr -+ -+ // Create new section, set the starting Vaddr -+ sect = addsection(&Segtext, ".text", 05) -+ sect.Vaddr = va -+ -+ // Create a symbol for the start and end of the secondary text section -+ Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0).Sect = sect -+ n++ -+ } - } - - sect.Length = va - sect.Vaddr -+ Linklookup(Ctxt, "runtime.etext", 0).Sect = sect - } - - // assign addresses -@@ -2057,11 +2087,27 @@ func address() { - Segdwarf.Filelen = va - Segdwarf.Vaddr - - text := Segtext.Sect -+ lasttext := text - var rodata *Section - if Segrodata.Sect != nil { - rodata = Segrodata.Sect - } else { -- rodata = text.Next -+ // Could be multiple .text sections -+ n := 1 -+ for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next { -+ if sect.Name != ".text" { -+ break -+ } -+ lasttext = sect -+ symname := fmt.Sprintf("runtime.text.%d", n) -+ xdefine(symname, obj.STEXT, int64(sect.Vaddr)) -+ n++ -+ } -+ -+ rodata = lasttext.Next -+ if rodata != nil && rodata.Name != ".rodata" { -+ Diag("Unexpected section order in text segment") -+ } - } - var relrodata *Section - typelink := rodata.Next -@@ -2108,7 +2154,7 @@ func address() { - } - - xdefine("runtime.text", obj.STEXT, int64(text.Vaddr)) -- xdefine("runtime.etext", obj.STEXT, int64(text.Vaddr+text.Length)) -+ xdefine("runtime.etext", obj.STEXT, int64(lasttext.Vaddr+lasttext.Length)) - if HEADTYPE == obj.Hwindows { - xdefine(".text", obj.STEXT, int64(text.Vaddr)) - } -diff --git a/src/cmd/link/internal/ld/elf.go b/src/cmd/link/internal/ld/elf.go -index 39d3609..ecb00c2 100644 ---- a/src/cmd/link/internal/ld/elf.go -+++ b/src/cmd/link/internal/ld/elf.go -@@ -1623,6 +1623,25 @@ func elfshname(name string) *ElfShdr { - return nil - } - -+// Create an ElfShdr for the section with name. -+// A new one is created even if one already exists with -+// the same name. -+func elfshnamedup(name string) *ElfShdr { -+ var off int -+ var sh *ElfShdr -+ -+ for i := 0; i < nelfstr; i++ { -+ if name == elfstr[i].s { -+ off = elfstr[i].off -+ sh = newElfShdr(int64(off)) -+ return sh -+ } -+ } -+ Diag("cannot find elf name %s", name) -+ errorexit() -+ return nil -+} -+ - func elfshalloc(sect *Section) *ElfShdr { - sh := elfshname(sect.Name) - sect.Elfsect = sh -@@ -1630,7 +1649,17 @@ func elfshalloc(sect *Section) *ElfShdr { - } - - func elfshbits(sect *Section) *ElfShdr { -- sh := elfshalloc(sect) -+ var sh *ElfShdr -+ -+ if sect.Name == ".text" { -+ if sect.Elfsect == nil { -+ sect.Elfsect = elfshnamedup(sect.Name) -+ } -+ sh = sect.Elfsect -+ } else { -+ sh = elfshalloc(sect) -+ } -+ - // If this section has already been set up as a note, we assume type_ and - // flags are already correct, but the other fields still need filling in. - if sh.type_ == SHT_NOTE { -@@ -1706,6 +1735,15 @@ func elfshreloc(sect *Section) *ElfShdr { - } - - sh := elfshname(elfRelType + sect.Name) -+ -+ // There could be multiple text sections but each needs -+ // its own .rela.text. -+ if sect.Name == ".text" { -+ if sh.info != 0 && sh.info != uint32(sect.Elfsect.shnum) { -+ sh = elfshnamedup(elfRelType + sect.Name) -+ } -+ } -+ - sh.type_ = uint32(typ) - sh.entsize = uint64(SysArch.RegSize) * 2 - if typ == SHT_RELA { -@@ -1776,9 +1814,12 @@ func Elfemitreloc() { - Cput(0) - } - -- elfrelocsect(Segtext.Sect, Ctxt.Textp) -- for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next { -- elfrelocsect(sect, datap) -+ for sect := Segtext.Sect; sect != nil; sect = sect.Next { -+ if sect.Name == ".text" { -+ elfrelocsect(sect, Ctxt.Textp) -+ } else { -+ elfrelocsect(sect, datap) -+ } - } - for sect := Segrodata.Sect; sect != nil; sect = sect.Next { - elfrelocsect(sect, datap) -@@ -2109,7 +2150,16 @@ func Asmbelfsetup() { - elfshname("") - - for sect := Segtext.Sect; sect != nil; sect = sect.Next { -- elfshalloc(sect) -+ -+ // There could be multiple .text sections. Instead check the Elfsect -+ // field to determine if already has an ElfShdr and if not, create one. -+ if sect.Name == ".text" { -+ if sect.Elfsect == nil { -+ sect.Elfsect = elfshnamedup(sect.Name) -+ } -+ } else { -+ elfshalloc(sect) -+ } - } - for sect := Segrodata.Sect; sect != nil; sect = sect.Next { - elfshalloc(sect) -diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go -index 14f4fa9..709e7ca 100644 ---- a/src/cmd/link/internal/ld/lib.go -+++ b/src/cmd/link/internal/ld/lib.go -@@ -1956,6 +1956,26 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) { - if s.Type == obj.STEXT { - put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil) - } -+ n := 0 -+ -+ // Generate base addresses for all text sections if there are multiple -+ for sect := Segtext.Sect; sect != nil; sect = sect.Next { -+ if n == 0 { -+ n++ -+ continue -+ } -+ if sect.Name != ".text" { -+ break -+ } -+ s = Linkrlookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0) -+ if s == nil { -+ break -+ } -+ if s.Type == obj.STEXT { -+ put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil) -+ } -+ n++ -+ } - s = Linklookup(Ctxt, "runtime.etext", 0) - if s.Type == obj.STEXT { - put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), nil) -diff --git a/src/cmd/link/internal/ld/symtab.go b/src/cmd/link/internal/ld/symtab.go -index 06d7792..80eb33d 100644 ---- a/src/cmd/link/internal/ld/symtab.go -+++ b/src/cmd/link/internal/ld/symtab.go -@@ -315,6 +315,62 @@ func (libs byPkg) Swap(a, b int) { - libs[a], libs[b] = libs[b], libs[a] - } - -+// Create a table with information on the text sections. -+ -+func textsectionmap() uint32 { -+ -+ t := Linklookup(Ctxt, "runtime.textsectionmap", 0) -+ t.Type = obj.SRODATA -+ t.Attr |= AttrReachable -+ nsections := int64(0) -+ -+ for sect := Segtext.Sect; sect != nil; sect = sect.Next { -+ if sect.Name == ".text" { -+ nsections++ -+ } else { -+ break -+ } -+ } -+ Symgrow(Ctxt, t, nsections*3*8) -+ -+ off := int64(0) -+ n := 0 -+ -+ // The vaddr for each text section is the difference between the section's -+ // Vaddr and the Vaddr for the first text section as determined at compile -+ // time. -+ -+ // The symbol name for the start address of the first text section is -+ // runtime.text. Additional text sections are named runtime.text.n where n is the -+ // order of creation starting with 1. These symbols provide the section's -+ // start address after relocation by the linker. -+ -+ textbase := Segtext.Sect.Vaddr -+ for sect := Segtext.Sect; sect != nil; sect = sect.Next { -+ if sect.Name != ".text" { -+ break -+ } -+ off = setuintxx(Ctxt, t, off, sect.Vaddr-textbase, int64(SysArch.IntSize)) -+ off = setuintxx(Ctxt, t, off, sect.Length, int64(SysArch.IntSize)) -+ if n == 0 { -+ s := Linkrlookup(Ctxt, "runtime.text", 0) -+ if s == nil { -+ Diag("Unable to find symbol runtime.text\n") -+ } -+ off = setaddr(Ctxt, t, off, s) -+ -+ } else { -+ s := Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0) -+ if s == nil { -+ Diag("Unable to find symbol runtime.text.%d\n", n) -+ } -+ off = setaddr(Ctxt, t, off, s) -+ } -+ n++ -+ } -+ return uint32(n) -+} -+ - func symtab() { - dosymtype() - -@@ -489,6 +545,8 @@ func symtab() { - adduint(Ctxt, abihashgostr, uint64(hashsym.Size)) - } - -+ nsections := textsectionmap() -+ - // Information about the layout of the executable image for the - // runtime to use. Any changes here must be matched by changes to - // the definition of moduledata in runtime/symtab.go. -@@ -527,6 +585,12 @@ func symtab() { - Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.gcbss", 0)) - Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.types", 0)) - Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.etypes", 0)) -+ -+ // text section information -+ Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.textsectionmap", 0)) -+ adduint(Ctxt, moduledata, uint64(nsections)) -+ adduint(Ctxt, moduledata, uint64(nsections)) -+ - // The typelinks slice - Addaddr(Ctxt, moduledata, Linklookup(Ctxt, "runtime.typelink", 0)) - adduint(Ctxt, moduledata, uint64(ntypelinks)) -diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go -index bd2e23f..ab59fa8 100644 ---- a/src/cmd/link/internal/ppc64/asm.go -+++ b/src/cmd/link/internal/ppc64/asm.go -@@ -813,12 +813,14 @@ func asmb() { - ld.Asmbelfsetup() - } - -- sect := ld.Segtext.Sect -- ld.Cseek(int64(sect.Vaddr - ld.Segtext.Vaddr + ld.Segtext.Fileoff)) -- ld.Codeblk(int64(sect.Vaddr), int64(sect.Length)) -- for sect = sect.Next; sect != nil; sect = sect.Next { -+ for sect := ld.Segtext.Sect; sect != nil; sect = sect.Next { - ld.Cseek(int64(sect.Vaddr - ld.Segtext.Vaddr + ld.Segtext.Fileoff)) -- ld.Datblk(int64(sect.Vaddr), int64(sect.Length)) -+ // Might have multiple text sections -+ if sect.Name == ".text" { -+ ld.Codeblk(int64(sect.Vaddr), int64(sect.Length)) -+ } else { -+ ld.Datblk(int64(sect.Vaddr), int64(sect.Length)) -+ } - } - - if ld.Segrodata.Filelen > 0 { -diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go -index 4f6fae2..23e80ce 100644 ---- a/src/runtime/symtab.go -+++ b/src/runtime/symtab.go -@@ -195,8 +195,9 @@ type moduledata struct { - end, gcdata, gcbss uintptr - types, etypes uintptr - -- typelinks []int32 // offsets from types -- itablinks []*itab -+ textsectmap []textsect -+ typelinks []int32 // offsets from types -+ itablinks []*itab - - modulename string - modulehashes []modulehash -@@ -226,6 +227,14 @@ type functab struct { - funcoff uintptr - } - -+// Mapping information for secondary text sections -+ -+type textsect struct { -+ vaddr uint64 // prelinked section vaddr -+ length uint64 // section length -+ baseaddr uintptr // relocated section address -+} -+ - const minfunc = 16 // minimum function size - const pcbucketsize = 256 * minfunc // size of bucket in the pc->func lookup table - -@@ -368,12 +377,23 @@ func findfunc(pc uintptr) *_func { - ffb := (*findfuncbucket)(add(unsafe.Pointer(datap.findfunctab), b*unsafe.Sizeof(findfuncbucket{}))) - idx := ffb.idx + uint32(ffb.subbuckets[i]) - if pc < datap.ftab[idx].entry { -- throw("findfunc: bad findfunctab entry") -- } - -- // linear search to find func with pc >= entry. -- for datap.ftab[idx+1].entry <= pc { -- idx++ -+ // If there are multiple text sections then the buckets for the secondary -+ // text sections will be off because the addresses in those text sections -+ // were relocated to higher addresses. Search back to find it. -+ -+ for datap.ftab[idx].entry > pc && idx > 0 { -+ idx-- -+ } -+ if idx == 0 { -+ throw("findfunc: bad findfunctab entry idx") -+ } -+ } else { -+ -+ // linear search to find func with pc >= entry. -+ for datap.ftab[idx+1].entry <= pc { -+ idx++ -+ } - } - return (*_func)(unsafe.Pointer(&datap.pclntable[datap.ftab[idx].funcoff])) - } -diff --git a/src/runtime/type.go b/src/runtime/type.go -index 5ef11a4..f641adc 100644 ---- a/src/runtime/type.go -+++ b/src/runtime/type.go -@@ -257,7 +257,21 @@ func (t *_type) textOff(off textOff) unsafe.Pointer { - } - return res - } -- res := md.text + uintptr(off) -+ res := uintptr(0) -+ -+ // Find the text section range that contains the offset to determine the section's base -+ // address. In cases where there are multiple text sections, the base address might be -+ // relocated by the linker. -+ -+ for i := 0; i < len(md.textsectmap); i++ { -+ sectaddr := md.textsectmap[i].vaddr -+ sectlen := md.textsectmap[i].length -+ if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen { -+ res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr) -+ break -+ } -+ } -+ - if res > md.etext { - println("runtime: textOff", hex(off), "out of range", hex(md.text), "-", hex(md.etext)) - throw("runtime: text offset out of range") diff --git a/ppc64x-overflow-2.patch b/ppc64x-overflow-2.patch deleted file mode 100644 index 35dfc0e..0000000 --- a/ppc64x-overflow-2.patch +++ /dev/null @@ -1,150 +0,0 @@ -From a5b97a846d70cd8db7f33c24f2b9159f935ce318 Mon Sep 17 00:00:00 2001 -From: Lynn Boger -Date: Tue, 13 Sep 2016 15:13:08 -0500 -Subject: [PATCH] cmd/compile: large text sections on ppc64le - -Additional fixes as submitted upstream. ---- - src/cmd/link/internal/ld/data.go | 24 ++++++++++++------------ - src/cmd/link/internal/ld/lib.go | 2 +- - src/cmd/link/internal/ld/symtab.go | 2 +- - src/runtime/type.go | 28 ++++++++++++++++++---------- - 4 files changed, 32 insertions(+), 24 deletions(-) - -diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go -index 58ce18c..d8e43ff 100644 ---- a/src/cmd/link/internal/ld/data.go -+++ b/src/cmd/link/internal/ld/data.go -@@ -531,7 +531,7 @@ func relocsym(s *LSym) { - // The method offset tables using this relocation expect the offset to be relative - // to the start of the first text section, even if there are multiple. - -- if Linkmode == LinkExternal && r.Sym.Sect.Name == ".text" && r.Sym.Sect.Vaddr != Segtext.Vaddr { -+ if r.Sym.Sect.Name == ".text" { - o = Symaddr(r.Sym) - int64(Segtext.Vaddr) + r.Add - } else { - o = Symaddr(r.Sym) - int64(r.Sym.Sect.Vaddr) + r.Add -@@ -1928,7 +1928,6 @@ func textaddress() { - - sect.Align = int32(Funcalign) - Linklookup(Ctxt, "runtime.text", 0).Sect = sect -- Linklookup(Ctxt, "runtime.etext", 0).Sect = sect - if HEADTYPE == obj.Hwindows { - Linklookup(Ctxt, ".text", 0).Sect = sect - } -@@ -1964,7 +1963,7 @@ func textaddress() { - - // Only break at outermost syms. - -- if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > uint64(0x1c00000) { -+ if sym.Outer == nil && Iself && Linkmode == LinkExternal && SysArch.InFamily(sys.PPC64) && va-sect.Vaddr > 0x1c00000 { - - // Set the length for the previous text section - sect.Length = va - sect.Vaddr -@@ -1973,7 +1972,7 @@ func textaddress() { - sect = addsection(&Segtext, ".text", 05) - sect.Vaddr = va - -- // Create a symbol for the start and end of the secondary text section -+ // Create a symbol for the start of the secondary text section - Linklookup(Ctxt, fmt.Sprintf("runtime.text.%d", n), 0).Sect = sect - n++ - } -@@ -2093,15 +2092,8 @@ func address() { - rodata = Segrodata.Sect - } else { - // Could be multiple .text sections -- n := 1 -- for sect := Segtext.Sect.Next; sect != nil; sect = sect.Next { -- if sect.Name != ".text" { -- break -- } -+ for sect := Segtext.Sect.Next; sect != nil && sect.Name == ".text"; sect = sect.Next { - lasttext = sect -- symname := fmt.Sprintf("runtime.text.%d", n) -- xdefine(symname, obj.STEXT, int64(sect.Vaddr)) -- n++ - } - - rodata = lasttext.Next -@@ -2155,6 +2147,14 @@ func address() { - - xdefine("runtime.text", obj.STEXT, int64(text.Vaddr)) - xdefine("runtime.etext", obj.STEXT, int64(lasttext.Vaddr+lasttext.Length)) -+ -+ n := 1 -+ for sect := Segtext.Sect.Next; sect != nil && sect.Name == ".text"; sect = sect.Next { -+ symname := fmt.Sprintf("runtime.text.%d", n) -+ xdefine(symname, obj.STEXT, int64(sect.Vaddr)) -+ n++ -+ } -+ - if HEADTYPE == obj.Hwindows { - xdefine(".text", obj.STEXT, int64(text.Vaddr)) - } -diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go -index 709e7ca..c37ef92 100644 ---- a/src/cmd/link/internal/ld/lib.go -+++ b/src/cmd/link/internal/ld/lib.go -@@ -1958,7 +1958,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) { - } - n := 0 - -- // Generate base addresses for all text sections if there are multiple -+ // Generate base addresses for all text sections if there are multiple. - for sect := Segtext.Sect; sect != nil; sect = sect.Next { - if n == 0 { - n++ -diff --git a/src/cmd/link/internal/ld/symtab.go b/src/cmd/link/internal/ld/symtab.go -index 80eb33d..ec26f88 100644 ---- a/src/cmd/link/internal/ld/symtab.go -+++ b/src/cmd/link/internal/ld/symtab.go -@@ -331,7 +331,7 @@ func textsectionmap() uint32 { - break - } - } -- Symgrow(Ctxt, t, nsections*3*8) -+ Symgrow(Ctxt, t, nsections*(2*int64(SysArch.IntSize)+int64(SysArch.PtrSize))) - - off := int64(0) - n := 0 -diff --git a/src/runtime/type.go b/src/runtime/type.go -index f641adc..d4df5a9 100644 ---- a/src/runtime/type.go -+++ b/src/runtime/type.go -@@ -259,17 +259,25 @@ func (t *_type) textOff(off textOff) unsafe.Pointer { - } - res := uintptr(0) - -- // Find the text section range that contains the offset to determine the section's base -- // address. In cases where there are multiple text sections, the base address might be -- // relocated by the linker. -- -- for i := 0; i < len(md.textsectmap); i++ { -- sectaddr := md.textsectmap[i].vaddr -- sectlen := md.textsectmap[i].length -- if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen { -- res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr) -- break -+ // The text, or instruction stream is generated as one large buffer. The off (offset) for a method is -+ // its offset within this buffer. If the total text size gets too large, there can be issues on platforms like ppc64 if -+ // the target of calls are too far for the call instruction. To resolve the large text issue, the text is split -+ // into multiple text sections to allow the linker to generate long calls when necessary. When this happens, the vaddr -+ // for each text section is set to its offset within the text. Each method's offset is compared against the section -+ // vaddrs and sizes to determine the containing section. Then the section relative offset is added to the section's -+ // relocated baseaddr to compute the method addess. -+ -+ if len(md.textsectmap) > 1 { -+ for i := 0; i < len(md.textsectmap); i++ { -+ sectaddr := md.textsectmap[i].vaddr -+ sectlen := md.textsectmap[i].length -+ if uint64(off) >= sectaddr && uint64(off) <= sectaddr+sectlen { -+ res = md.textsectmap[i].baseaddr + uintptr(off) - uintptr(md.textsectmap[i].vaddr) -+ break -+ } - } -+ } else { -+ res = md.text + uintptr(off) - } - - if res > md.etext { diff --git a/sources b/sources index a66d54c..890134e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -49c1076428a5d3b5ad7ac65233fcca2f go1.7.4.src.tar.gz +SHA512 (go1.8rc3.src.tar.gz) = d15ab4347a2aef218f3295ddf8d45534e09036bf51cf81a6650a09e5556735953a34c9ee6b6848a44e1c5c945eecebf9c3a58748ecde688916b47e55e7f00c89 diff --git a/tzdata-fix.patch b/tzdata-fix.patch deleted file mode 100644 index b7e6e41..0000000 --- a/tzdata-fix.patch +++ /dev/null @@ -1,34 +0,0 @@ -From c5434f2973a87acff76bac359236e690d632ce95 Mon Sep 17 00:00:00 2001 -From: Alberto Donizetti -Date: Thu, 29 Sep 2016 13:59:10 +0200 -Subject: [PATCH] time: update test for tzdata-2016g - -Fixes #17276 - -Change-Id: I0188cf9bc5fdb48c71ad929cc54206d03e0b96e4 -Reviewed-on: https://go-review.googlesource.com/29995 -Reviewed-by: Brad Fitzpatrick -Run-TryBot: Brad Fitzpatrick -TryBot-Result: Gobot Gobot ---- - src/time/time_test.go | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/src/time/time_test.go b/src/time/time_test.go -index 68236fd..2e47d08 100644 ---- a/src/time/time_test.go -+++ b/src/time/time_test.go -@@ -943,8 +943,11 @@ func TestLoadFixed(t *testing.T) { - // but Go and most other systems use "east is positive". - // So GMT+1 corresponds to -3600 in the Go zone, not +3600. - name, offset := Now().In(loc).Zone() -- if name != "GMT+1" || offset != -1*60*60 { -- t.Errorf("Now().In(loc).Zone() = %q, %d, want %q, %d", name, offset, "GMT+1", -1*60*60) -+ // The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1" -+ // on earlier versions; we accept both. (Issue #17276). -+ if !(name == "GMT+1" || name == "-01") || offset != -1*60*60 { -+ t.Errorf("Now().In(loc).Zone() = %q, %d, want %q or %q, %d", -+ name, offset, "GMT+1", "-01", -1*60*60) - } - } - From b8811129300d546f1e6e3b9fcaaf491efd31e6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 27 Jan 2017 12:41:02 +0100 Subject: [PATCH 100/156] make possible to override default traceback level at build time add sub-package race containing std lib built with -race enabled Related: BZ#1411242 --- fedora.go | 7 +++++++ golang.spec | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 fedora.go diff --git a/fedora.go b/fedora.go new file mode 100644 index 0000000..81b28ba --- /dev/null +++ b/fedora.go @@ -0,0 +1,7 @@ +// +build rpm_crashtraceback + +package runtime + +func init() { + setTraceback("crash") +} diff --git a/golang.spec b/golang.spec index 1b2bca0..c03af50 100644 --- a/golang.spec +++ b/golang.spec @@ -61,6 +61,13 @@ %global shared 0 %endif +# Pre build std lib with -race enabled +%ifarch x86_64 +%global race 1 +%else +%global race 0 +%endif + # Fedora GOROOT %global goroot /usr/lib/%{name} @@ -91,12 +98,14 @@ Name: golang Version: 1.8 -Release: 0.rc3.1%{?dist} +Release: 0.rc3.2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain URL: http://golang.org/ Source0: https://storage.googleapis.com/golang/go%{go_version}.src.tar.gz +# make possible to override default traceback level at build time by setting build tag rpm_crashtraceback +Source1: fedora.go # The compiler is written in Go. Needs go(1.4+) compiler for build. %if !%{golang_bootstrap} @@ -237,6 +246,16 @@ Summary: Golang shared object libraries %{summary}. %endif +%if %{race} +%package race +Summary: Golang std library with -race enabled + +Requires: %{name} = %{version}-%{release} + +%description race +%{summary} +%endif + %prep %setup -q -n go @@ -250,6 +269,8 @@ Summary: Golang shared object libraries %patch219 -p1 +cp %{SOURCE1} ./src/runtime/ + %build # print out system information uname -a @@ -291,6 +312,10 @@ popd GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std %endif +%if %{race} +GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race std +%endif + %install rm -rf $RPM_BUILD_ROOT @@ -313,17 +338,18 @@ cwd=$(pwd) src_list=$cwd/go-src.list pkg_list=$cwd/go-pkg.list shared_list=$cwd/go-shared.list +race_list=$cwd/go-race.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 $shared_list -touch $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list +rm -f $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list $race_list +touch $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list $race_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 -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 bin/ pkg/ -type d -a ! -path '*_dynlink/*' -a ! -path '*_race/*' -printf '%%%dir %{goroot}/%p\n' >> $pkg_list + find bin/ pkg/ ! -type d -a ! -path '*_dynlink/*' -a ! -path '*_race/*' -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 @@ -348,6 +374,13 @@ pushd $RPM_BUILD_ROOT%{goroot} find pkg/*_dynlink/ ! -type d -printf '%{goroot}/%p\n' >> $shared_list %endif +%if %{race} + + find pkg/*_race/ -type d -printf '%%%dir %{goroot}/%p\n' >> $race_list + find pkg/*_race/ ! -type d -printf '%{goroot}/%p\n' >> $race_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 @@ -465,7 +498,16 @@ fi %files -f go-shared.list shared %endif +%if %{race} +%files -f go-race.list race +%endif + %changelog +* Fri Jan 27 2017 Jakub Čajka - 1.8-0.rc3.2 +- make possible to override default traceback level at build time +- add sub-package race containing std lib built with -race enabled +- Related: BZ#1411242 + * Fri Jan 27 2017 Jakub Čajka - 1.8-0.rc3.1 - rebase to go1.8rc3 - Resolves: BZ#1411242 From 7dabca5bf2f855a1d7bb35d6f6fd93caf4662d4b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 10 Feb 2017 11:37:38 +0000 Subject: [PATCH 101/156] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index c03af50..65a33c6 100644 --- a/golang.spec +++ b/golang.spec @@ -98,7 +98,7 @@ Name: golang Version: 1.8 -Release: 0.rc3.2%{?dist} +Release: 0.rc3.2%{?dist}.1 Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -503,6 +503,9 @@ fi %endif %changelog +* Fri Feb 10 2017 Fedora Release Engineering - 1.8-0.rc3.2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Fri Jan 27 2017 Jakub Čajka - 1.8-0.rc3.2 - make possible to override default traceback level at build time - add sub-package race containing std lib built with -race enabled From 1bf730802327bee8692ba39e04b7c5a14fe0116b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 20 Feb 2017 15:50:48 +0100 Subject: [PATCH 102/156] Bump to released 1.8 Ignore ppc64 tests failure for time beeing, haven't managed to reproduce localy --- .gitignore | 1 + golang.spec | 11 ++++++++--- sources | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3554a3c..f44f330 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ /go1.7.3.src.tar.gz /go1.7.4.src.tar.gz /go1.8rc3.src.tar.gz +/go1.8.src.tar.gz diff --git a/golang.spec b/golang.spec index 65a33c6..0eb5b98 100644 --- a/golang.spec +++ b/golang.spec @@ -48,7 +48,7 @@ %endif # Controls what ever we fail on failed tests -%ifarch %{ix86} x86_64 %{arm} aarch64 %{power64} +%ifarch %{ix86} x86_64 %{arm} aarch64 ppc64le %global fail_on_tests 1 %else %global fail_on_tests 0 @@ -94,11 +94,11 @@ %endif %global go_api 1.8 -%global go_version 1.8rc3 +%global go_version 1.8 Name: golang Version: 1.8 -Release: 0.rc3.2%{?dist}.1 +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -503,6 +503,11 @@ fi %endif %changelog +* Fri Feb 17 2017 Jakub Čajka - 1.8-1 +- bump to released version +- Resolves: BZ#1423637 +- Related: BZ#1411242 + * Fri Feb 10 2017 Fedora Release Engineering - 1.8-0.rc3.2.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index 890134e..b576381 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.8rc3.src.tar.gz) = d15ab4347a2aef218f3295ddf8d45534e09036bf51cf81a6650a09e5556735953a34c9ee6b6848a44e1c5c945eecebf9c3a58748ecde688916b47e55e7f00c89 +SHA512 (go1.8.src.tar.gz) = 9742dd8ec0364793e44a55207238c7339236a4da3a6e7cbb3b4eca45e957c7c0cb725e7d7430b9a04630285468d32dac686facfc57f3f58885b80bbb3d333ada From a1ca3c96e0b2db1d03bdb1b302f69a5223f1fa62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 24 Feb 2017 13:41:35 +0100 Subject: [PATCH 103/156] avoid possibly stale packages due to chacha test file not being test file --- golang.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 0eb5b98..bed60b9 100644 --- a/golang.spec +++ b/golang.spec @@ -98,7 +98,7 @@ Name: golang Version: 1.8 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -271,6 +271,9 @@ Requires: %{name} = %{version}-%{release} cp %{SOURCE1} ./src/runtime/ +# don't include chacha test vectors in buildID +mv ./src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_test_vectors.go ./src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_vectors_test.go + %build # print out system information uname -a @@ -503,6 +506,9 @@ fi %endif %changelog +* Fri Feb 24 2017 Jakub Čajka - 1.8-2 +- avoid possibly stale packages due to chacha test file not being test file + * Fri Feb 17 2017 Jakub Čajka - 1.8-1 - bump to released version - Resolves: BZ#1423637 From 749ec6290842987770b75f304ed170dc434a34af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Tue, 11 Apr 2017 10:41:35 +0200 Subject: [PATCH 104/156] bump to Go 1.8.1 Resolves: BZ#1440345 --- .gitignore | 1 + golang.spec | 14 +++++++++----- sources | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index f44f330..349cda1 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ /go1.7.4.src.tar.gz /go1.8rc3.src.tar.gz /go1.8.src.tar.gz +/go1.8.1.src.tar.gz diff --git a/golang.spec b/golang.spec index bed60b9..bf46c75 100644 --- a/golang.spec +++ b/golang.spec @@ -94,11 +94,11 @@ %endif %global go_api 1.8 -%global go_version 1.8 +%global go_version 1.8.1 Name: golang -Version: 1.8 -Release: 2%{?dist} +Version: 1.8.1 +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -349,7 +349,7 @@ rm -f $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list $race_l touch $src_list $pkg_list $docs_list $misc_list $tests_list $shared_list $race_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 src/ ! -type d -a \( ! -ipath '*/testdata/*' -a ! -name '*_test.go' \) -printf '%{goroot}/%p\n' >> $src_list find bin/ pkg/ -type d -a ! -path '*_dynlink/*' -a ! -path '*_race/*' -printf '%%%dir %{goroot}/%p\n' >> $pkg_list find bin/ pkg/ ! -type d -a ! -path '*_dynlink/*' -a ! -path '*_race/*' -printf '%{goroot}/%p\n' >> $pkg_list @@ -387,7 +387,7 @@ pushd $RPM_BUILD_ROOT%{goroot} 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 + 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 @@ -506,6 +506,10 @@ fi %endif %changelog +* Tue Apr 11 2017 Jakub Čajka - 1.8.1-1 +- bump to Go 1.8.1 +- Resolves: BZ#1440345 + * Fri Feb 24 2017 Jakub Čajka - 1.8-2 - avoid possibly stale packages due to chacha test file not being test file diff --git a/sources b/sources index b576381..112d405 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.8.src.tar.gz) = 9742dd8ec0364793e44a55207238c7339236a4da3a6e7cbb3b4eca45e957c7c0cb725e7d7430b9a04630285468d32dac686facfc57f3f58885b80bbb3d333ada +SHA512 (go1.8.1.src.tar.gz) = f01fe7b35ac23101610f6fc169b88dafe2edc49b3b044d5d0aff771b05dcb2c8d2e7a5090ed6dbe67f861e78e792ace32e209ed464399ca02dcd186b13ec8037 From 63fbc711120af0bf1b7031a2aa760f981a849b1a Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 11 Apr 2017 10:13:43 -0400 Subject: [PATCH 105/156] spec: hard code the bootstrap for a modularity build Signed-off-by: Vincent Batts --- golang.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/golang.spec b/golang.spec index bf46c75..be1467a 100644 --- a/golang.spec +++ b/golang.spec @@ -41,11 +41,7 @@ %endif # Use golang/gcc-go as bootstrap compiler -%ifarch %{golang_arches} %global golang_bootstrap 1 -%else -%global golang_bootstrap 0 -%endif # Controls what ever we fail on failed tests %ifarch %{ix86} x86_64 %{arm} aarch64 ppc64le From d83d5139a61a16d86723132c43a7e484cb56288f Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 11 Apr 2017 10:14:48 -0400 Subject: [PATCH 106/156] Revert "spec: hard code the bootstrap for a modularity build" This reverts commit 63fbc711120af0bf1b7031a2aa760f981a849b1a. Signed-off-by: Vincent Batts --- golang.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/golang.spec b/golang.spec index be1467a..bf46c75 100644 --- a/golang.spec +++ b/golang.spec @@ -41,7 +41,11 @@ %endif # Use golang/gcc-go as bootstrap compiler +%ifarch %{golang_arches} %global golang_bootstrap 1 +%else +%global golang_bootstrap 0 +%endif # Controls what ever we fail on failed tests %ifarch %{ix86} x86_64 %{arm} aarch64 ppc64le From 29646808b36a2947ba54bba19202bc230dd38831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 12 Apr 2017 10:26:16 +0200 Subject: [PATCH 107/156] Modularity bootstrap :) --- golang.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/golang.spec b/golang.spec index bf46c75..04900b3 100644 --- a/golang.spec +++ b/golang.spec @@ -41,11 +41,7 @@ %endif # Use golang/gcc-go as bootstrap compiler -%ifarch %{golang_arches} -%global golang_bootstrap 1 -%else %global golang_bootstrap 0 -%endif # Controls what ever we fail on failed tests %ifarch %{ix86} x86_64 %{arm} aarch64 ppc64le From ab6ee497cb64cedaf7ffe11086a1fc00aaaea39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 12 Apr 2017 10:29:49 +0200 Subject: [PATCH 108/156] Revert: modularity bootstrap --- golang.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/golang.spec b/golang.spec index 04900b3..bf46c75 100644 --- a/golang.spec +++ b/golang.spec @@ -41,7 +41,11 @@ %endif # Use golang/gcc-go as bootstrap compiler +%ifarch %{golang_arches} +%global golang_bootstrap 1 +%else %global golang_bootstrap 0 +%endif # Controls what ever we fail on failed tests %ifarch %{ix86} x86_64 %{arm} aarch64 ppc64le From 5706a3480eb0a42d46903724848ba5e05a215b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 12 Apr 2017 12:20:02 +0200 Subject: [PATCH 109/156] Final modularity bootstrap --- golang.spec | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/golang.spec b/golang.spec index bf46c75..decf1e5 100644 --- a/golang.spec +++ b/golang.spec @@ -41,11 +41,7 @@ %endif # Use golang/gcc-go as bootstrap compiler -%ifarch %{golang_arches} -%global golang_bootstrap 1 -%else %global golang_bootstrap 0 -%endif # Controls what ever we fail on failed tests %ifarch %{ix86} x86_64 %{arm} aarch64 ppc64le @@ -149,7 +145,7 @@ Obsoletes: %{name}-vim < 1.4 Obsoletes: emacs-%{name} < 1.4 # These are the only RHEL/Fedora architectures that we compile this package for -ExclusiveArch: %{golang_arches} +ExclusiveArch: %{ix86} x86_64 ppc64le %{arm} aarch64 s390x Source100: golang-gdbinit From 1344685ff3e49c8d944b5f790f6d52888c428785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 12 Apr 2017 12:21:29 +0200 Subject: [PATCH 110/156] Revert: Final modularity bootstrap --- golang.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index decf1e5..bf46c75 100644 --- a/golang.spec +++ b/golang.spec @@ -41,7 +41,11 @@ %endif # Use golang/gcc-go as bootstrap compiler +%ifarch %{golang_arches} +%global golang_bootstrap 1 +%else %global golang_bootstrap 0 +%endif # Controls what ever we fail on failed tests %ifarch %{ix86} x86_64 %{arm} aarch64 ppc64le @@ -145,7 +149,7 @@ Obsoletes: %{name}-vim < 1.4 Obsoletes: emacs-%{name} < 1.4 # These are the only RHEL/Fedora architectures that we compile this package for -ExclusiveArch: %{ix86} x86_64 ppc64le %{arm} aarch64 s390x +ExclusiveArch: %{golang_arches} Source100: golang-gdbinit From 0a43a1cbafd867a46f14344868c03008038ccfc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 21 Apr 2017 14:56:13 +0200 Subject: [PATCH 111/156] fix uint64 constant codegen on s390x Resolves: BZ#1441078 --- golang.spec | 8 +- s390x-uint-codegen.patch | 2579 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 2586 insertions(+), 1 deletion(-) create mode 100644 s390x-uint-codegen.patch diff --git a/golang.spec b/golang.spec index bf46c75..4f21026 100644 --- a/golang.spec +++ b/golang.spec @@ -98,7 +98,7 @@ Name: golang Version: 1.8.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -137,6 +137,7 @@ Patch215: ./go1.5-zoneinfo_testing_only.patch # Proposed patch by mmunday https://golang.org/cl/35262 Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch +Patch220: s390x-uint-codegen.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -268,6 +269,7 @@ Requires: %{name} = %{version}-%{release} %patch215 -p1 %patch219 -p1 +%patch220 -p1 cp %{SOURCE1} ./src/runtime/ @@ -506,6 +508,10 @@ fi %endif %changelog +* Fri Apr 21 2017 Jakub Čajka - 1.8.1-2 +- fix uint64 constant codegen on s390x +- Resolves: BZ#1441078 + * Tue Apr 11 2017 Jakub Čajka - 1.8.1-1 - bump to Go 1.8.1 - Resolves: BZ#1440345 diff --git a/s390x-uint-codegen.patch b/s390x-uint-codegen.patch new file mode 100644 index 0000000..5a1cbbb --- /dev/null +++ b/s390x-uint-codegen.patch @@ -0,0 +1,2579 @@ +From 708966abce5d301411c18f01187ff56fd951b17a Mon Sep 17 00:00:00 2001 +From: Michael Munday +Date: Mon, 17 Apr 2017 12:29:32 -0400 +Subject: [PATCH] [release-branch.go1.8] cmd/compile: fix s390x unsigned + comparison constant merging rules + +On s390x unsigned integer comparisons with immediates require the immediate +to be an unsigned 32-bit integer. The rule was checking that the immediate +was a signed 32-bit integer. + +This CL also adds a test for comparisons that could be turned into compare +with immediate or equivalent instructions (depending on architecture and +optimizations applied). + +Cherry-pick of CL 40433 and CL 40873. + +Fixes #19940. + +Change-Id: I1331558a0ee0c4ac33bf8ea488f3ea190d06f110 +Reviewed-on: https://go-review.googlesource.com/40931 +Reviewed-by: Brad Fitzpatrick +Run-TryBot: Brad Fitzpatrick +TryBot-Result: Gobot Gobot +--- + src/cmd/compile/internal/gc/ssa_test.go | 3 + + src/cmd/compile/internal/gc/testdata/cmpConst.go | 2217 ++++++++++++++++++++ + .../internal/gc/testdata/gen/cmpConstGen.go | 248 +++ + src/cmd/compile/internal/ssa/gen/S390X.rules | 4 +- + src/cmd/compile/internal/ssa/rewriteS390X.go | 8 +- + 5 files changed, 2474 insertions(+), 6 deletions(-) + create mode 100644 src/cmd/compile/internal/gc/testdata/cmpConst.go + create mode 100644 src/cmd/compile/internal/gc/testdata/gen/cmpConstGen.go + +diff --git a/src/cmd/compile/internal/gc/ssa_test.go b/src/cmd/compile/internal/gc/ssa_test.go +index 1aebd90..bb315b9 100644 +--- a/src/cmd/compile/internal/gc/ssa_test.go ++++ b/src/cmd/compile/internal/gc/ssa_test.go +@@ -63,6 +63,9 @@ func TestArithmeticConst(t *testing.T) { runTest(t, "arithConst.go") } + + func TestChan(t *testing.T) { runTest(t, "chan.go") } + ++// TestComparisonsConst tests results for comparison operations against constants. ++func TestComparisonsConst(t *testing.T) { runTest(t, "cmpConst.go") } ++ + func TestCompound(t *testing.T) { runTest(t, "compound.go") } + + func TestCtl(t *testing.T) { runTest(t, "ctl.go") } +diff --git a/src/cmd/compile/internal/gc/testdata/cmpConst.go b/src/cmd/compile/internal/gc/testdata/cmpConst.go +new file mode 100644 +index 0000000..f7067be +--- /dev/null ++++ b/src/cmd/compile/internal/gc/testdata/cmpConst.go +@@ -0,0 +1,2217 @@ ++// run ++// Code generated by gen/cmpConstGen.go. DO NOT EDIT. ++ ++package main ++ ++import ( ++ "fmt" ++ "reflect" ++ "runtime" ++) ++ ++// results show the expected result for the elements left of, equal to and right of the index. ++type result struct{ l, e, r bool } ++ ++var ( ++ eq = result{l: false, e: true, r: false} ++ ne = result{l: true, e: false, r: true} ++ lt = result{l: true, e: false, r: false} ++ le = result{l: true, e: true, r: false} ++ gt = result{l: false, e: false, r: true} ++ ge = result{l: false, e: true, r: true} ++) ++ ++// uint64 tests ++var uint64_vals = []uint64{ ++ 0, ++ 1, ++ 126, ++ 127, ++ 128, ++ 254, ++ 255, ++ 256, ++ 32766, ++ 32767, ++ 32768, ++ 65534, ++ 65535, ++ 65536, ++ 2147483646, ++ 2147483647, ++ 2147483648, ++ 4278190080, ++ 4294967294, ++ 4294967295, ++ 4294967296, ++ 1095216660480, ++ 9223372036854775806, ++ 9223372036854775807, ++ 9223372036854775808, ++ 18374686479671623680, ++ 18446744073709551614, ++ 18446744073709551615, ++} ++ ++func lt_0_uint64(x uint64) bool { return x < 0 } ++func le_0_uint64(x uint64) bool { return x <= 0 } ++func gt_0_uint64(x uint64) bool { return x > 0 } ++func ge_0_uint64(x uint64) bool { return x >= 0 } ++func eq_0_uint64(x uint64) bool { return x == 0 } ++func ne_0_uint64(x uint64) bool { return x != 0 } ++func lt_1_uint64(x uint64) bool { return x < 1 } ++func le_1_uint64(x uint64) bool { return x <= 1 } ++func gt_1_uint64(x uint64) bool { return x > 1 } ++func ge_1_uint64(x uint64) bool { return x >= 1 } ++func eq_1_uint64(x uint64) bool { return x == 1 } ++func ne_1_uint64(x uint64) bool { return x != 1 } ++func lt_126_uint64(x uint64) bool { return x < 126 } ++func le_126_uint64(x uint64) bool { return x <= 126 } ++func gt_126_uint64(x uint64) bool { return x > 126 } ++func ge_126_uint64(x uint64) bool { return x >= 126 } ++func eq_126_uint64(x uint64) bool { return x == 126 } ++func ne_126_uint64(x uint64) bool { return x != 126 } ++func lt_127_uint64(x uint64) bool { return x < 127 } ++func le_127_uint64(x uint64) bool { return x <= 127 } ++func gt_127_uint64(x uint64) bool { return x > 127 } ++func ge_127_uint64(x uint64) bool { return x >= 127 } ++func eq_127_uint64(x uint64) bool { return x == 127 } ++func ne_127_uint64(x uint64) bool { return x != 127 } ++func lt_128_uint64(x uint64) bool { return x < 128 } ++func le_128_uint64(x uint64) bool { return x <= 128 } ++func gt_128_uint64(x uint64) bool { return x > 128 } ++func ge_128_uint64(x uint64) bool { return x >= 128 } ++func eq_128_uint64(x uint64) bool { return x == 128 } ++func ne_128_uint64(x uint64) bool { return x != 128 } ++func lt_254_uint64(x uint64) bool { return x < 254 } ++func le_254_uint64(x uint64) bool { return x <= 254 } ++func gt_254_uint64(x uint64) bool { return x > 254 } ++func ge_254_uint64(x uint64) bool { return x >= 254 } ++func eq_254_uint64(x uint64) bool { return x == 254 } ++func ne_254_uint64(x uint64) bool { return x != 254 } ++func lt_255_uint64(x uint64) bool { return x < 255 } ++func le_255_uint64(x uint64) bool { return x <= 255 } ++func gt_255_uint64(x uint64) bool { return x > 255 } ++func ge_255_uint64(x uint64) bool { return x >= 255 } ++func eq_255_uint64(x uint64) bool { return x == 255 } ++func ne_255_uint64(x uint64) bool { return x != 255 } ++func lt_256_uint64(x uint64) bool { return x < 256 } ++func le_256_uint64(x uint64) bool { return x <= 256 } ++func gt_256_uint64(x uint64) bool { return x > 256 } ++func ge_256_uint64(x uint64) bool { return x >= 256 } ++func eq_256_uint64(x uint64) bool { return x == 256 } ++func ne_256_uint64(x uint64) bool { return x != 256 } ++func lt_32766_uint64(x uint64) bool { return x < 32766 } ++func le_32766_uint64(x uint64) bool { return x <= 32766 } ++func gt_32766_uint64(x uint64) bool { return x > 32766 } ++func ge_32766_uint64(x uint64) bool { return x >= 32766 } ++func eq_32766_uint64(x uint64) bool { return x == 32766 } ++func ne_32766_uint64(x uint64) bool { return x != 32766 } ++func lt_32767_uint64(x uint64) bool { return x < 32767 } ++func le_32767_uint64(x uint64) bool { return x <= 32767 } ++func gt_32767_uint64(x uint64) bool { return x > 32767 } ++func ge_32767_uint64(x uint64) bool { return x >= 32767 } ++func eq_32767_uint64(x uint64) bool { return x == 32767 } ++func ne_32767_uint64(x uint64) bool { return x != 32767 } ++func lt_32768_uint64(x uint64) bool { return x < 32768 } ++func le_32768_uint64(x uint64) bool { return x <= 32768 } ++func gt_32768_uint64(x uint64) bool { return x > 32768 } ++func ge_32768_uint64(x uint64) bool { return x >= 32768 } ++func eq_32768_uint64(x uint64) bool { return x == 32768 } ++func ne_32768_uint64(x uint64) bool { return x != 32768 } ++func lt_65534_uint64(x uint64) bool { return x < 65534 } ++func le_65534_uint64(x uint64) bool { return x <= 65534 } ++func gt_65534_uint64(x uint64) bool { return x > 65534 } ++func ge_65534_uint64(x uint64) bool { return x >= 65534 } ++func eq_65534_uint64(x uint64) bool { return x == 65534 } ++func ne_65534_uint64(x uint64) bool { return x != 65534 } ++func lt_65535_uint64(x uint64) bool { return x < 65535 } ++func le_65535_uint64(x uint64) bool { return x <= 65535 } ++func gt_65535_uint64(x uint64) bool { return x > 65535 } ++func ge_65535_uint64(x uint64) bool { return x >= 65535 } ++func eq_65535_uint64(x uint64) bool { return x == 65535 } ++func ne_65535_uint64(x uint64) bool { return x != 65535 } ++func lt_65536_uint64(x uint64) bool { return x < 65536 } ++func le_65536_uint64(x uint64) bool { return x <= 65536 } ++func gt_65536_uint64(x uint64) bool { return x > 65536 } ++func ge_65536_uint64(x uint64) bool { return x >= 65536 } ++func eq_65536_uint64(x uint64) bool { return x == 65536 } ++func ne_65536_uint64(x uint64) bool { return x != 65536 } ++func lt_2147483646_uint64(x uint64) bool { return x < 2147483646 } ++func le_2147483646_uint64(x uint64) bool { return x <= 2147483646 } ++func gt_2147483646_uint64(x uint64) bool { return x > 2147483646 } ++func ge_2147483646_uint64(x uint64) bool { return x >= 2147483646 } ++func eq_2147483646_uint64(x uint64) bool { return x == 2147483646 } ++func ne_2147483646_uint64(x uint64) bool { return x != 2147483646 } ++func lt_2147483647_uint64(x uint64) bool { return x < 2147483647 } ++func le_2147483647_uint64(x uint64) bool { return x <= 2147483647 } ++func gt_2147483647_uint64(x uint64) bool { return x > 2147483647 } ++func ge_2147483647_uint64(x uint64) bool { return x >= 2147483647 } ++func eq_2147483647_uint64(x uint64) bool { return x == 2147483647 } ++func ne_2147483647_uint64(x uint64) bool { return x != 2147483647 } ++func lt_2147483648_uint64(x uint64) bool { return x < 2147483648 } ++func le_2147483648_uint64(x uint64) bool { return x <= 2147483648 } ++func gt_2147483648_uint64(x uint64) bool { return x > 2147483648 } ++func ge_2147483648_uint64(x uint64) bool { return x >= 2147483648 } ++func eq_2147483648_uint64(x uint64) bool { return x == 2147483648 } ++func ne_2147483648_uint64(x uint64) bool { return x != 2147483648 } ++func lt_4278190080_uint64(x uint64) bool { return x < 4278190080 } ++func le_4278190080_uint64(x uint64) bool { return x <= 4278190080 } ++func gt_4278190080_uint64(x uint64) bool { return x > 4278190080 } ++func ge_4278190080_uint64(x uint64) bool { return x >= 4278190080 } ++func eq_4278190080_uint64(x uint64) bool { return x == 4278190080 } ++func ne_4278190080_uint64(x uint64) bool { return x != 4278190080 } ++func lt_4294967294_uint64(x uint64) bool { return x < 4294967294 } ++func le_4294967294_uint64(x uint64) bool { return x <= 4294967294 } ++func gt_4294967294_uint64(x uint64) bool { return x > 4294967294 } ++func ge_4294967294_uint64(x uint64) bool { return x >= 4294967294 } ++func eq_4294967294_uint64(x uint64) bool { return x == 4294967294 } ++func ne_4294967294_uint64(x uint64) bool { return x != 4294967294 } ++func lt_4294967295_uint64(x uint64) bool { return x < 4294967295 } ++func le_4294967295_uint64(x uint64) bool { return x <= 4294967295 } ++func gt_4294967295_uint64(x uint64) bool { return x > 4294967295 } ++func ge_4294967295_uint64(x uint64) bool { return x >= 4294967295 } ++func eq_4294967295_uint64(x uint64) bool { return x == 4294967295 } ++func ne_4294967295_uint64(x uint64) bool { return x != 4294967295 } ++func lt_4294967296_uint64(x uint64) bool { return x < 4294967296 } ++func le_4294967296_uint64(x uint64) bool { return x <= 4294967296 } ++func gt_4294967296_uint64(x uint64) bool { return x > 4294967296 } ++func ge_4294967296_uint64(x uint64) bool { return x >= 4294967296 } ++func eq_4294967296_uint64(x uint64) bool { return x == 4294967296 } ++func ne_4294967296_uint64(x uint64) bool { return x != 4294967296 } ++func lt_1095216660480_uint64(x uint64) bool { return x < 1095216660480 } ++func le_1095216660480_uint64(x uint64) bool { return x <= 1095216660480 } ++func gt_1095216660480_uint64(x uint64) bool { return x > 1095216660480 } ++func ge_1095216660480_uint64(x uint64) bool { return x >= 1095216660480 } ++func eq_1095216660480_uint64(x uint64) bool { return x == 1095216660480 } ++func ne_1095216660480_uint64(x uint64) bool { return x != 1095216660480 } ++func lt_9223372036854775806_uint64(x uint64) bool { return x < 9223372036854775806 } ++func le_9223372036854775806_uint64(x uint64) bool { return x <= 9223372036854775806 } ++func gt_9223372036854775806_uint64(x uint64) bool { return x > 9223372036854775806 } ++func ge_9223372036854775806_uint64(x uint64) bool { return x >= 9223372036854775806 } ++func eq_9223372036854775806_uint64(x uint64) bool { return x == 9223372036854775806 } ++func ne_9223372036854775806_uint64(x uint64) bool { return x != 9223372036854775806 } ++func lt_9223372036854775807_uint64(x uint64) bool { return x < 9223372036854775807 } ++func le_9223372036854775807_uint64(x uint64) bool { return x <= 9223372036854775807 } ++func gt_9223372036854775807_uint64(x uint64) bool { return x > 9223372036854775807 } ++func ge_9223372036854775807_uint64(x uint64) bool { return x >= 9223372036854775807 } ++func eq_9223372036854775807_uint64(x uint64) bool { return x == 9223372036854775807 } ++func ne_9223372036854775807_uint64(x uint64) bool { return x != 9223372036854775807 } ++func lt_9223372036854775808_uint64(x uint64) bool { return x < 9223372036854775808 } ++func le_9223372036854775808_uint64(x uint64) bool { return x <= 9223372036854775808 } ++func gt_9223372036854775808_uint64(x uint64) bool { return x > 9223372036854775808 } ++func ge_9223372036854775808_uint64(x uint64) bool { return x >= 9223372036854775808 } ++func eq_9223372036854775808_uint64(x uint64) bool { return x == 9223372036854775808 } ++func ne_9223372036854775808_uint64(x uint64) bool { return x != 9223372036854775808 } ++func lt_18374686479671623680_uint64(x uint64) bool { return x < 18374686479671623680 } ++func le_18374686479671623680_uint64(x uint64) bool { return x <= 18374686479671623680 } ++func gt_18374686479671623680_uint64(x uint64) bool { return x > 18374686479671623680 } ++func ge_18374686479671623680_uint64(x uint64) bool { return x >= 18374686479671623680 } ++func eq_18374686479671623680_uint64(x uint64) bool { return x == 18374686479671623680 } ++func ne_18374686479671623680_uint64(x uint64) bool { return x != 18374686479671623680 } ++func lt_18446744073709551614_uint64(x uint64) bool { return x < 18446744073709551614 } ++func le_18446744073709551614_uint64(x uint64) bool { return x <= 18446744073709551614 } ++func gt_18446744073709551614_uint64(x uint64) bool { return x > 18446744073709551614 } ++func ge_18446744073709551614_uint64(x uint64) bool { return x >= 18446744073709551614 } ++func eq_18446744073709551614_uint64(x uint64) bool { return x == 18446744073709551614 } ++func ne_18446744073709551614_uint64(x uint64) bool { return x != 18446744073709551614 } ++func lt_18446744073709551615_uint64(x uint64) bool { return x < 18446744073709551615 } ++func le_18446744073709551615_uint64(x uint64) bool { return x <= 18446744073709551615 } ++func gt_18446744073709551615_uint64(x uint64) bool { return x > 18446744073709551615 } ++func ge_18446744073709551615_uint64(x uint64) bool { return x >= 18446744073709551615 } ++func eq_18446744073709551615_uint64(x uint64) bool { return x == 18446744073709551615 } ++func ne_18446744073709551615_uint64(x uint64) bool { return x != 18446744073709551615 } ++ ++var uint64_tests = []struct { ++ idx int // index of the constant used ++ exp result // expected results ++ fn func(uint64) bool ++}{ ++ {idx: 0, exp: lt, fn: lt_0_uint64}, ++ {idx: 0, exp: le, fn: le_0_uint64}, ++ {idx: 0, exp: gt, fn: gt_0_uint64}, ++ {idx: 0, exp: ge, fn: ge_0_uint64}, ++ {idx: 0, exp: eq, fn: eq_0_uint64}, ++ {idx: 0, exp: ne, fn: ne_0_uint64}, ++ {idx: 1, exp: lt, fn: lt_1_uint64}, ++ {idx: 1, exp: le, fn: le_1_uint64}, ++ {idx: 1, exp: gt, fn: gt_1_uint64}, ++ {idx: 1, exp: ge, fn: ge_1_uint64}, ++ {idx: 1, exp: eq, fn: eq_1_uint64}, ++ {idx: 1, exp: ne, fn: ne_1_uint64}, ++ {idx: 2, exp: lt, fn: lt_126_uint64}, ++ {idx: 2, exp: le, fn: le_126_uint64}, ++ {idx: 2, exp: gt, fn: gt_126_uint64}, ++ {idx: 2, exp: ge, fn: ge_126_uint64}, ++ {idx: 2, exp: eq, fn: eq_126_uint64}, ++ {idx: 2, exp: ne, fn: ne_126_uint64}, ++ {idx: 3, exp: lt, fn: lt_127_uint64}, ++ {idx: 3, exp: le, fn: le_127_uint64}, ++ {idx: 3, exp: gt, fn: gt_127_uint64}, ++ {idx: 3, exp: ge, fn: ge_127_uint64}, ++ {idx: 3, exp: eq, fn: eq_127_uint64}, ++ {idx: 3, exp: ne, fn: ne_127_uint64}, ++ {idx: 4, exp: lt, fn: lt_128_uint64}, ++ {idx: 4, exp: le, fn: le_128_uint64}, ++ {idx: 4, exp: gt, fn: gt_128_uint64}, ++ {idx: 4, exp: ge, fn: ge_128_uint64}, ++ {idx: 4, exp: eq, fn: eq_128_uint64}, ++ {idx: 4, exp: ne, fn: ne_128_uint64}, ++ {idx: 5, exp: lt, fn: lt_254_uint64}, ++ {idx: 5, exp: le, fn: le_254_uint64}, ++ {idx: 5, exp: gt, fn: gt_254_uint64}, ++ {idx: 5, exp: ge, fn: ge_254_uint64}, ++ {idx: 5, exp: eq, fn: eq_254_uint64}, ++ {idx: 5, exp: ne, fn: ne_254_uint64}, ++ {idx: 6, exp: lt, fn: lt_255_uint64}, ++ {idx: 6, exp: le, fn: le_255_uint64}, ++ {idx: 6, exp: gt, fn: gt_255_uint64}, ++ {idx: 6, exp: ge, fn: ge_255_uint64}, ++ {idx: 6, exp: eq, fn: eq_255_uint64}, ++ {idx: 6, exp: ne, fn: ne_255_uint64}, ++ {idx: 7, exp: lt, fn: lt_256_uint64}, ++ {idx: 7, exp: le, fn: le_256_uint64}, ++ {idx: 7, exp: gt, fn: gt_256_uint64}, ++ {idx: 7, exp: ge, fn: ge_256_uint64}, ++ {idx: 7, exp: eq, fn: eq_256_uint64}, ++ {idx: 7, exp: ne, fn: ne_256_uint64}, ++ {idx: 8, exp: lt, fn: lt_32766_uint64}, ++ {idx: 8, exp: le, fn: le_32766_uint64}, ++ {idx: 8, exp: gt, fn: gt_32766_uint64}, ++ {idx: 8, exp: ge, fn: ge_32766_uint64}, ++ {idx: 8, exp: eq, fn: eq_32766_uint64}, ++ {idx: 8, exp: ne, fn: ne_32766_uint64}, ++ {idx: 9, exp: lt, fn: lt_32767_uint64}, ++ {idx: 9, exp: le, fn: le_32767_uint64}, ++ {idx: 9, exp: gt, fn: gt_32767_uint64}, ++ {idx: 9, exp: ge, fn: ge_32767_uint64}, ++ {idx: 9, exp: eq, fn: eq_32767_uint64}, ++ {idx: 9, exp: ne, fn: ne_32767_uint64}, ++ {idx: 10, exp: lt, fn: lt_32768_uint64}, ++ {idx: 10, exp: le, fn: le_32768_uint64}, ++ {idx: 10, exp: gt, fn: gt_32768_uint64}, ++ {idx: 10, exp: ge, fn: ge_32768_uint64}, ++ {idx: 10, exp: eq, fn: eq_32768_uint64}, ++ {idx: 10, exp: ne, fn: ne_32768_uint64}, ++ {idx: 11, exp: lt, fn: lt_65534_uint64}, ++ {idx: 11, exp: le, fn: le_65534_uint64}, ++ {idx: 11, exp: gt, fn: gt_65534_uint64}, ++ {idx: 11, exp: ge, fn: ge_65534_uint64}, ++ {idx: 11, exp: eq, fn: eq_65534_uint64}, ++ {idx: 11, exp: ne, fn: ne_65534_uint64}, ++ {idx: 12, exp: lt, fn: lt_65535_uint64}, ++ {idx: 12, exp: le, fn: le_65535_uint64}, ++ {idx: 12, exp: gt, fn: gt_65535_uint64}, ++ {idx: 12, exp: ge, fn: ge_65535_uint64}, ++ {idx: 12, exp: eq, fn: eq_65535_uint64}, ++ {idx: 12, exp: ne, fn: ne_65535_uint64}, ++ {idx: 13, exp: lt, fn: lt_65536_uint64}, ++ {idx: 13, exp: le, fn: le_65536_uint64}, ++ {idx: 13, exp: gt, fn: gt_65536_uint64}, ++ {idx: 13, exp: ge, fn: ge_65536_uint64}, ++ {idx: 13, exp: eq, fn: eq_65536_uint64}, ++ {idx: 13, exp: ne, fn: ne_65536_uint64}, ++ {idx: 14, exp: lt, fn: lt_2147483646_uint64}, ++ {idx: 14, exp: le, fn: le_2147483646_uint64}, ++ {idx: 14, exp: gt, fn: gt_2147483646_uint64}, ++ {idx: 14, exp: ge, fn: ge_2147483646_uint64}, ++ {idx: 14, exp: eq, fn: eq_2147483646_uint64}, ++ {idx: 14, exp: ne, fn: ne_2147483646_uint64}, ++ {idx: 15, exp: lt, fn: lt_2147483647_uint64}, ++ {idx: 15, exp: le, fn: le_2147483647_uint64}, ++ {idx: 15, exp: gt, fn: gt_2147483647_uint64}, ++ {idx: 15, exp: ge, fn: ge_2147483647_uint64}, ++ {idx: 15, exp: eq, fn: eq_2147483647_uint64}, ++ {idx: 15, exp: ne, fn: ne_2147483647_uint64}, ++ {idx: 16, exp: lt, fn: lt_2147483648_uint64}, ++ {idx: 16, exp: le, fn: le_2147483648_uint64}, ++ {idx: 16, exp: gt, fn: gt_2147483648_uint64}, ++ {idx: 16, exp: ge, fn: ge_2147483648_uint64}, ++ {idx: 16, exp: eq, fn: eq_2147483648_uint64}, ++ {idx: 16, exp: ne, fn: ne_2147483648_uint64}, ++ {idx: 17, exp: lt, fn: lt_4278190080_uint64}, ++ {idx: 17, exp: le, fn: le_4278190080_uint64}, ++ {idx: 17, exp: gt, fn: gt_4278190080_uint64}, ++ {idx: 17, exp: ge, fn: ge_4278190080_uint64}, ++ {idx: 17, exp: eq, fn: eq_4278190080_uint64}, ++ {idx: 17, exp: ne, fn: ne_4278190080_uint64}, ++ {idx: 18, exp: lt, fn: lt_4294967294_uint64}, ++ {idx: 18, exp: le, fn: le_4294967294_uint64}, ++ {idx: 18, exp: gt, fn: gt_4294967294_uint64}, ++ {idx: 18, exp: ge, fn: ge_4294967294_uint64}, ++ {idx: 18, exp: eq, fn: eq_4294967294_uint64}, ++ {idx: 18, exp: ne, fn: ne_4294967294_uint64}, ++ {idx: 19, exp: lt, fn: lt_4294967295_uint64}, ++ {idx: 19, exp: le, fn: le_4294967295_uint64}, ++ {idx: 19, exp: gt, fn: gt_4294967295_uint64}, ++ {idx: 19, exp: ge, fn: ge_4294967295_uint64}, ++ {idx: 19, exp: eq, fn: eq_4294967295_uint64}, ++ {idx: 19, exp: ne, fn: ne_4294967295_uint64}, ++ {idx: 20, exp: lt, fn: lt_4294967296_uint64}, ++ {idx: 20, exp: le, fn: le_4294967296_uint64}, ++ {idx: 20, exp: gt, fn: gt_4294967296_uint64}, ++ {idx: 20, exp: ge, fn: ge_4294967296_uint64}, ++ {idx: 20, exp: eq, fn: eq_4294967296_uint64}, ++ {idx: 20, exp: ne, fn: ne_4294967296_uint64}, ++ {idx: 21, exp: lt, fn: lt_1095216660480_uint64}, ++ {idx: 21, exp: le, fn: le_1095216660480_uint64}, ++ {idx: 21, exp: gt, fn: gt_1095216660480_uint64}, ++ {idx: 21, exp: ge, fn: ge_1095216660480_uint64}, ++ {idx: 21, exp: eq, fn: eq_1095216660480_uint64}, ++ {idx: 21, exp: ne, fn: ne_1095216660480_uint64}, ++ {idx: 22, exp: lt, fn: lt_9223372036854775806_uint64}, ++ {idx: 22, exp: le, fn: le_9223372036854775806_uint64}, ++ {idx: 22, exp: gt, fn: gt_9223372036854775806_uint64}, ++ {idx: 22, exp: ge, fn: ge_9223372036854775806_uint64}, ++ {idx: 22, exp: eq, fn: eq_9223372036854775806_uint64}, ++ {idx: 22, exp: ne, fn: ne_9223372036854775806_uint64}, ++ {idx: 23, exp: lt, fn: lt_9223372036854775807_uint64}, ++ {idx: 23, exp: le, fn: le_9223372036854775807_uint64}, ++ {idx: 23, exp: gt, fn: gt_9223372036854775807_uint64}, ++ {idx: 23, exp: ge, fn: ge_9223372036854775807_uint64}, ++ {idx: 23, exp: eq, fn: eq_9223372036854775807_uint64}, ++ {idx: 23, exp: ne, fn: ne_9223372036854775807_uint64}, ++ {idx: 24, exp: lt, fn: lt_9223372036854775808_uint64}, ++ {idx: 24, exp: le, fn: le_9223372036854775808_uint64}, ++ {idx: 24, exp: gt, fn: gt_9223372036854775808_uint64}, ++ {idx: 24, exp: ge, fn: ge_9223372036854775808_uint64}, ++ {idx: 24, exp: eq, fn: eq_9223372036854775808_uint64}, ++ {idx: 24, exp: ne, fn: ne_9223372036854775808_uint64}, ++ {idx: 25, exp: lt, fn: lt_18374686479671623680_uint64}, ++ {idx: 25, exp: le, fn: le_18374686479671623680_uint64}, ++ {idx: 25, exp: gt, fn: gt_18374686479671623680_uint64}, ++ {idx: 25, exp: ge, fn: ge_18374686479671623680_uint64}, ++ {idx: 25, exp: eq, fn: eq_18374686479671623680_uint64}, ++ {idx: 25, exp: ne, fn: ne_18374686479671623680_uint64}, ++ {idx: 26, exp: lt, fn: lt_18446744073709551614_uint64}, ++ {idx: 26, exp: le, fn: le_18446744073709551614_uint64}, ++ {idx: 26, exp: gt, fn: gt_18446744073709551614_uint64}, ++ {idx: 26, exp: ge, fn: ge_18446744073709551614_uint64}, ++ {idx: 26, exp: eq, fn: eq_18446744073709551614_uint64}, ++ {idx: 26, exp: ne, fn: ne_18446744073709551614_uint64}, ++ {idx: 27, exp: lt, fn: lt_18446744073709551615_uint64}, ++ {idx: 27, exp: le, fn: le_18446744073709551615_uint64}, ++ {idx: 27, exp: gt, fn: gt_18446744073709551615_uint64}, ++ {idx: 27, exp: ge, fn: ge_18446744073709551615_uint64}, ++ {idx: 27, exp: eq, fn: eq_18446744073709551615_uint64}, ++ {idx: 27, exp: ne, fn: ne_18446744073709551615_uint64}, ++} ++ ++// uint32 tests ++var uint32_vals = []uint32{ ++ 0, ++ 1, ++ 126, ++ 127, ++ 128, ++ 254, ++ 255, ++ 256, ++ 32766, ++ 32767, ++ 32768, ++ 65534, ++ 65535, ++ 65536, ++ 2147483646, ++ 2147483647, ++ 2147483648, ++ 4278190080, ++ 4294967294, ++ 4294967295, ++} ++ ++func lt_0_uint32(x uint32) bool { return x < 0 } ++func le_0_uint32(x uint32) bool { return x <= 0 } ++func gt_0_uint32(x uint32) bool { return x > 0 } ++func ge_0_uint32(x uint32) bool { return x >= 0 } ++func eq_0_uint32(x uint32) bool { return x == 0 } ++func ne_0_uint32(x uint32) bool { return x != 0 } ++func lt_1_uint32(x uint32) bool { return x < 1 } ++func le_1_uint32(x uint32) bool { return x <= 1 } ++func gt_1_uint32(x uint32) bool { return x > 1 } ++func ge_1_uint32(x uint32) bool { return x >= 1 } ++func eq_1_uint32(x uint32) bool { return x == 1 } ++func ne_1_uint32(x uint32) bool { return x != 1 } ++func lt_126_uint32(x uint32) bool { return x < 126 } ++func le_126_uint32(x uint32) bool { return x <= 126 } ++func gt_126_uint32(x uint32) bool { return x > 126 } ++func ge_126_uint32(x uint32) bool { return x >= 126 } ++func eq_126_uint32(x uint32) bool { return x == 126 } ++func ne_126_uint32(x uint32) bool { return x != 126 } ++func lt_127_uint32(x uint32) bool { return x < 127 } ++func le_127_uint32(x uint32) bool { return x <= 127 } ++func gt_127_uint32(x uint32) bool { return x > 127 } ++func ge_127_uint32(x uint32) bool { return x >= 127 } ++func eq_127_uint32(x uint32) bool { return x == 127 } ++func ne_127_uint32(x uint32) bool { return x != 127 } ++func lt_128_uint32(x uint32) bool { return x < 128 } ++func le_128_uint32(x uint32) bool { return x <= 128 } ++func gt_128_uint32(x uint32) bool { return x > 128 } ++func ge_128_uint32(x uint32) bool { return x >= 128 } ++func eq_128_uint32(x uint32) bool { return x == 128 } ++func ne_128_uint32(x uint32) bool { return x != 128 } ++func lt_254_uint32(x uint32) bool { return x < 254 } ++func le_254_uint32(x uint32) bool { return x <= 254 } ++func gt_254_uint32(x uint32) bool { return x > 254 } ++func ge_254_uint32(x uint32) bool { return x >= 254 } ++func eq_254_uint32(x uint32) bool { return x == 254 } ++func ne_254_uint32(x uint32) bool { return x != 254 } ++func lt_255_uint32(x uint32) bool { return x < 255 } ++func le_255_uint32(x uint32) bool { return x <= 255 } ++func gt_255_uint32(x uint32) bool { return x > 255 } ++func ge_255_uint32(x uint32) bool { return x >= 255 } ++func eq_255_uint32(x uint32) bool { return x == 255 } ++func ne_255_uint32(x uint32) bool { return x != 255 } ++func lt_256_uint32(x uint32) bool { return x < 256 } ++func le_256_uint32(x uint32) bool { return x <= 256 } ++func gt_256_uint32(x uint32) bool { return x > 256 } ++func ge_256_uint32(x uint32) bool { return x >= 256 } ++func eq_256_uint32(x uint32) bool { return x == 256 } ++func ne_256_uint32(x uint32) bool { return x != 256 } ++func lt_32766_uint32(x uint32) bool { return x < 32766 } ++func le_32766_uint32(x uint32) bool { return x <= 32766 } ++func gt_32766_uint32(x uint32) bool { return x > 32766 } ++func ge_32766_uint32(x uint32) bool { return x >= 32766 } ++func eq_32766_uint32(x uint32) bool { return x == 32766 } ++func ne_32766_uint32(x uint32) bool { return x != 32766 } ++func lt_32767_uint32(x uint32) bool { return x < 32767 } ++func le_32767_uint32(x uint32) bool { return x <= 32767 } ++func gt_32767_uint32(x uint32) bool { return x > 32767 } ++func ge_32767_uint32(x uint32) bool { return x >= 32767 } ++func eq_32767_uint32(x uint32) bool { return x == 32767 } ++func ne_32767_uint32(x uint32) bool { return x != 32767 } ++func lt_32768_uint32(x uint32) bool { return x < 32768 } ++func le_32768_uint32(x uint32) bool { return x <= 32768 } ++func gt_32768_uint32(x uint32) bool { return x > 32768 } ++func ge_32768_uint32(x uint32) bool { return x >= 32768 } ++func eq_32768_uint32(x uint32) bool { return x == 32768 } ++func ne_32768_uint32(x uint32) bool { return x != 32768 } ++func lt_65534_uint32(x uint32) bool { return x < 65534 } ++func le_65534_uint32(x uint32) bool { return x <= 65534 } ++func gt_65534_uint32(x uint32) bool { return x > 65534 } ++func ge_65534_uint32(x uint32) bool { return x >= 65534 } ++func eq_65534_uint32(x uint32) bool { return x == 65534 } ++func ne_65534_uint32(x uint32) bool { return x != 65534 } ++func lt_65535_uint32(x uint32) bool { return x < 65535 } ++func le_65535_uint32(x uint32) bool { return x <= 65535 } ++func gt_65535_uint32(x uint32) bool { return x > 65535 } ++func ge_65535_uint32(x uint32) bool { return x >= 65535 } ++func eq_65535_uint32(x uint32) bool { return x == 65535 } ++func ne_65535_uint32(x uint32) bool { return x != 65535 } ++func lt_65536_uint32(x uint32) bool { return x < 65536 } ++func le_65536_uint32(x uint32) bool { return x <= 65536 } ++func gt_65536_uint32(x uint32) bool { return x > 65536 } ++func ge_65536_uint32(x uint32) bool { return x >= 65536 } ++func eq_65536_uint32(x uint32) bool { return x == 65536 } ++func ne_65536_uint32(x uint32) bool { return x != 65536 } ++func lt_2147483646_uint32(x uint32) bool { return x < 2147483646 } ++func le_2147483646_uint32(x uint32) bool { return x <= 2147483646 } ++func gt_2147483646_uint32(x uint32) bool { return x > 2147483646 } ++func ge_2147483646_uint32(x uint32) bool { return x >= 2147483646 } ++func eq_2147483646_uint32(x uint32) bool { return x == 2147483646 } ++func ne_2147483646_uint32(x uint32) bool { return x != 2147483646 } ++func lt_2147483647_uint32(x uint32) bool { return x < 2147483647 } ++func le_2147483647_uint32(x uint32) bool { return x <= 2147483647 } ++func gt_2147483647_uint32(x uint32) bool { return x > 2147483647 } ++func ge_2147483647_uint32(x uint32) bool { return x >= 2147483647 } ++func eq_2147483647_uint32(x uint32) bool { return x == 2147483647 } ++func ne_2147483647_uint32(x uint32) bool { return x != 2147483647 } ++func lt_2147483648_uint32(x uint32) bool { return x < 2147483648 } ++func le_2147483648_uint32(x uint32) bool { return x <= 2147483648 } ++func gt_2147483648_uint32(x uint32) bool { return x > 2147483648 } ++func ge_2147483648_uint32(x uint32) bool { return x >= 2147483648 } ++func eq_2147483648_uint32(x uint32) bool { return x == 2147483648 } ++func ne_2147483648_uint32(x uint32) bool { return x != 2147483648 } ++func lt_4278190080_uint32(x uint32) bool { return x < 4278190080 } ++func le_4278190080_uint32(x uint32) bool { return x <= 4278190080 } ++func gt_4278190080_uint32(x uint32) bool { return x > 4278190080 } ++func ge_4278190080_uint32(x uint32) bool { return x >= 4278190080 } ++func eq_4278190080_uint32(x uint32) bool { return x == 4278190080 } ++func ne_4278190080_uint32(x uint32) bool { return x != 4278190080 } ++func lt_4294967294_uint32(x uint32) bool { return x < 4294967294 } ++func le_4294967294_uint32(x uint32) bool { return x <= 4294967294 } ++func gt_4294967294_uint32(x uint32) bool { return x > 4294967294 } ++func ge_4294967294_uint32(x uint32) bool { return x >= 4294967294 } ++func eq_4294967294_uint32(x uint32) bool { return x == 4294967294 } ++func ne_4294967294_uint32(x uint32) bool { return x != 4294967294 } ++func lt_4294967295_uint32(x uint32) bool { return x < 4294967295 } ++func le_4294967295_uint32(x uint32) bool { return x <= 4294967295 } ++func gt_4294967295_uint32(x uint32) bool { return x > 4294967295 } ++func ge_4294967295_uint32(x uint32) bool { return x >= 4294967295 } ++func eq_4294967295_uint32(x uint32) bool { return x == 4294967295 } ++func ne_4294967295_uint32(x uint32) bool { return x != 4294967295 } ++ ++var uint32_tests = []struct { ++ idx int // index of the constant used ++ exp result // expected results ++ fn func(uint32) bool ++}{ ++ {idx: 0, exp: lt, fn: lt_0_uint32}, ++ {idx: 0, exp: le, fn: le_0_uint32}, ++ {idx: 0, exp: gt, fn: gt_0_uint32}, ++ {idx: 0, exp: ge, fn: ge_0_uint32}, ++ {idx: 0, exp: eq, fn: eq_0_uint32}, ++ {idx: 0, exp: ne, fn: ne_0_uint32}, ++ {idx: 1, exp: lt, fn: lt_1_uint32}, ++ {idx: 1, exp: le, fn: le_1_uint32}, ++ {idx: 1, exp: gt, fn: gt_1_uint32}, ++ {idx: 1, exp: ge, fn: ge_1_uint32}, ++ {idx: 1, exp: eq, fn: eq_1_uint32}, ++ {idx: 1, exp: ne, fn: ne_1_uint32}, ++ {idx: 2, exp: lt, fn: lt_126_uint32}, ++ {idx: 2, exp: le, fn: le_126_uint32}, ++ {idx: 2, exp: gt, fn: gt_126_uint32}, ++ {idx: 2, exp: ge, fn: ge_126_uint32}, ++ {idx: 2, exp: eq, fn: eq_126_uint32}, ++ {idx: 2, exp: ne, fn: ne_126_uint32}, ++ {idx: 3, exp: lt, fn: lt_127_uint32}, ++ {idx: 3, exp: le, fn: le_127_uint32}, ++ {idx: 3, exp: gt, fn: gt_127_uint32}, ++ {idx: 3, exp: ge, fn: ge_127_uint32}, ++ {idx: 3, exp: eq, fn: eq_127_uint32}, ++ {idx: 3, exp: ne, fn: ne_127_uint32}, ++ {idx: 4, exp: lt, fn: lt_128_uint32}, ++ {idx: 4, exp: le, fn: le_128_uint32}, ++ {idx: 4, exp: gt, fn: gt_128_uint32}, ++ {idx: 4, exp: ge, fn: ge_128_uint32}, ++ {idx: 4, exp: eq, fn: eq_128_uint32}, ++ {idx: 4, exp: ne, fn: ne_128_uint32}, ++ {idx: 5, exp: lt, fn: lt_254_uint32}, ++ {idx: 5, exp: le, fn: le_254_uint32}, ++ {idx: 5, exp: gt, fn: gt_254_uint32}, ++ {idx: 5, exp: ge, fn: ge_254_uint32}, ++ {idx: 5, exp: eq, fn: eq_254_uint32}, ++ {idx: 5, exp: ne, fn: ne_254_uint32}, ++ {idx: 6, exp: lt, fn: lt_255_uint32}, ++ {idx: 6, exp: le, fn: le_255_uint32}, ++ {idx: 6, exp: gt, fn: gt_255_uint32}, ++ {idx: 6, exp: ge, fn: ge_255_uint32}, ++ {idx: 6, exp: eq, fn: eq_255_uint32}, ++ {idx: 6, exp: ne, fn: ne_255_uint32}, ++ {idx: 7, exp: lt, fn: lt_256_uint32}, ++ {idx: 7, exp: le, fn: le_256_uint32}, ++ {idx: 7, exp: gt, fn: gt_256_uint32}, ++ {idx: 7, exp: ge, fn: ge_256_uint32}, ++ {idx: 7, exp: eq, fn: eq_256_uint32}, ++ {idx: 7, exp: ne, fn: ne_256_uint32}, ++ {idx: 8, exp: lt, fn: lt_32766_uint32}, ++ {idx: 8, exp: le, fn: le_32766_uint32}, ++ {idx: 8, exp: gt, fn: gt_32766_uint32}, ++ {idx: 8, exp: ge, fn: ge_32766_uint32}, ++ {idx: 8, exp: eq, fn: eq_32766_uint32}, ++ {idx: 8, exp: ne, fn: ne_32766_uint32}, ++ {idx: 9, exp: lt, fn: lt_32767_uint32}, ++ {idx: 9, exp: le, fn: le_32767_uint32}, ++ {idx: 9, exp: gt, fn: gt_32767_uint32}, ++ {idx: 9, exp: ge, fn: ge_32767_uint32}, ++ {idx: 9, exp: eq, fn: eq_32767_uint32}, ++ {idx: 9, exp: ne, fn: ne_32767_uint32}, ++ {idx: 10, exp: lt, fn: lt_32768_uint32}, ++ {idx: 10, exp: le, fn: le_32768_uint32}, ++ {idx: 10, exp: gt, fn: gt_32768_uint32}, ++ {idx: 10, exp: ge, fn: ge_32768_uint32}, ++ {idx: 10, exp: eq, fn: eq_32768_uint32}, ++ {idx: 10, exp: ne, fn: ne_32768_uint32}, ++ {idx: 11, exp: lt, fn: lt_65534_uint32}, ++ {idx: 11, exp: le, fn: le_65534_uint32}, ++ {idx: 11, exp: gt, fn: gt_65534_uint32}, ++ {idx: 11, exp: ge, fn: ge_65534_uint32}, ++ {idx: 11, exp: eq, fn: eq_65534_uint32}, ++ {idx: 11, exp: ne, fn: ne_65534_uint32}, ++ {idx: 12, exp: lt, fn: lt_65535_uint32}, ++ {idx: 12, exp: le, fn: le_65535_uint32}, ++ {idx: 12, exp: gt, fn: gt_65535_uint32}, ++ {idx: 12, exp: ge, fn: ge_65535_uint32}, ++ {idx: 12, exp: eq, fn: eq_65535_uint32}, ++ {idx: 12, exp: ne, fn: ne_65535_uint32}, ++ {idx: 13, exp: lt, fn: lt_65536_uint32}, ++ {idx: 13, exp: le, fn: le_65536_uint32}, ++ {idx: 13, exp: gt, fn: gt_65536_uint32}, ++ {idx: 13, exp: ge, fn: ge_65536_uint32}, ++ {idx: 13, exp: eq, fn: eq_65536_uint32}, ++ {idx: 13, exp: ne, fn: ne_65536_uint32}, ++ {idx: 14, exp: lt, fn: lt_2147483646_uint32}, ++ {idx: 14, exp: le, fn: le_2147483646_uint32}, ++ {idx: 14, exp: gt, fn: gt_2147483646_uint32}, ++ {idx: 14, exp: ge, fn: ge_2147483646_uint32}, ++ {idx: 14, exp: eq, fn: eq_2147483646_uint32}, ++ {idx: 14, exp: ne, fn: ne_2147483646_uint32}, ++ {idx: 15, exp: lt, fn: lt_2147483647_uint32}, ++ {idx: 15, exp: le, fn: le_2147483647_uint32}, ++ {idx: 15, exp: gt, fn: gt_2147483647_uint32}, ++ {idx: 15, exp: ge, fn: ge_2147483647_uint32}, ++ {idx: 15, exp: eq, fn: eq_2147483647_uint32}, ++ {idx: 15, exp: ne, fn: ne_2147483647_uint32}, ++ {idx: 16, exp: lt, fn: lt_2147483648_uint32}, ++ {idx: 16, exp: le, fn: le_2147483648_uint32}, ++ {idx: 16, exp: gt, fn: gt_2147483648_uint32}, ++ {idx: 16, exp: ge, fn: ge_2147483648_uint32}, ++ {idx: 16, exp: eq, fn: eq_2147483648_uint32}, ++ {idx: 16, exp: ne, fn: ne_2147483648_uint32}, ++ {idx: 17, exp: lt, fn: lt_4278190080_uint32}, ++ {idx: 17, exp: le, fn: le_4278190080_uint32}, ++ {idx: 17, exp: gt, fn: gt_4278190080_uint32}, ++ {idx: 17, exp: ge, fn: ge_4278190080_uint32}, ++ {idx: 17, exp: eq, fn: eq_4278190080_uint32}, ++ {idx: 17, exp: ne, fn: ne_4278190080_uint32}, ++ {idx: 18, exp: lt, fn: lt_4294967294_uint32}, ++ {idx: 18, exp: le, fn: le_4294967294_uint32}, ++ {idx: 18, exp: gt, fn: gt_4294967294_uint32}, ++ {idx: 18, exp: ge, fn: ge_4294967294_uint32}, ++ {idx: 18, exp: eq, fn: eq_4294967294_uint32}, ++ {idx: 18, exp: ne, fn: ne_4294967294_uint32}, ++ {idx: 19, exp: lt, fn: lt_4294967295_uint32}, ++ {idx: 19, exp: le, fn: le_4294967295_uint32}, ++ {idx: 19, exp: gt, fn: gt_4294967295_uint32}, ++ {idx: 19, exp: ge, fn: ge_4294967295_uint32}, ++ {idx: 19, exp: eq, fn: eq_4294967295_uint32}, ++ {idx: 19, exp: ne, fn: ne_4294967295_uint32}, ++} ++ ++// uint16 tests ++var uint16_vals = []uint16{ ++ 0, ++ 1, ++ 126, ++ 127, ++ 128, ++ 254, ++ 255, ++ 256, ++ 32766, ++ 32767, ++ 32768, ++ 65534, ++ 65535, ++} ++ ++func lt_0_uint16(x uint16) bool { return x < 0 } ++func le_0_uint16(x uint16) bool { return x <= 0 } ++func gt_0_uint16(x uint16) bool { return x > 0 } ++func ge_0_uint16(x uint16) bool { return x >= 0 } ++func eq_0_uint16(x uint16) bool { return x == 0 } ++func ne_0_uint16(x uint16) bool { return x != 0 } ++func lt_1_uint16(x uint16) bool { return x < 1 } ++func le_1_uint16(x uint16) bool { return x <= 1 } ++func gt_1_uint16(x uint16) bool { return x > 1 } ++func ge_1_uint16(x uint16) bool { return x >= 1 } ++func eq_1_uint16(x uint16) bool { return x == 1 } ++func ne_1_uint16(x uint16) bool { return x != 1 } ++func lt_126_uint16(x uint16) bool { return x < 126 } ++func le_126_uint16(x uint16) bool { return x <= 126 } ++func gt_126_uint16(x uint16) bool { return x > 126 } ++func ge_126_uint16(x uint16) bool { return x >= 126 } ++func eq_126_uint16(x uint16) bool { return x == 126 } ++func ne_126_uint16(x uint16) bool { return x != 126 } ++func lt_127_uint16(x uint16) bool { return x < 127 } ++func le_127_uint16(x uint16) bool { return x <= 127 } ++func gt_127_uint16(x uint16) bool { return x > 127 } ++func ge_127_uint16(x uint16) bool { return x >= 127 } ++func eq_127_uint16(x uint16) bool { return x == 127 } ++func ne_127_uint16(x uint16) bool { return x != 127 } ++func lt_128_uint16(x uint16) bool { return x < 128 } ++func le_128_uint16(x uint16) bool { return x <= 128 } ++func gt_128_uint16(x uint16) bool { return x > 128 } ++func ge_128_uint16(x uint16) bool { return x >= 128 } ++func eq_128_uint16(x uint16) bool { return x == 128 } ++func ne_128_uint16(x uint16) bool { return x != 128 } ++func lt_254_uint16(x uint16) bool { return x < 254 } ++func le_254_uint16(x uint16) bool { return x <= 254 } ++func gt_254_uint16(x uint16) bool { return x > 254 } ++func ge_254_uint16(x uint16) bool { return x >= 254 } ++func eq_254_uint16(x uint16) bool { return x == 254 } ++func ne_254_uint16(x uint16) bool { return x != 254 } ++func lt_255_uint16(x uint16) bool { return x < 255 } ++func le_255_uint16(x uint16) bool { return x <= 255 } ++func gt_255_uint16(x uint16) bool { return x > 255 } ++func ge_255_uint16(x uint16) bool { return x >= 255 } ++func eq_255_uint16(x uint16) bool { return x == 255 } ++func ne_255_uint16(x uint16) bool { return x != 255 } ++func lt_256_uint16(x uint16) bool { return x < 256 } ++func le_256_uint16(x uint16) bool { return x <= 256 } ++func gt_256_uint16(x uint16) bool { return x > 256 } ++func ge_256_uint16(x uint16) bool { return x >= 256 } ++func eq_256_uint16(x uint16) bool { return x == 256 } ++func ne_256_uint16(x uint16) bool { return x != 256 } ++func lt_32766_uint16(x uint16) bool { return x < 32766 } ++func le_32766_uint16(x uint16) bool { return x <= 32766 } ++func gt_32766_uint16(x uint16) bool { return x > 32766 } ++func ge_32766_uint16(x uint16) bool { return x >= 32766 } ++func eq_32766_uint16(x uint16) bool { return x == 32766 } ++func ne_32766_uint16(x uint16) bool { return x != 32766 } ++func lt_32767_uint16(x uint16) bool { return x < 32767 } ++func le_32767_uint16(x uint16) bool { return x <= 32767 } ++func gt_32767_uint16(x uint16) bool { return x > 32767 } ++func ge_32767_uint16(x uint16) bool { return x >= 32767 } ++func eq_32767_uint16(x uint16) bool { return x == 32767 } ++func ne_32767_uint16(x uint16) bool { return x != 32767 } ++func lt_32768_uint16(x uint16) bool { return x < 32768 } ++func le_32768_uint16(x uint16) bool { return x <= 32768 } ++func gt_32768_uint16(x uint16) bool { return x > 32768 } ++func ge_32768_uint16(x uint16) bool { return x >= 32768 } ++func eq_32768_uint16(x uint16) bool { return x == 32768 } ++func ne_32768_uint16(x uint16) bool { return x != 32768 } ++func lt_65534_uint16(x uint16) bool { return x < 65534 } ++func le_65534_uint16(x uint16) bool { return x <= 65534 } ++func gt_65534_uint16(x uint16) bool { return x > 65534 } ++func ge_65534_uint16(x uint16) bool { return x >= 65534 } ++func eq_65534_uint16(x uint16) bool { return x == 65534 } ++func ne_65534_uint16(x uint16) bool { return x != 65534 } ++func lt_65535_uint16(x uint16) bool { return x < 65535 } ++func le_65535_uint16(x uint16) bool { return x <= 65535 } ++func gt_65535_uint16(x uint16) bool { return x > 65535 } ++func ge_65535_uint16(x uint16) bool { return x >= 65535 } ++func eq_65535_uint16(x uint16) bool { return x == 65535 } ++func ne_65535_uint16(x uint16) bool { return x != 65535 } ++ ++var uint16_tests = []struct { ++ idx int // index of the constant used ++ exp result // expected results ++ fn func(uint16) bool ++}{ ++ {idx: 0, exp: lt, fn: lt_0_uint16}, ++ {idx: 0, exp: le, fn: le_0_uint16}, ++ {idx: 0, exp: gt, fn: gt_0_uint16}, ++ {idx: 0, exp: ge, fn: ge_0_uint16}, ++ {idx: 0, exp: eq, fn: eq_0_uint16}, ++ {idx: 0, exp: ne, fn: ne_0_uint16}, ++ {idx: 1, exp: lt, fn: lt_1_uint16}, ++ {idx: 1, exp: le, fn: le_1_uint16}, ++ {idx: 1, exp: gt, fn: gt_1_uint16}, ++ {idx: 1, exp: ge, fn: ge_1_uint16}, ++ {idx: 1, exp: eq, fn: eq_1_uint16}, ++ {idx: 1, exp: ne, fn: ne_1_uint16}, ++ {idx: 2, exp: lt, fn: lt_126_uint16}, ++ {idx: 2, exp: le, fn: le_126_uint16}, ++ {idx: 2, exp: gt, fn: gt_126_uint16}, ++ {idx: 2, exp: ge, fn: ge_126_uint16}, ++ {idx: 2, exp: eq, fn: eq_126_uint16}, ++ {idx: 2, exp: ne, fn: ne_126_uint16}, ++ {idx: 3, exp: lt, fn: lt_127_uint16}, ++ {idx: 3, exp: le, fn: le_127_uint16}, ++ {idx: 3, exp: gt, fn: gt_127_uint16}, ++ {idx: 3, exp: ge, fn: ge_127_uint16}, ++ {idx: 3, exp: eq, fn: eq_127_uint16}, ++ {idx: 3, exp: ne, fn: ne_127_uint16}, ++ {idx: 4, exp: lt, fn: lt_128_uint16}, ++ {idx: 4, exp: le, fn: le_128_uint16}, ++ {idx: 4, exp: gt, fn: gt_128_uint16}, ++ {idx: 4, exp: ge, fn: ge_128_uint16}, ++ {idx: 4, exp: eq, fn: eq_128_uint16}, ++ {idx: 4, exp: ne, fn: ne_128_uint16}, ++ {idx: 5, exp: lt, fn: lt_254_uint16}, ++ {idx: 5, exp: le, fn: le_254_uint16}, ++ {idx: 5, exp: gt, fn: gt_254_uint16}, ++ {idx: 5, exp: ge, fn: ge_254_uint16}, ++ {idx: 5, exp: eq, fn: eq_254_uint16}, ++ {idx: 5, exp: ne, fn: ne_254_uint16}, ++ {idx: 6, exp: lt, fn: lt_255_uint16}, ++ {idx: 6, exp: le, fn: le_255_uint16}, ++ {idx: 6, exp: gt, fn: gt_255_uint16}, ++ {idx: 6, exp: ge, fn: ge_255_uint16}, ++ {idx: 6, exp: eq, fn: eq_255_uint16}, ++ {idx: 6, exp: ne, fn: ne_255_uint16}, ++ {idx: 7, exp: lt, fn: lt_256_uint16}, ++ {idx: 7, exp: le, fn: le_256_uint16}, ++ {idx: 7, exp: gt, fn: gt_256_uint16}, ++ {idx: 7, exp: ge, fn: ge_256_uint16}, ++ {idx: 7, exp: eq, fn: eq_256_uint16}, ++ {idx: 7, exp: ne, fn: ne_256_uint16}, ++ {idx: 8, exp: lt, fn: lt_32766_uint16}, ++ {idx: 8, exp: le, fn: le_32766_uint16}, ++ {idx: 8, exp: gt, fn: gt_32766_uint16}, ++ {idx: 8, exp: ge, fn: ge_32766_uint16}, ++ {idx: 8, exp: eq, fn: eq_32766_uint16}, ++ {idx: 8, exp: ne, fn: ne_32766_uint16}, ++ {idx: 9, exp: lt, fn: lt_32767_uint16}, ++ {idx: 9, exp: le, fn: le_32767_uint16}, ++ {idx: 9, exp: gt, fn: gt_32767_uint16}, ++ {idx: 9, exp: ge, fn: ge_32767_uint16}, ++ {idx: 9, exp: eq, fn: eq_32767_uint16}, ++ {idx: 9, exp: ne, fn: ne_32767_uint16}, ++ {idx: 10, exp: lt, fn: lt_32768_uint16}, ++ {idx: 10, exp: le, fn: le_32768_uint16}, ++ {idx: 10, exp: gt, fn: gt_32768_uint16}, ++ {idx: 10, exp: ge, fn: ge_32768_uint16}, ++ {idx: 10, exp: eq, fn: eq_32768_uint16}, ++ {idx: 10, exp: ne, fn: ne_32768_uint16}, ++ {idx: 11, exp: lt, fn: lt_65534_uint16}, ++ {idx: 11, exp: le, fn: le_65534_uint16}, ++ {idx: 11, exp: gt, fn: gt_65534_uint16}, ++ {idx: 11, exp: ge, fn: ge_65534_uint16}, ++ {idx: 11, exp: eq, fn: eq_65534_uint16}, ++ {idx: 11, exp: ne, fn: ne_65534_uint16}, ++ {idx: 12, exp: lt, fn: lt_65535_uint16}, ++ {idx: 12, exp: le, fn: le_65535_uint16}, ++ {idx: 12, exp: gt, fn: gt_65535_uint16}, ++ {idx: 12, exp: ge, fn: ge_65535_uint16}, ++ {idx: 12, exp: eq, fn: eq_65535_uint16}, ++ {idx: 12, exp: ne, fn: ne_65535_uint16}, ++} ++ ++// uint8 tests ++var uint8_vals = []uint8{ ++ 0, ++ 1, ++ 126, ++ 127, ++ 128, ++ 254, ++ 255, ++} ++ ++func lt_0_uint8(x uint8) bool { return x < 0 } ++func le_0_uint8(x uint8) bool { return x <= 0 } ++func gt_0_uint8(x uint8) bool { return x > 0 } ++func ge_0_uint8(x uint8) bool { return x >= 0 } ++func eq_0_uint8(x uint8) bool { return x == 0 } ++func ne_0_uint8(x uint8) bool { return x != 0 } ++func lt_1_uint8(x uint8) bool { return x < 1 } ++func le_1_uint8(x uint8) bool { return x <= 1 } ++func gt_1_uint8(x uint8) bool { return x > 1 } ++func ge_1_uint8(x uint8) bool { return x >= 1 } ++func eq_1_uint8(x uint8) bool { return x == 1 } ++func ne_1_uint8(x uint8) bool { return x != 1 } ++func lt_126_uint8(x uint8) bool { return x < 126 } ++func le_126_uint8(x uint8) bool { return x <= 126 } ++func gt_126_uint8(x uint8) bool { return x > 126 } ++func ge_126_uint8(x uint8) bool { return x >= 126 } ++func eq_126_uint8(x uint8) bool { return x == 126 } ++func ne_126_uint8(x uint8) bool { return x != 126 } ++func lt_127_uint8(x uint8) bool { return x < 127 } ++func le_127_uint8(x uint8) bool { return x <= 127 } ++func gt_127_uint8(x uint8) bool { return x > 127 } ++func ge_127_uint8(x uint8) bool { return x >= 127 } ++func eq_127_uint8(x uint8) bool { return x == 127 } ++func ne_127_uint8(x uint8) bool { return x != 127 } ++func lt_128_uint8(x uint8) bool { return x < 128 } ++func le_128_uint8(x uint8) bool { return x <= 128 } ++func gt_128_uint8(x uint8) bool { return x > 128 } ++func ge_128_uint8(x uint8) bool { return x >= 128 } ++func eq_128_uint8(x uint8) bool { return x == 128 } ++func ne_128_uint8(x uint8) bool { return x != 128 } ++func lt_254_uint8(x uint8) bool { return x < 254 } ++func le_254_uint8(x uint8) bool { return x <= 254 } ++func gt_254_uint8(x uint8) bool { return x > 254 } ++func ge_254_uint8(x uint8) bool { return x >= 254 } ++func eq_254_uint8(x uint8) bool { return x == 254 } ++func ne_254_uint8(x uint8) bool { return x != 254 } ++func lt_255_uint8(x uint8) bool { return x < 255 } ++func le_255_uint8(x uint8) bool { return x <= 255 } ++func gt_255_uint8(x uint8) bool { return x > 255 } ++func ge_255_uint8(x uint8) bool { return x >= 255 } ++func eq_255_uint8(x uint8) bool { return x == 255 } ++func ne_255_uint8(x uint8) bool { return x != 255 } ++ ++var uint8_tests = []struct { ++ idx int // index of the constant used ++ exp result // expected results ++ fn func(uint8) bool ++}{ ++ {idx: 0, exp: lt, fn: lt_0_uint8}, ++ {idx: 0, exp: le, fn: le_0_uint8}, ++ {idx: 0, exp: gt, fn: gt_0_uint8}, ++ {idx: 0, exp: ge, fn: ge_0_uint8}, ++ {idx: 0, exp: eq, fn: eq_0_uint8}, ++ {idx: 0, exp: ne, fn: ne_0_uint8}, ++ {idx: 1, exp: lt, fn: lt_1_uint8}, ++ {idx: 1, exp: le, fn: le_1_uint8}, ++ {idx: 1, exp: gt, fn: gt_1_uint8}, ++ {idx: 1, exp: ge, fn: ge_1_uint8}, ++ {idx: 1, exp: eq, fn: eq_1_uint8}, ++ {idx: 1, exp: ne, fn: ne_1_uint8}, ++ {idx: 2, exp: lt, fn: lt_126_uint8}, ++ {idx: 2, exp: le, fn: le_126_uint8}, ++ {idx: 2, exp: gt, fn: gt_126_uint8}, ++ {idx: 2, exp: ge, fn: ge_126_uint8}, ++ {idx: 2, exp: eq, fn: eq_126_uint8}, ++ {idx: 2, exp: ne, fn: ne_126_uint8}, ++ {idx: 3, exp: lt, fn: lt_127_uint8}, ++ {idx: 3, exp: le, fn: le_127_uint8}, ++ {idx: 3, exp: gt, fn: gt_127_uint8}, ++ {idx: 3, exp: ge, fn: ge_127_uint8}, ++ {idx: 3, exp: eq, fn: eq_127_uint8}, ++ {idx: 3, exp: ne, fn: ne_127_uint8}, ++ {idx: 4, exp: lt, fn: lt_128_uint8}, ++ {idx: 4, exp: le, fn: le_128_uint8}, ++ {idx: 4, exp: gt, fn: gt_128_uint8}, ++ {idx: 4, exp: ge, fn: ge_128_uint8}, ++ {idx: 4, exp: eq, fn: eq_128_uint8}, ++ {idx: 4, exp: ne, fn: ne_128_uint8}, ++ {idx: 5, exp: lt, fn: lt_254_uint8}, ++ {idx: 5, exp: le, fn: le_254_uint8}, ++ {idx: 5, exp: gt, fn: gt_254_uint8}, ++ {idx: 5, exp: ge, fn: ge_254_uint8}, ++ {idx: 5, exp: eq, fn: eq_254_uint8}, ++ {idx: 5, exp: ne, fn: ne_254_uint8}, ++ {idx: 6, exp: lt, fn: lt_255_uint8}, ++ {idx: 6, exp: le, fn: le_255_uint8}, ++ {idx: 6, exp: gt, fn: gt_255_uint8}, ++ {idx: 6, exp: ge, fn: ge_255_uint8}, ++ {idx: 6, exp: eq, fn: eq_255_uint8}, ++ {idx: 6, exp: ne, fn: ne_255_uint8}, ++} ++ ++// int64 tests ++var int64_vals = []int64{ ++ -9223372036854775808, ++ -9223372036854775807, ++ -2147483649, ++ -2147483648, ++ -2147483647, ++ -32769, ++ -32768, ++ -32767, ++ -129, ++ -128, ++ -127, ++ -1, ++ 0, ++ 1, ++ 126, ++ 127, ++ 128, ++ 254, ++ 255, ++ 256, ++ 32766, ++ 32767, ++ 32768, ++ 65534, ++ 65535, ++ 65536, ++ 2147483646, ++ 2147483647, ++ 2147483648, ++ 4278190080, ++ 4294967294, ++ 4294967295, ++ 4294967296, ++ 1095216660480, ++ 9223372036854775806, ++ 9223372036854775807, ++} ++ ++func lt_neg9223372036854775808_int64(x int64) bool { return x < -9223372036854775808 } ++func le_neg9223372036854775808_int64(x int64) bool { return x <= -9223372036854775808 } ++func gt_neg9223372036854775808_int64(x int64) bool { return x > -9223372036854775808 } ++func ge_neg9223372036854775808_int64(x int64) bool { return x >= -9223372036854775808 } ++func eq_neg9223372036854775808_int64(x int64) bool { return x == -9223372036854775808 } ++func ne_neg9223372036854775808_int64(x int64) bool { return x != -9223372036854775808 } ++func lt_neg9223372036854775807_int64(x int64) bool { return x < -9223372036854775807 } ++func le_neg9223372036854775807_int64(x int64) bool { return x <= -9223372036854775807 } ++func gt_neg9223372036854775807_int64(x int64) bool { return x > -9223372036854775807 } ++func ge_neg9223372036854775807_int64(x int64) bool { return x >= -9223372036854775807 } ++func eq_neg9223372036854775807_int64(x int64) bool { return x == -9223372036854775807 } ++func ne_neg9223372036854775807_int64(x int64) bool { return x != -9223372036854775807 } ++func lt_neg2147483649_int64(x int64) bool { return x < -2147483649 } ++func le_neg2147483649_int64(x int64) bool { return x <= -2147483649 } ++func gt_neg2147483649_int64(x int64) bool { return x > -2147483649 } ++func ge_neg2147483649_int64(x int64) bool { return x >= -2147483649 } ++func eq_neg2147483649_int64(x int64) bool { return x == -2147483649 } ++func ne_neg2147483649_int64(x int64) bool { return x != -2147483649 } ++func lt_neg2147483648_int64(x int64) bool { return x < -2147483648 } ++func le_neg2147483648_int64(x int64) bool { return x <= -2147483648 } ++func gt_neg2147483648_int64(x int64) bool { return x > -2147483648 } ++func ge_neg2147483648_int64(x int64) bool { return x >= -2147483648 } ++func eq_neg2147483648_int64(x int64) bool { return x == -2147483648 } ++func ne_neg2147483648_int64(x int64) bool { return x != -2147483648 } ++func lt_neg2147483647_int64(x int64) bool { return x < -2147483647 } ++func le_neg2147483647_int64(x int64) bool { return x <= -2147483647 } ++func gt_neg2147483647_int64(x int64) bool { return x > -2147483647 } ++func ge_neg2147483647_int64(x int64) bool { return x >= -2147483647 } ++func eq_neg2147483647_int64(x int64) bool { return x == -2147483647 } ++func ne_neg2147483647_int64(x int64) bool { return x != -2147483647 } ++func lt_neg32769_int64(x int64) bool { return x < -32769 } ++func le_neg32769_int64(x int64) bool { return x <= -32769 } ++func gt_neg32769_int64(x int64) bool { return x > -32769 } ++func ge_neg32769_int64(x int64) bool { return x >= -32769 } ++func eq_neg32769_int64(x int64) bool { return x == -32769 } ++func ne_neg32769_int64(x int64) bool { return x != -32769 } ++func lt_neg32768_int64(x int64) bool { return x < -32768 } ++func le_neg32768_int64(x int64) bool { return x <= -32768 } ++func gt_neg32768_int64(x int64) bool { return x > -32768 } ++func ge_neg32768_int64(x int64) bool { return x >= -32768 } ++func eq_neg32768_int64(x int64) bool { return x == -32768 } ++func ne_neg32768_int64(x int64) bool { return x != -32768 } ++func lt_neg32767_int64(x int64) bool { return x < -32767 } ++func le_neg32767_int64(x int64) bool { return x <= -32767 } ++func gt_neg32767_int64(x int64) bool { return x > -32767 } ++func ge_neg32767_int64(x int64) bool { return x >= -32767 } ++func eq_neg32767_int64(x int64) bool { return x == -32767 } ++func ne_neg32767_int64(x int64) bool { return x != -32767 } ++func lt_neg129_int64(x int64) bool { return x < -129 } ++func le_neg129_int64(x int64) bool { return x <= -129 } ++func gt_neg129_int64(x int64) bool { return x > -129 } ++func ge_neg129_int64(x int64) bool { return x >= -129 } ++func eq_neg129_int64(x int64) bool { return x == -129 } ++func ne_neg129_int64(x int64) bool { return x != -129 } ++func lt_neg128_int64(x int64) bool { return x < -128 } ++func le_neg128_int64(x int64) bool { return x <= -128 } ++func gt_neg128_int64(x int64) bool { return x > -128 } ++func ge_neg128_int64(x int64) bool { return x >= -128 } ++func eq_neg128_int64(x int64) bool { return x == -128 } ++func ne_neg128_int64(x int64) bool { return x != -128 } ++func lt_neg127_int64(x int64) bool { return x < -127 } ++func le_neg127_int64(x int64) bool { return x <= -127 } ++func gt_neg127_int64(x int64) bool { return x > -127 } ++func ge_neg127_int64(x int64) bool { return x >= -127 } ++func eq_neg127_int64(x int64) bool { return x == -127 } ++func ne_neg127_int64(x int64) bool { return x != -127 } ++func lt_neg1_int64(x int64) bool { return x < -1 } ++func le_neg1_int64(x int64) bool { return x <= -1 } ++func gt_neg1_int64(x int64) bool { return x > -1 } ++func ge_neg1_int64(x int64) bool { return x >= -1 } ++func eq_neg1_int64(x int64) bool { return x == -1 } ++func ne_neg1_int64(x int64) bool { return x != -1 } ++func lt_0_int64(x int64) bool { return x < 0 } ++func le_0_int64(x int64) bool { return x <= 0 } ++func gt_0_int64(x int64) bool { return x > 0 } ++func ge_0_int64(x int64) bool { return x >= 0 } ++func eq_0_int64(x int64) bool { return x == 0 } ++func ne_0_int64(x int64) bool { return x != 0 } ++func lt_1_int64(x int64) bool { return x < 1 } ++func le_1_int64(x int64) bool { return x <= 1 } ++func gt_1_int64(x int64) bool { return x > 1 } ++func ge_1_int64(x int64) bool { return x >= 1 } ++func eq_1_int64(x int64) bool { return x == 1 } ++func ne_1_int64(x int64) bool { return x != 1 } ++func lt_126_int64(x int64) bool { return x < 126 } ++func le_126_int64(x int64) bool { return x <= 126 } ++func gt_126_int64(x int64) bool { return x > 126 } ++func ge_126_int64(x int64) bool { return x >= 126 } ++func eq_126_int64(x int64) bool { return x == 126 } ++func ne_126_int64(x int64) bool { return x != 126 } ++func lt_127_int64(x int64) bool { return x < 127 } ++func le_127_int64(x int64) bool { return x <= 127 } ++func gt_127_int64(x int64) bool { return x > 127 } ++func ge_127_int64(x int64) bool { return x >= 127 } ++func eq_127_int64(x int64) bool { return x == 127 } ++func ne_127_int64(x int64) bool { return x != 127 } ++func lt_128_int64(x int64) bool { return x < 128 } ++func le_128_int64(x int64) bool { return x <= 128 } ++func gt_128_int64(x int64) bool { return x > 128 } ++func ge_128_int64(x int64) bool { return x >= 128 } ++func eq_128_int64(x int64) bool { return x == 128 } ++func ne_128_int64(x int64) bool { return x != 128 } ++func lt_254_int64(x int64) bool { return x < 254 } ++func le_254_int64(x int64) bool { return x <= 254 } ++func gt_254_int64(x int64) bool { return x > 254 } ++func ge_254_int64(x int64) bool { return x >= 254 } ++func eq_254_int64(x int64) bool { return x == 254 } ++func ne_254_int64(x int64) bool { return x != 254 } ++func lt_255_int64(x int64) bool { return x < 255 } ++func le_255_int64(x int64) bool { return x <= 255 } ++func gt_255_int64(x int64) bool { return x > 255 } ++func ge_255_int64(x int64) bool { return x >= 255 } ++func eq_255_int64(x int64) bool { return x == 255 } ++func ne_255_int64(x int64) bool { return x != 255 } ++func lt_256_int64(x int64) bool { return x < 256 } ++func le_256_int64(x int64) bool { return x <= 256 } ++func gt_256_int64(x int64) bool { return x > 256 } ++func ge_256_int64(x int64) bool { return x >= 256 } ++func eq_256_int64(x int64) bool { return x == 256 } ++func ne_256_int64(x int64) bool { return x != 256 } ++func lt_32766_int64(x int64) bool { return x < 32766 } ++func le_32766_int64(x int64) bool { return x <= 32766 } ++func gt_32766_int64(x int64) bool { return x > 32766 } ++func ge_32766_int64(x int64) bool { return x >= 32766 } ++func eq_32766_int64(x int64) bool { return x == 32766 } ++func ne_32766_int64(x int64) bool { return x != 32766 } ++func lt_32767_int64(x int64) bool { return x < 32767 } ++func le_32767_int64(x int64) bool { return x <= 32767 } ++func gt_32767_int64(x int64) bool { return x > 32767 } ++func ge_32767_int64(x int64) bool { return x >= 32767 } ++func eq_32767_int64(x int64) bool { return x == 32767 } ++func ne_32767_int64(x int64) bool { return x != 32767 } ++func lt_32768_int64(x int64) bool { return x < 32768 } ++func le_32768_int64(x int64) bool { return x <= 32768 } ++func gt_32768_int64(x int64) bool { return x > 32768 } ++func ge_32768_int64(x int64) bool { return x >= 32768 } ++func eq_32768_int64(x int64) bool { return x == 32768 } ++func ne_32768_int64(x int64) bool { return x != 32768 } ++func lt_65534_int64(x int64) bool { return x < 65534 } ++func le_65534_int64(x int64) bool { return x <= 65534 } ++func gt_65534_int64(x int64) bool { return x > 65534 } ++func ge_65534_int64(x int64) bool { return x >= 65534 } ++func eq_65534_int64(x int64) bool { return x == 65534 } ++func ne_65534_int64(x int64) bool { return x != 65534 } ++func lt_65535_int64(x int64) bool { return x < 65535 } ++func le_65535_int64(x int64) bool { return x <= 65535 } ++func gt_65535_int64(x int64) bool { return x > 65535 } ++func ge_65535_int64(x int64) bool { return x >= 65535 } ++func eq_65535_int64(x int64) bool { return x == 65535 } ++func ne_65535_int64(x int64) bool { return x != 65535 } ++func lt_65536_int64(x int64) bool { return x < 65536 } ++func le_65536_int64(x int64) bool { return x <= 65536 } ++func gt_65536_int64(x int64) bool { return x > 65536 } ++func ge_65536_int64(x int64) bool { return x >= 65536 } ++func eq_65536_int64(x int64) bool { return x == 65536 } ++func ne_65536_int64(x int64) bool { return x != 65536 } ++func lt_2147483646_int64(x int64) bool { return x < 2147483646 } ++func le_2147483646_int64(x int64) bool { return x <= 2147483646 } ++func gt_2147483646_int64(x int64) bool { return x > 2147483646 } ++func ge_2147483646_int64(x int64) bool { return x >= 2147483646 } ++func eq_2147483646_int64(x int64) bool { return x == 2147483646 } ++func ne_2147483646_int64(x int64) bool { return x != 2147483646 } ++func lt_2147483647_int64(x int64) bool { return x < 2147483647 } ++func le_2147483647_int64(x int64) bool { return x <= 2147483647 } ++func gt_2147483647_int64(x int64) bool { return x > 2147483647 } ++func ge_2147483647_int64(x int64) bool { return x >= 2147483647 } ++func eq_2147483647_int64(x int64) bool { return x == 2147483647 } ++func ne_2147483647_int64(x int64) bool { return x != 2147483647 } ++func lt_2147483648_int64(x int64) bool { return x < 2147483648 } ++func le_2147483648_int64(x int64) bool { return x <= 2147483648 } ++func gt_2147483648_int64(x int64) bool { return x > 2147483648 } ++func ge_2147483648_int64(x int64) bool { return x >= 2147483648 } ++func eq_2147483648_int64(x int64) bool { return x == 2147483648 } ++func ne_2147483648_int64(x int64) bool { return x != 2147483648 } ++func lt_4278190080_int64(x int64) bool { return x < 4278190080 } ++func le_4278190080_int64(x int64) bool { return x <= 4278190080 } ++func gt_4278190080_int64(x int64) bool { return x > 4278190080 } ++func ge_4278190080_int64(x int64) bool { return x >= 4278190080 } ++func eq_4278190080_int64(x int64) bool { return x == 4278190080 } ++func ne_4278190080_int64(x int64) bool { return x != 4278190080 } ++func lt_4294967294_int64(x int64) bool { return x < 4294967294 } ++func le_4294967294_int64(x int64) bool { return x <= 4294967294 } ++func gt_4294967294_int64(x int64) bool { return x > 4294967294 } ++func ge_4294967294_int64(x int64) bool { return x >= 4294967294 } ++func eq_4294967294_int64(x int64) bool { return x == 4294967294 } ++func ne_4294967294_int64(x int64) bool { return x != 4294967294 } ++func lt_4294967295_int64(x int64) bool { return x < 4294967295 } ++func le_4294967295_int64(x int64) bool { return x <= 4294967295 } ++func gt_4294967295_int64(x int64) bool { return x > 4294967295 } ++func ge_4294967295_int64(x int64) bool { return x >= 4294967295 } ++func eq_4294967295_int64(x int64) bool { return x == 4294967295 } ++func ne_4294967295_int64(x int64) bool { return x != 4294967295 } ++func lt_4294967296_int64(x int64) bool { return x < 4294967296 } ++func le_4294967296_int64(x int64) bool { return x <= 4294967296 } ++func gt_4294967296_int64(x int64) bool { return x > 4294967296 } ++func ge_4294967296_int64(x int64) bool { return x >= 4294967296 } ++func eq_4294967296_int64(x int64) bool { return x == 4294967296 } ++func ne_4294967296_int64(x int64) bool { return x != 4294967296 } ++func lt_1095216660480_int64(x int64) bool { return x < 1095216660480 } ++func le_1095216660480_int64(x int64) bool { return x <= 1095216660480 } ++func gt_1095216660480_int64(x int64) bool { return x > 1095216660480 } ++func ge_1095216660480_int64(x int64) bool { return x >= 1095216660480 } ++func eq_1095216660480_int64(x int64) bool { return x == 1095216660480 } ++func ne_1095216660480_int64(x int64) bool { return x != 1095216660480 } ++func lt_9223372036854775806_int64(x int64) bool { return x < 9223372036854775806 } ++func le_9223372036854775806_int64(x int64) bool { return x <= 9223372036854775806 } ++func gt_9223372036854775806_int64(x int64) bool { return x > 9223372036854775806 } ++func ge_9223372036854775806_int64(x int64) bool { return x >= 9223372036854775806 } ++func eq_9223372036854775806_int64(x int64) bool { return x == 9223372036854775806 } ++func ne_9223372036854775806_int64(x int64) bool { return x != 9223372036854775806 } ++func lt_9223372036854775807_int64(x int64) bool { return x < 9223372036854775807 } ++func le_9223372036854775807_int64(x int64) bool { return x <= 9223372036854775807 } ++func gt_9223372036854775807_int64(x int64) bool { return x > 9223372036854775807 } ++func ge_9223372036854775807_int64(x int64) bool { return x >= 9223372036854775807 } ++func eq_9223372036854775807_int64(x int64) bool { return x == 9223372036854775807 } ++func ne_9223372036854775807_int64(x int64) bool { return x != 9223372036854775807 } ++ ++var int64_tests = []struct { ++ idx int // index of the constant used ++ exp result // expected results ++ fn func(int64) bool ++}{ ++ {idx: 0, exp: lt, fn: lt_neg9223372036854775808_int64}, ++ {idx: 0, exp: le, fn: le_neg9223372036854775808_int64}, ++ {idx: 0, exp: gt, fn: gt_neg9223372036854775808_int64}, ++ {idx: 0, exp: ge, fn: ge_neg9223372036854775808_int64}, ++ {idx: 0, exp: eq, fn: eq_neg9223372036854775808_int64}, ++ {idx: 0, exp: ne, fn: ne_neg9223372036854775808_int64}, ++ {idx: 1, exp: lt, fn: lt_neg9223372036854775807_int64}, ++ {idx: 1, exp: le, fn: le_neg9223372036854775807_int64}, ++ {idx: 1, exp: gt, fn: gt_neg9223372036854775807_int64}, ++ {idx: 1, exp: ge, fn: ge_neg9223372036854775807_int64}, ++ {idx: 1, exp: eq, fn: eq_neg9223372036854775807_int64}, ++ {idx: 1, exp: ne, fn: ne_neg9223372036854775807_int64}, ++ {idx: 2, exp: lt, fn: lt_neg2147483649_int64}, ++ {idx: 2, exp: le, fn: le_neg2147483649_int64}, ++ {idx: 2, exp: gt, fn: gt_neg2147483649_int64}, ++ {idx: 2, exp: ge, fn: ge_neg2147483649_int64}, ++ {idx: 2, exp: eq, fn: eq_neg2147483649_int64}, ++ {idx: 2, exp: ne, fn: ne_neg2147483649_int64}, ++ {idx: 3, exp: lt, fn: lt_neg2147483648_int64}, ++ {idx: 3, exp: le, fn: le_neg2147483648_int64}, ++ {idx: 3, exp: gt, fn: gt_neg2147483648_int64}, ++ {idx: 3, exp: ge, fn: ge_neg2147483648_int64}, ++ {idx: 3, exp: eq, fn: eq_neg2147483648_int64}, ++ {idx: 3, exp: ne, fn: ne_neg2147483648_int64}, ++ {idx: 4, exp: lt, fn: lt_neg2147483647_int64}, ++ {idx: 4, exp: le, fn: le_neg2147483647_int64}, ++ {idx: 4, exp: gt, fn: gt_neg2147483647_int64}, ++ {idx: 4, exp: ge, fn: ge_neg2147483647_int64}, ++ {idx: 4, exp: eq, fn: eq_neg2147483647_int64}, ++ {idx: 4, exp: ne, fn: ne_neg2147483647_int64}, ++ {idx: 5, exp: lt, fn: lt_neg32769_int64}, ++ {idx: 5, exp: le, fn: le_neg32769_int64}, ++ {idx: 5, exp: gt, fn: gt_neg32769_int64}, ++ {idx: 5, exp: ge, fn: ge_neg32769_int64}, ++ {idx: 5, exp: eq, fn: eq_neg32769_int64}, ++ {idx: 5, exp: ne, fn: ne_neg32769_int64}, ++ {idx: 6, exp: lt, fn: lt_neg32768_int64}, ++ {idx: 6, exp: le, fn: le_neg32768_int64}, ++ {idx: 6, exp: gt, fn: gt_neg32768_int64}, ++ {idx: 6, exp: ge, fn: ge_neg32768_int64}, ++ {idx: 6, exp: eq, fn: eq_neg32768_int64}, ++ {idx: 6, exp: ne, fn: ne_neg32768_int64}, ++ {idx: 7, exp: lt, fn: lt_neg32767_int64}, ++ {idx: 7, exp: le, fn: le_neg32767_int64}, ++ {idx: 7, exp: gt, fn: gt_neg32767_int64}, ++ {idx: 7, exp: ge, fn: ge_neg32767_int64}, ++ {idx: 7, exp: eq, fn: eq_neg32767_int64}, ++ {idx: 7, exp: ne, fn: ne_neg32767_int64}, ++ {idx: 8, exp: lt, fn: lt_neg129_int64}, ++ {idx: 8, exp: le, fn: le_neg129_int64}, ++ {idx: 8, exp: gt, fn: gt_neg129_int64}, ++ {idx: 8, exp: ge, fn: ge_neg129_int64}, ++ {idx: 8, exp: eq, fn: eq_neg129_int64}, ++ {idx: 8, exp: ne, fn: ne_neg129_int64}, ++ {idx: 9, exp: lt, fn: lt_neg128_int64}, ++ {idx: 9, exp: le, fn: le_neg128_int64}, ++ {idx: 9, exp: gt, fn: gt_neg128_int64}, ++ {idx: 9, exp: ge, fn: ge_neg128_int64}, ++ {idx: 9, exp: eq, fn: eq_neg128_int64}, ++ {idx: 9, exp: ne, fn: ne_neg128_int64}, ++ {idx: 10, exp: lt, fn: lt_neg127_int64}, ++ {idx: 10, exp: le, fn: le_neg127_int64}, ++ {idx: 10, exp: gt, fn: gt_neg127_int64}, ++ {idx: 10, exp: ge, fn: ge_neg127_int64}, ++ {idx: 10, exp: eq, fn: eq_neg127_int64}, ++ {idx: 10, exp: ne, fn: ne_neg127_int64}, ++ {idx: 11, exp: lt, fn: lt_neg1_int64}, ++ {idx: 11, exp: le, fn: le_neg1_int64}, ++ {idx: 11, exp: gt, fn: gt_neg1_int64}, ++ {idx: 11, exp: ge, fn: ge_neg1_int64}, ++ {idx: 11, exp: eq, fn: eq_neg1_int64}, ++ {idx: 11, exp: ne, fn: ne_neg1_int64}, ++ {idx: 12, exp: lt, fn: lt_0_int64}, ++ {idx: 12, exp: le, fn: le_0_int64}, ++ {idx: 12, exp: gt, fn: gt_0_int64}, ++ {idx: 12, exp: ge, fn: ge_0_int64}, ++ {idx: 12, exp: eq, fn: eq_0_int64}, ++ {idx: 12, exp: ne, fn: ne_0_int64}, ++ {idx: 13, exp: lt, fn: lt_1_int64}, ++ {idx: 13, exp: le, fn: le_1_int64}, ++ {idx: 13, exp: gt, fn: gt_1_int64}, ++ {idx: 13, exp: ge, fn: ge_1_int64}, ++ {idx: 13, exp: eq, fn: eq_1_int64}, ++ {idx: 13, exp: ne, fn: ne_1_int64}, ++ {idx: 14, exp: lt, fn: lt_126_int64}, ++ {idx: 14, exp: le, fn: le_126_int64}, ++ {idx: 14, exp: gt, fn: gt_126_int64}, ++ {idx: 14, exp: ge, fn: ge_126_int64}, ++ {idx: 14, exp: eq, fn: eq_126_int64}, ++ {idx: 14, exp: ne, fn: ne_126_int64}, ++ {idx: 15, exp: lt, fn: lt_127_int64}, ++ {idx: 15, exp: le, fn: le_127_int64}, ++ {idx: 15, exp: gt, fn: gt_127_int64}, ++ {idx: 15, exp: ge, fn: ge_127_int64}, ++ {idx: 15, exp: eq, fn: eq_127_int64}, ++ {idx: 15, exp: ne, fn: ne_127_int64}, ++ {idx: 16, exp: lt, fn: lt_128_int64}, ++ {idx: 16, exp: le, fn: le_128_int64}, ++ {idx: 16, exp: gt, fn: gt_128_int64}, ++ {idx: 16, exp: ge, fn: ge_128_int64}, ++ {idx: 16, exp: eq, fn: eq_128_int64}, ++ {idx: 16, exp: ne, fn: ne_128_int64}, ++ {idx: 17, exp: lt, fn: lt_254_int64}, ++ {idx: 17, exp: le, fn: le_254_int64}, ++ {idx: 17, exp: gt, fn: gt_254_int64}, ++ {idx: 17, exp: ge, fn: ge_254_int64}, ++ {idx: 17, exp: eq, fn: eq_254_int64}, ++ {idx: 17, exp: ne, fn: ne_254_int64}, ++ {idx: 18, exp: lt, fn: lt_255_int64}, ++ {idx: 18, exp: le, fn: le_255_int64}, ++ {idx: 18, exp: gt, fn: gt_255_int64}, ++ {idx: 18, exp: ge, fn: ge_255_int64}, ++ {idx: 18, exp: eq, fn: eq_255_int64}, ++ {idx: 18, exp: ne, fn: ne_255_int64}, ++ {idx: 19, exp: lt, fn: lt_256_int64}, ++ {idx: 19, exp: le, fn: le_256_int64}, ++ {idx: 19, exp: gt, fn: gt_256_int64}, ++ {idx: 19, exp: ge, fn: ge_256_int64}, ++ {idx: 19, exp: eq, fn: eq_256_int64}, ++ {idx: 19, exp: ne, fn: ne_256_int64}, ++ {idx: 20, exp: lt, fn: lt_32766_int64}, ++ {idx: 20, exp: le, fn: le_32766_int64}, ++ {idx: 20, exp: gt, fn: gt_32766_int64}, ++ {idx: 20, exp: ge, fn: ge_32766_int64}, ++ {idx: 20, exp: eq, fn: eq_32766_int64}, ++ {idx: 20, exp: ne, fn: ne_32766_int64}, ++ {idx: 21, exp: lt, fn: lt_32767_int64}, ++ {idx: 21, exp: le, fn: le_32767_int64}, ++ {idx: 21, exp: gt, fn: gt_32767_int64}, ++ {idx: 21, exp: ge, fn: ge_32767_int64}, ++ {idx: 21, exp: eq, fn: eq_32767_int64}, ++ {idx: 21, exp: ne, fn: ne_32767_int64}, ++ {idx: 22, exp: lt, fn: lt_32768_int64}, ++ {idx: 22, exp: le, fn: le_32768_int64}, ++ {idx: 22, exp: gt, fn: gt_32768_int64}, ++ {idx: 22, exp: ge, fn: ge_32768_int64}, ++ {idx: 22, exp: eq, fn: eq_32768_int64}, ++ {idx: 22, exp: ne, fn: ne_32768_int64}, ++ {idx: 23, exp: lt, fn: lt_65534_int64}, ++ {idx: 23, exp: le, fn: le_65534_int64}, ++ {idx: 23, exp: gt, fn: gt_65534_int64}, ++ {idx: 23, exp: ge, fn: ge_65534_int64}, ++ {idx: 23, exp: eq, fn: eq_65534_int64}, ++ {idx: 23, exp: ne, fn: ne_65534_int64}, ++ {idx: 24, exp: lt, fn: lt_65535_int64}, ++ {idx: 24, exp: le, fn: le_65535_int64}, ++ {idx: 24, exp: gt, fn: gt_65535_int64}, ++ {idx: 24, exp: ge, fn: ge_65535_int64}, ++ {idx: 24, exp: eq, fn: eq_65535_int64}, ++ {idx: 24, exp: ne, fn: ne_65535_int64}, ++ {idx: 25, exp: lt, fn: lt_65536_int64}, ++ {idx: 25, exp: le, fn: le_65536_int64}, ++ {idx: 25, exp: gt, fn: gt_65536_int64}, ++ {idx: 25, exp: ge, fn: ge_65536_int64}, ++ {idx: 25, exp: eq, fn: eq_65536_int64}, ++ {idx: 25, exp: ne, fn: ne_65536_int64}, ++ {idx: 26, exp: lt, fn: lt_2147483646_int64}, ++ {idx: 26, exp: le, fn: le_2147483646_int64}, ++ {idx: 26, exp: gt, fn: gt_2147483646_int64}, ++ {idx: 26, exp: ge, fn: ge_2147483646_int64}, ++ {idx: 26, exp: eq, fn: eq_2147483646_int64}, ++ {idx: 26, exp: ne, fn: ne_2147483646_int64}, ++ {idx: 27, exp: lt, fn: lt_2147483647_int64}, ++ {idx: 27, exp: le, fn: le_2147483647_int64}, ++ {idx: 27, exp: gt, fn: gt_2147483647_int64}, ++ {idx: 27, exp: ge, fn: ge_2147483647_int64}, ++ {idx: 27, exp: eq, fn: eq_2147483647_int64}, ++ {idx: 27, exp: ne, fn: ne_2147483647_int64}, ++ {idx: 28, exp: lt, fn: lt_2147483648_int64}, ++ {idx: 28, exp: le, fn: le_2147483648_int64}, ++ {idx: 28, exp: gt, fn: gt_2147483648_int64}, ++ {idx: 28, exp: ge, fn: ge_2147483648_int64}, ++ {idx: 28, exp: eq, fn: eq_2147483648_int64}, ++ {idx: 28, exp: ne, fn: ne_2147483648_int64}, ++ {idx: 29, exp: lt, fn: lt_4278190080_int64}, ++ {idx: 29, exp: le, fn: le_4278190080_int64}, ++ {idx: 29, exp: gt, fn: gt_4278190080_int64}, ++ {idx: 29, exp: ge, fn: ge_4278190080_int64}, ++ {idx: 29, exp: eq, fn: eq_4278190080_int64}, ++ {idx: 29, exp: ne, fn: ne_4278190080_int64}, ++ {idx: 30, exp: lt, fn: lt_4294967294_int64}, ++ {idx: 30, exp: le, fn: le_4294967294_int64}, ++ {idx: 30, exp: gt, fn: gt_4294967294_int64}, ++ {idx: 30, exp: ge, fn: ge_4294967294_int64}, ++ {idx: 30, exp: eq, fn: eq_4294967294_int64}, ++ {idx: 30, exp: ne, fn: ne_4294967294_int64}, ++ {idx: 31, exp: lt, fn: lt_4294967295_int64}, ++ {idx: 31, exp: le, fn: le_4294967295_int64}, ++ {idx: 31, exp: gt, fn: gt_4294967295_int64}, ++ {idx: 31, exp: ge, fn: ge_4294967295_int64}, ++ {idx: 31, exp: eq, fn: eq_4294967295_int64}, ++ {idx: 31, exp: ne, fn: ne_4294967295_int64}, ++ {idx: 32, exp: lt, fn: lt_4294967296_int64}, ++ {idx: 32, exp: le, fn: le_4294967296_int64}, ++ {idx: 32, exp: gt, fn: gt_4294967296_int64}, ++ {idx: 32, exp: ge, fn: ge_4294967296_int64}, ++ {idx: 32, exp: eq, fn: eq_4294967296_int64}, ++ {idx: 32, exp: ne, fn: ne_4294967296_int64}, ++ {idx: 33, exp: lt, fn: lt_1095216660480_int64}, ++ {idx: 33, exp: le, fn: le_1095216660480_int64}, ++ {idx: 33, exp: gt, fn: gt_1095216660480_int64}, ++ {idx: 33, exp: ge, fn: ge_1095216660480_int64}, ++ {idx: 33, exp: eq, fn: eq_1095216660480_int64}, ++ {idx: 33, exp: ne, fn: ne_1095216660480_int64}, ++ {idx: 34, exp: lt, fn: lt_9223372036854775806_int64}, ++ {idx: 34, exp: le, fn: le_9223372036854775806_int64}, ++ {idx: 34, exp: gt, fn: gt_9223372036854775806_int64}, ++ {idx: 34, exp: ge, fn: ge_9223372036854775806_int64}, ++ {idx: 34, exp: eq, fn: eq_9223372036854775806_int64}, ++ {idx: 34, exp: ne, fn: ne_9223372036854775806_int64}, ++ {idx: 35, exp: lt, fn: lt_9223372036854775807_int64}, ++ {idx: 35, exp: le, fn: le_9223372036854775807_int64}, ++ {idx: 35, exp: gt, fn: gt_9223372036854775807_int64}, ++ {idx: 35, exp: ge, fn: ge_9223372036854775807_int64}, ++ {idx: 35, exp: eq, fn: eq_9223372036854775807_int64}, ++ {idx: 35, exp: ne, fn: ne_9223372036854775807_int64}, ++} ++ ++// int32 tests ++var int32_vals = []int32{ ++ -2147483648, ++ -2147483647, ++ -32769, ++ -32768, ++ -32767, ++ -129, ++ -128, ++ -127, ++ -1, ++ 0, ++ 1, ++ 126, ++ 127, ++ 128, ++ 254, ++ 255, ++ 256, ++ 32766, ++ 32767, ++ 32768, ++ 65534, ++ 65535, ++ 65536, ++ 2147483646, ++ 2147483647, ++} ++ ++func lt_neg2147483648_int32(x int32) bool { return x < -2147483648 } ++func le_neg2147483648_int32(x int32) bool { return x <= -2147483648 } ++func gt_neg2147483648_int32(x int32) bool { return x > -2147483648 } ++func ge_neg2147483648_int32(x int32) bool { return x >= -2147483648 } ++func eq_neg2147483648_int32(x int32) bool { return x == -2147483648 } ++func ne_neg2147483648_int32(x int32) bool { return x != -2147483648 } ++func lt_neg2147483647_int32(x int32) bool { return x < -2147483647 } ++func le_neg2147483647_int32(x int32) bool { return x <= -2147483647 } ++func gt_neg2147483647_int32(x int32) bool { return x > -2147483647 } ++func ge_neg2147483647_int32(x int32) bool { return x >= -2147483647 } ++func eq_neg2147483647_int32(x int32) bool { return x == -2147483647 } ++func ne_neg2147483647_int32(x int32) bool { return x != -2147483647 } ++func lt_neg32769_int32(x int32) bool { return x < -32769 } ++func le_neg32769_int32(x int32) bool { return x <= -32769 } ++func gt_neg32769_int32(x int32) bool { return x > -32769 } ++func ge_neg32769_int32(x int32) bool { return x >= -32769 } ++func eq_neg32769_int32(x int32) bool { return x == -32769 } ++func ne_neg32769_int32(x int32) bool { return x != -32769 } ++func lt_neg32768_int32(x int32) bool { return x < -32768 } ++func le_neg32768_int32(x int32) bool { return x <= -32768 } ++func gt_neg32768_int32(x int32) bool { return x > -32768 } ++func ge_neg32768_int32(x int32) bool { return x >= -32768 } ++func eq_neg32768_int32(x int32) bool { return x == -32768 } ++func ne_neg32768_int32(x int32) bool { return x != -32768 } ++func lt_neg32767_int32(x int32) bool { return x < -32767 } ++func le_neg32767_int32(x int32) bool { return x <= -32767 } ++func gt_neg32767_int32(x int32) bool { return x > -32767 } ++func ge_neg32767_int32(x int32) bool { return x >= -32767 } ++func eq_neg32767_int32(x int32) bool { return x == -32767 } ++func ne_neg32767_int32(x int32) bool { return x != -32767 } ++func lt_neg129_int32(x int32) bool { return x < -129 } ++func le_neg129_int32(x int32) bool { return x <= -129 } ++func gt_neg129_int32(x int32) bool { return x > -129 } ++func ge_neg129_int32(x int32) bool { return x >= -129 } ++func eq_neg129_int32(x int32) bool { return x == -129 } ++func ne_neg129_int32(x int32) bool { return x != -129 } ++func lt_neg128_int32(x int32) bool { return x < -128 } ++func le_neg128_int32(x int32) bool { return x <= -128 } ++func gt_neg128_int32(x int32) bool { return x > -128 } ++func ge_neg128_int32(x int32) bool { return x >= -128 } ++func eq_neg128_int32(x int32) bool { return x == -128 } ++func ne_neg128_int32(x int32) bool { return x != -128 } ++func lt_neg127_int32(x int32) bool { return x < -127 } ++func le_neg127_int32(x int32) bool { return x <= -127 } ++func gt_neg127_int32(x int32) bool { return x > -127 } ++func ge_neg127_int32(x int32) bool { return x >= -127 } ++func eq_neg127_int32(x int32) bool { return x == -127 } ++func ne_neg127_int32(x int32) bool { return x != -127 } ++func lt_neg1_int32(x int32) bool { return x < -1 } ++func le_neg1_int32(x int32) bool { return x <= -1 } ++func gt_neg1_int32(x int32) bool { return x > -1 } ++func ge_neg1_int32(x int32) bool { return x >= -1 } ++func eq_neg1_int32(x int32) bool { return x == -1 } ++func ne_neg1_int32(x int32) bool { return x != -1 } ++func lt_0_int32(x int32) bool { return x < 0 } ++func le_0_int32(x int32) bool { return x <= 0 } ++func gt_0_int32(x int32) bool { return x > 0 } ++func ge_0_int32(x int32) bool { return x >= 0 } ++func eq_0_int32(x int32) bool { return x == 0 } ++func ne_0_int32(x int32) bool { return x != 0 } ++func lt_1_int32(x int32) bool { return x < 1 } ++func le_1_int32(x int32) bool { return x <= 1 } ++func gt_1_int32(x int32) bool { return x > 1 } ++func ge_1_int32(x int32) bool { return x >= 1 } ++func eq_1_int32(x int32) bool { return x == 1 } ++func ne_1_int32(x int32) bool { return x != 1 } ++func lt_126_int32(x int32) bool { return x < 126 } ++func le_126_int32(x int32) bool { return x <= 126 } ++func gt_126_int32(x int32) bool { return x > 126 } ++func ge_126_int32(x int32) bool { return x >= 126 } ++func eq_126_int32(x int32) bool { return x == 126 } ++func ne_126_int32(x int32) bool { return x != 126 } ++func lt_127_int32(x int32) bool { return x < 127 } ++func le_127_int32(x int32) bool { return x <= 127 } ++func gt_127_int32(x int32) bool { return x > 127 } ++func ge_127_int32(x int32) bool { return x >= 127 } ++func eq_127_int32(x int32) bool { return x == 127 } ++func ne_127_int32(x int32) bool { return x != 127 } ++func lt_128_int32(x int32) bool { return x < 128 } ++func le_128_int32(x int32) bool { return x <= 128 } ++func gt_128_int32(x int32) bool { return x > 128 } ++func ge_128_int32(x int32) bool { return x >= 128 } ++func eq_128_int32(x int32) bool { return x == 128 } ++func ne_128_int32(x int32) bool { return x != 128 } ++func lt_254_int32(x int32) bool { return x < 254 } ++func le_254_int32(x int32) bool { return x <= 254 } ++func gt_254_int32(x int32) bool { return x > 254 } ++func ge_254_int32(x int32) bool { return x >= 254 } ++func eq_254_int32(x int32) bool { return x == 254 } ++func ne_254_int32(x int32) bool { return x != 254 } ++func lt_255_int32(x int32) bool { return x < 255 } ++func le_255_int32(x int32) bool { return x <= 255 } ++func gt_255_int32(x int32) bool { return x > 255 } ++func ge_255_int32(x int32) bool { return x >= 255 } ++func eq_255_int32(x int32) bool { return x == 255 } ++func ne_255_int32(x int32) bool { return x != 255 } ++func lt_256_int32(x int32) bool { return x < 256 } ++func le_256_int32(x int32) bool { return x <= 256 } ++func gt_256_int32(x int32) bool { return x > 256 } ++func ge_256_int32(x int32) bool { return x >= 256 } ++func eq_256_int32(x int32) bool { return x == 256 } ++func ne_256_int32(x int32) bool { return x != 256 } ++func lt_32766_int32(x int32) bool { return x < 32766 } ++func le_32766_int32(x int32) bool { return x <= 32766 } ++func gt_32766_int32(x int32) bool { return x > 32766 } ++func ge_32766_int32(x int32) bool { return x >= 32766 } ++func eq_32766_int32(x int32) bool { return x == 32766 } ++func ne_32766_int32(x int32) bool { return x != 32766 } ++func lt_32767_int32(x int32) bool { return x < 32767 } ++func le_32767_int32(x int32) bool { return x <= 32767 } ++func gt_32767_int32(x int32) bool { return x > 32767 } ++func ge_32767_int32(x int32) bool { return x >= 32767 } ++func eq_32767_int32(x int32) bool { return x == 32767 } ++func ne_32767_int32(x int32) bool { return x != 32767 } ++func lt_32768_int32(x int32) bool { return x < 32768 } ++func le_32768_int32(x int32) bool { return x <= 32768 } ++func gt_32768_int32(x int32) bool { return x > 32768 } ++func ge_32768_int32(x int32) bool { return x >= 32768 } ++func eq_32768_int32(x int32) bool { return x == 32768 } ++func ne_32768_int32(x int32) bool { return x != 32768 } ++func lt_65534_int32(x int32) bool { return x < 65534 } ++func le_65534_int32(x int32) bool { return x <= 65534 } ++func gt_65534_int32(x int32) bool { return x > 65534 } ++func ge_65534_int32(x int32) bool { return x >= 65534 } ++func eq_65534_int32(x int32) bool { return x == 65534 } ++func ne_65534_int32(x int32) bool { return x != 65534 } ++func lt_65535_int32(x int32) bool { return x < 65535 } ++func le_65535_int32(x int32) bool { return x <= 65535 } ++func gt_65535_int32(x int32) bool { return x > 65535 } ++func ge_65535_int32(x int32) bool { return x >= 65535 } ++func eq_65535_int32(x int32) bool { return x == 65535 } ++func ne_65535_int32(x int32) bool { return x != 65535 } ++func lt_65536_int32(x int32) bool { return x < 65536 } ++func le_65536_int32(x int32) bool { return x <= 65536 } ++func gt_65536_int32(x int32) bool { return x > 65536 } ++func ge_65536_int32(x int32) bool { return x >= 65536 } ++func eq_65536_int32(x int32) bool { return x == 65536 } ++func ne_65536_int32(x int32) bool { return x != 65536 } ++func lt_2147483646_int32(x int32) bool { return x < 2147483646 } ++func le_2147483646_int32(x int32) bool { return x <= 2147483646 } ++func gt_2147483646_int32(x int32) bool { return x > 2147483646 } ++func ge_2147483646_int32(x int32) bool { return x >= 2147483646 } ++func eq_2147483646_int32(x int32) bool { return x == 2147483646 } ++func ne_2147483646_int32(x int32) bool { return x != 2147483646 } ++func lt_2147483647_int32(x int32) bool { return x < 2147483647 } ++func le_2147483647_int32(x int32) bool { return x <= 2147483647 } ++func gt_2147483647_int32(x int32) bool { return x > 2147483647 } ++func ge_2147483647_int32(x int32) bool { return x >= 2147483647 } ++func eq_2147483647_int32(x int32) bool { return x == 2147483647 } ++func ne_2147483647_int32(x int32) bool { return x != 2147483647 } ++ ++var int32_tests = []struct { ++ idx int // index of the constant used ++ exp result // expected results ++ fn func(int32) bool ++}{ ++ {idx: 0, exp: lt, fn: lt_neg2147483648_int32}, ++ {idx: 0, exp: le, fn: le_neg2147483648_int32}, ++ {idx: 0, exp: gt, fn: gt_neg2147483648_int32}, ++ {idx: 0, exp: ge, fn: ge_neg2147483648_int32}, ++ {idx: 0, exp: eq, fn: eq_neg2147483648_int32}, ++ {idx: 0, exp: ne, fn: ne_neg2147483648_int32}, ++ {idx: 1, exp: lt, fn: lt_neg2147483647_int32}, ++ {idx: 1, exp: le, fn: le_neg2147483647_int32}, ++ {idx: 1, exp: gt, fn: gt_neg2147483647_int32}, ++ {idx: 1, exp: ge, fn: ge_neg2147483647_int32}, ++ {idx: 1, exp: eq, fn: eq_neg2147483647_int32}, ++ {idx: 1, exp: ne, fn: ne_neg2147483647_int32}, ++ {idx: 2, exp: lt, fn: lt_neg32769_int32}, ++ {idx: 2, exp: le, fn: le_neg32769_int32}, ++ {idx: 2, exp: gt, fn: gt_neg32769_int32}, ++ {idx: 2, exp: ge, fn: ge_neg32769_int32}, ++ {idx: 2, exp: eq, fn: eq_neg32769_int32}, ++ {idx: 2, exp: ne, fn: ne_neg32769_int32}, ++ {idx: 3, exp: lt, fn: lt_neg32768_int32}, ++ {idx: 3, exp: le, fn: le_neg32768_int32}, ++ {idx: 3, exp: gt, fn: gt_neg32768_int32}, ++ {idx: 3, exp: ge, fn: ge_neg32768_int32}, ++ {idx: 3, exp: eq, fn: eq_neg32768_int32}, ++ {idx: 3, exp: ne, fn: ne_neg32768_int32}, ++ {idx: 4, exp: lt, fn: lt_neg32767_int32}, ++ {idx: 4, exp: le, fn: le_neg32767_int32}, ++ {idx: 4, exp: gt, fn: gt_neg32767_int32}, ++ {idx: 4, exp: ge, fn: ge_neg32767_int32}, ++ {idx: 4, exp: eq, fn: eq_neg32767_int32}, ++ {idx: 4, exp: ne, fn: ne_neg32767_int32}, ++ {idx: 5, exp: lt, fn: lt_neg129_int32}, ++ {idx: 5, exp: le, fn: le_neg129_int32}, ++ {idx: 5, exp: gt, fn: gt_neg129_int32}, ++ {idx: 5, exp: ge, fn: ge_neg129_int32}, ++ {idx: 5, exp: eq, fn: eq_neg129_int32}, ++ {idx: 5, exp: ne, fn: ne_neg129_int32}, ++ {idx: 6, exp: lt, fn: lt_neg128_int32}, ++ {idx: 6, exp: le, fn: le_neg128_int32}, ++ {idx: 6, exp: gt, fn: gt_neg128_int32}, ++ {idx: 6, exp: ge, fn: ge_neg128_int32}, ++ {idx: 6, exp: eq, fn: eq_neg128_int32}, ++ {idx: 6, exp: ne, fn: ne_neg128_int32}, ++ {idx: 7, exp: lt, fn: lt_neg127_int32}, ++ {idx: 7, exp: le, fn: le_neg127_int32}, ++ {idx: 7, exp: gt, fn: gt_neg127_int32}, ++ {idx: 7, exp: ge, fn: ge_neg127_int32}, ++ {idx: 7, exp: eq, fn: eq_neg127_int32}, ++ {idx: 7, exp: ne, fn: ne_neg127_int32}, ++ {idx: 8, exp: lt, fn: lt_neg1_int32}, ++ {idx: 8, exp: le, fn: le_neg1_int32}, ++ {idx: 8, exp: gt, fn: gt_neg1_int32}, ++ {idx: 8, exp: ge, fn: ge_neg1_int32}, ++ {idx: 8, exp: eq, fn: eq_neg1_int32}, ++ {idx: 8, exp: ne, fn: ne_neg1_int32}, ++ {idx: 9, exp: lt, fn: lt_0_int32}, ++ {idx: 9, exp: le, fn: le_0_int32}, ++ {idx: 9, exp: gt, fn: gt_0_int32}, ++ {idx: 9, exp: ge, fn: ge_0_int32}, ++ {idx: 9, exp: eq, fn: eq_0_int32}, ++ {idx: 9, exp: ne, fn: ne_0_int32}, ++ {idx: 10, exp: lt, fn: lt_1_int32}, ++ {idx: 10, exp: le, fn: le_1_int32}, ++ {idx: 10, exp: gt, fn: gt_1_int32}, ++ {idx: 10, exp: ge, fn: ge_1_int32}, ++ {idx: 10, exp: eq, fn: eq_1_int32}, ++ {idx: 10, exp: ne, fn: ne_1_int32}, ++ {idx: 11, exp: lt, fn: lt_126_int32}, ++ {idx: 11, exp: le, fn: le_126_int32}, ++ {idx: 11, exp: gt, fn: gt_126_int32}, ++ {idx: 11, exp: ge, fn: ge_126_int32}, ++ {idx: 11, exp: eq, fn: eq_126_int32}, ++ {idx: 11, exp: ne, fn: ne_126_int32}, ++ {idx: 12, exp: lt, fn: lt_127_int32}, ++ {idx: 12, exp: le, fn: le_127_int32}, ++ {idx: 12, exp: gt, fn: gt_127_int32}, ++ {idx: 12, exp: ge, fn: ge_127_int32}, ++ {idx: 12, exp: eq, fn: eq_127_int32}, ++ {idx: 12, exp: ne, fn: ne_127_int32}, ++ {idx: 13, exp: lt, fn: lt_128_int32}, ++ {idx: 13, exp: le, fn: le_128_int32}, ++ {idx: 13, exp: gt, fn: gt_128_int32}, ++ {idx: 13, exp: ge, fn: ge_128_int32}, ++ {idx: 13, exp: eq, fn: eq_128_int32}, ++ {idx: 13, exp: ne, fn: ne_128_int32}, ++ {idx: 14, exp: lt, fn: lt_254_int32}, ++ {idx: 14, exp: le, fn: le_254_int32}, ++ {idx: 14, exp: gt, fn: gt_254_int32}, ++ {idx: 14, exp: ge, fn: ge_254_int32}, ++ {idx: 14, exp: eq, fn: eq_254_int32}, ++ {idx: 14, exp: ne, fn: ne_254_int32}, ++ {idx: 15, exp: lt, fn: lt_255_int32}, ++ {idx: 15, exp: le, fn: le_255_int32}, ++ {idx: 15, exp: gt, fn: gt_255_int32}, ++ {idx: 15, exp: ge, fn: ge_255_int32}, ++ {idx: 15, exp: eq, fn: eq_255_int32}, ++ {idx: 15, exp: ne, fn: ne_255_int32}, ++ {idx: 16, exp: lt, fn: lt_256_int32}, ++ {idx: 16, exp: le, fn: le_256_int32}, ++ {idx: 16, exp: gt, fn: gt_256_int32}, ++ {idx: 16, exp: ge, fn: ge_256_int32}, ++ {idx: 16, exp: eq, fn: eq_256_int32}, ++ {idx: 16, exp: ne, fn: ne_256_int32}, ++ {idx: 17, exp: lt, fn: lt_32766_int32}, ++ {idx: 17, exp: le, fn: le_32766_int32}, ++ {idx: 17, exp: gt, fn: gt_32766_int32}, ++ {idx: 17, exp: ge, fn: ge_32766_int32}, ++ {idx: 17, exp: eq, fn: eq_32766_int32}, ++ {idx: 17, exp: ne, fn: ne_32766_int32}, ++ {idx: 18, exp: lt, fn: lt_32767_int32}, ++ {idx: 18, exp: le, fn: le_32767_int32}, ++ {idx: 18, exp: gt, fn: gt_32767_int32}, ++ {idx: 18, exp: ge, fn: ge_32767_int32}, ++ {idx: 18, exp: eq, fn: eq_32767_int32}, ++ {idx: 18, exp: ne, fn: ne_32767_int32}, ++ {idx: 19, exp: lt, fn: lt_32768_int32}, ++ {idx: 19, exp: le, fn: le_32768_int32}, ++ {idx: 19, exp: gt, fn: gt_32768_int32}, ++ {idx: 19, exp: ge, fn: ge_32768_int32}, ++ {idx: 19, exp: eq, fn: eq_32768_int32}, ++ {idx: 19, exp: ne, fn: ne_32768_int32}, ++ {idx: 20, exp: lt, fn: lt_65534_int32}, ++ {idx: 20, exp: le, fn: le_65534_int32}, ++ {idx: 20, exp: gt, fn: gt_65534_int32}, ++ {idx: 20, exp: ge, fn: ge_65534_int32}, ++ {idx: 20, exp: eq, fn: eq_65534_int32}, ++ {idx: 20, exp: ne, fn: ne_65534_int32}, ++ {idx: 21, exp: lt, fn: lt_65535_int32}, ++ {idx: 21, exp: le, fn: le_65535_int32}, ++ {idx: 21, exp: gt, fn: gt_65535_int32}, ++ {idx: 21, exp: ge, fn: ge_65535_int32}, ++ {idx: 21, exp: eq, fn: eq_65535_int32}, ++ {idx: 21, exp: ne, fn: ne_65535_int32}, ++ {idx: 22, exp: lt, fn: lt_65536_int32}, ++ {idx: 22, exp: le, fn: le_65536_int32}, ++ {idx: 22, exp: gt, fn: gt_65536_int32}, ++ {idx: 22, exp: ge, fn: ge_65536_int32}, ++ {idx: 22, exp: eq, fn: eq_65536_int32}, ++ {idx: 22, exp: ne, fn: ne_65536_int32}, ++ {idx: 23, exp: lt, fn: lt_2147483646_int32}, ++ {idx: 23, exp: le, fn: le_2147483646_int32}, ++ {idx: 23, exp: gt, fn: gt_2147483646_int32}, ++ {idx: 23, exp: ge, fn: ge_2147483646_int32}, ++ {idx: 23, exp: eq, fn: eq_2147483646_int32}, ++ {idx: 23, exp: ne, fn: ne_2147483646_int32}, ++ {idx: 24, exp: lt, fn: lt_2147483647_int32}, ++ {idx: 24, exp: le, fn: le_2147483647_int32}, ++ {idx: 24, exp: gt, fn: gt_2147483647_int32}, ++ {idx: 24, exp: ge, fn: ge_2147483647_int32}, ++ {idx: 24, exp: eq, fn: eq_2147483647_int32}, ++ {idx: 24, exp: ne, fn: ne_2147483647_int32}, ++} ++ ++// int16 tests ++var int16_vals = []int16{ ++ -32768, ++ -32767, ++ -129, ++ -128, ++ -127, ++ -1, ++ 0, ++ 1, ++ 126, ++ 127, ++ 128, ++ 254, ++ 255, ++ 256, ++ 32766, ++ 32767, ++} ++ ++func lt_neg32768_int16(x int16) bool { return x < -32768 } ++func le_neg32768_int16(x int16) bool { return x <= -32768 } ++func gt_neg32768_int16(x int16) bool { return x > -32768 } ++func ge_neg32768_int16(x int16) bool { return x >= -32768 } ++func eq_neg32768_int16(x int16) bool { return x == -32768 } ++func ne_neg32768_int16(x int16) bool { return x != -32768 } ++func lt_neg32767_int16(x int16) bool { return x < -32767 } ++func le_neg32767_int16(x int16) bool { return x <= -32767 } ++func gt_neg32767_int16(x int16) bool { return x > -32767 } ++func ge_neg32767_int16(x int16) bool { return x >= -32767 } ++func eq_neg32767_int16(x int16) bool { return x == -32767 } ++func ne_neg32767_int16(x int16) bool { return x != -32767 } ++func lt_neg129_int16(x int16) bool { return x < -129 } ++func le_neg129_int16(x int16) bool { return x <= -129 } ++func gt_neg129_int16(x int16) bool { return x > -129 } ++func ge_neg129_int16(x int16) bool { return x >= -129 } ++func eq_neg129_int16(x int16) bool { return x == -129 } ++func ne_neg129_int16(x int16) bool { return x != -129 } ++func lt_neg128_int16(x int16) bool { return x < -128 } ++func le_neg128_int16(x int16) bool { return x <= -128 } ++func gt_neg128_int16(x int16) bool { return x > -128 } ++func ge_neg128_int16(x int16) bool { return x >= -128 } ++func eq_neg128_int16(x int16) bool { return x == -128 } ++func ne_neg128_int16(x int16) bool { return x != -128 } ++func lt_neg127_int16(x int16) bool { return x < -127 } ++func le_neg127_int16(x int16) bool { return x <= -127 } ++func gt_neg127_int16(x int16) bool { return x > -127 } ++func ge_neg127_int16(x int16) bool { return x >= -127 } ++func eq_neg127_int16(x int16) bool { return x == -127 } ++func ne_neg127_int16(x int16) bool { return x != -127 } ++func lt_neg1_int16(x int16) bool { return x < -1 } ++func le_neg1_int16(x int16) bool { return x <= -1 } ++func gt_neg1_int16(x int16) bool { return x > -1 } ++func ge_neg1_int16(x int16) bool { return x >= -1 } ++func eq_neg1_int16(x int16) bool { return x == -1 } ++func ne_neg1_int16(x int16) bool { return x != -1 } ++func lt_0_int16(x int16) bool { return x < 0 } ++func le_0_int16(x int16) bool { return x <= 0 } ++func gt_0_int16(x int16) bool { return x > 0 } ++func ge_0_int16(x int16) bool { return x >= 0 } ++func eq_0_int16(x int16) bool { return x == 0 } ++func ne_0_int16(x int16) bool { return x != 0 } ++func lt_1_int16(x int16) bool { return x < 1 } ++func le_1_int16(x int16) bool { return x <= 1 } ++func gt_1_int16(x int16) bool { return x > 1 } ++func ge_1_int16(x int16) bool { return x >= 1 } ++func eq_1_int16(x int16) bool { return x == 1 } ++func ne_1_int16(x int16) bool { return x != 1 } ++func lt_126_int16(x int16) bool { return x < 126 } ++func le_126_int16(x int16) bool { return x <= 126 } ++func gt_126_int16(x int16) bool { return x > 126 } ++func ge_126_int16(x int16) bool { return x >= 126 } ++func eq_126_int16(x int16) bool { return x == 126 } ++func ne_126_int16(x int16) bool { return x != 126 } ++func lt_127_int16(x int16) bool { return x < 127 } ++func le_127_int16(x int16) bool { return x <= 127 } ++func gt_127_int16(x int16) bool { return x > 127 } ++func ge_127_int16(x int16) bool { return x >= 127 } ++func eq_127_int16(x int16) bool { return x == 127 } ++func ne_127_int16(x int16) bool { return x != 127 } ++func lt_128_int16(x int16) bool { return x < 128 } ++func le_128_int16(x int16) bool { return x <= 128 } ++func gt_128_int16(x int16) bool { return x > 128 } ++func ge_128_int16(x int16) bool { return x >= 128 } ++func eq_128_int16(x int16) bool { return x == 128 } ++func ne_128_int16(x int16) bool { return x != 128 } ++func lt_254_int16(x int16) bool { return x < 254 } ++func le_254_int16(x int16) bool { return x <= 254 } ++func gt_254_int16(x int16) bool { return x > 254 } ++func ge_254_int16(x int16) bool { return x >= 254 } ++func eq_254_int16(x int16) bool { return x == 254 } ++func ne_254_int16(x int16) bool { return x != 254 } ++func lt_255_int16(x int16) bool { return x < 255 } ++func le_255_int16(x int16) bool { return x <= 255 } ++func gt_255_int16(x int16) bool { return x > 255 } ++func ge_255_int16(x int16) bool { return x >= 255 } ++func eq_255_int16(x int16) bool { return x == 255 } ++func ne_255_int16(x int16) bool { return x != 255 } ++func lt_256_int16(x int16) bool { return x < 256 } ++func le_256_int16(x int16) bool { return x <= 256 } ++func gt_256_int16(x int16) bool { return x > 256 } ++func ge_256_int16(x int16) bool { return x >= 256 } ++func eq_256_int16(x int16) bool { return x == 256 } ++func ne_256_int16(x int16) bool { return x != 256 } ++func lt_32766_int16(x int16) bool { return x < 32766 } ++func le_32766_int16(x int16) bool { return x <= 32766 } ++func gt_32766_int16(x int16) bool { return x > 32766 } ++func ge_32766_int16(x int16) bool { return x >= 32766 } ++func eq_32766_int16(x int16) bool { return x == 32766 } ++func ne_32766_int16(x int16) bool { return x != 32766 } ++func lt_32767_int16(x int16) bool { return x < 32767 } ++func le_32767_int16(x int16) bool { return x <= 32767 } ++func gt_32767_int16(x int16) bool { return x > 32767 } ++func ge_32767_int16(x int16) bool { return x >= 32767 } ++func eq_32767_int16(x int16) bool { return x == 32767 } ++func ne_32767_int16(x int16) bool { return x != 32767 } ++ ++var int16_tests = []struct { ++ idx int // index of the constant used ++ exp result // expected results ++ fn func(int16) bool ++}{ ++ {idx: 0, exp: lt, fn: lt_neg32768_int16}, ++ {idx: 0, exp: le, fn: le_neg32768_int16}, ++ {idx: 0, exp: gt, fn: gt_neg32768_int16}, ++ {idx: 0, exp: ge, fn: ge_neg32768_int16}, ++ {idx: 0, exp: eq, fn: eq_neg32768_int16}, ++ {idx: 0, exp: ne, fn: ne_neg32768_int16}, ++ {idx: 1, exp: lt, fn: lt_neg32767_int16}, ++ {idx: 1, exp: le, fn: le_neg32767_int16}, ++ {idx: 1, exp: gt, fn: gt_neg32767_int16}, ++ {idx: 1, exp: ge, fn: ge_neg32767_int16}, ++ {idx: 1, exp: eq, fn: eq_neg32767_int16}, ++ {idx: 1, exp: ne, fn: ne_neg32767_int16}, ++ {idx: 2, exp: lt, fn: lt_neg129_int16}, ++ {idx: 2, exp: le, fn: le_neg129_int16}, ++ {idx: 2, exp: gt, fn: gt_neg129_int16}, ++ {idx: 2, exp: ge, fn: ge_neg129_int16}, ++ {idx: 2, exp: eq, fn: eq_neg129_int16}, ++ {idx: 2, exp: ne, fn: ne_neg129_int16}, ++ {idx: 3, exp: lt, fn: lt_neg128_int16}, ++ {idx: 3, exp: le, fn: le_neg128_int16}, ++ {idx: 3, exp: gt, fn: gt_neg128_int16}, ++ {idx: 3, exp: ge, fn: ge_neg128_int16}, ++ {idx: 3, exp: eq, fn: eq_neg128_int16}, ++ {idx: 3, exp: ne, fn: ne_neg128_int16}, ++ {idx: 4, exp: lt, fn: lt_neg127_int16}, ++ {idx: 4, exp: le, fn: le_neg127_int16}, ++ {idx: 4, exp: gt, fn: gt_neg127_int16}, ++ {idx: 4, exp: ge, fn: ge_neg127_int16}, ++ {idx: 4, exp: eq, fn: eq_neg127_int16}, ++ {idx: 4, exp: ne, fn: ne_neg127_int16}, ++ {idx: 5, exp: lt, fn: lt_neg1_int16}, ++ {idx: 5, exp: le, fn: le_neg1_int16}, ++ {idx: 5, exp: gt, fn: gt_neg1_int16}, ++ {idx: 5, exp: ge, fn: ge_neg1_int16}, ++ {idx: 5, exp: eq, fn: eq_neg1_int16}, ++ {idx: 5, exp: ne, fn: ne_neg1_int16}, ++ {idx: 6, exp: lt, fn: lt_0_int16}, ++ {idx: 6, exp: le, fn: le_0_int16}, ++ {idx: 6, exp: gt, fn: gt_0_int16}, ++ {idx: 6, exp: ge, fn: ge_0_int16}, ++ {idx: 6, exp: eq, fn: eq_0_int16}, ++ {idx: 6, exp: ne, fn: ne_0_int16}, ++ {idx: 7, exp: lt, fn: lt_1_int16}, ++ {idx: 7, exp: le, fn: le_1_int16}, ++ {idx: 7, exp: gt, fn: gt_1_int16}, ++ {idx: 7, exp: ge, fn: ge_1_int16}, ++ {idx: 7, exp: eq, fn: eq_1_int16}, ++ {idx: 7, exp: ne, fn: ne_1_int16}, ++ {idx: 8, exp: lt, fn: lt_126_int16}, ++ {idx: 8, exp: le, fn: le_126_int16}, ++ {idx: 8, exp: gt, fn: gt_126_int16}, ++ {idx: 8, exp: ge, fn: ge_126_int16}, ++ {idx: 8, exp: eq, fn: eq_126_int16}, ++ {idx: 8, exp: ne, fn: ne_126_int16}, ++ {idx: 9, exp: lt, fn: lt_127_int16}, ++ {idx: 9, exp: le, fn: le_127_int16}, ++ {idx: 9, exp: gt, fn: gt_127_int16}, ++ {idx: 9, exp: ge, fn: ge_127_int16}, ++ {idx: 9, exp: eq, fn: eq_127_int16}, ++ {idx: 9, exp: ne, fn: ne_127_int16}, ++ {idx: 10, exp: lt, fn: lt_128_int16}, ++ {idx: 10, exp: le, fn: le_128_int16}, ++ {idx: 10, exp: gt, fn: gt_128_int16}, ++ {idx: 10, exp: ge, fn: ge_128_int16}, ++ {idx: 10, exp: eq, fn: eq_128_int16}, ++ {idx: 10, exp: ne, fn: ne_128_int16}, ++ {idx: 11, exp: lt, fn: lt_254_int16}, ++ {idx: 11, exp: le, fn: le_254_int16}, ++ {idx: 11, exp: gt, fn: gt_254_int16}, ++ {idx: 11, exp: ge, fn: ge_254_int16}, ++ {idx: 11, exp: eq, fn: eq_254_int16}, ++ {idx: 11, exp: ne, fn: ne_254_int16}, ++ {idx: 12, exp: lt, fn: lt_255_int16}, ++ {idx: 12, exp: le, fn: le_255_int16}, ++ {idx: 12, exp: gt, fn: gt_255_int16}, ++ {idx: 12, exp: ge, fn: ge_255_int16}, ++ {idx: 12, exp: eq, fn: eq_255_int16}, ++ {idx: 12, exp: ne, fn: ne_255_int16}, ++ {idx: 13, exp: lt, fn: lt_256_int16}, ++ {idx: 13, exp: le, fn: le_256_int16}, ++ {idx: 13, exp: gt, fn: gt_256_int16}, ++ {idx: 13, exp: ge, fn: ge_256_int16}, ++ {idx: 13, exp: eq, fn: eq_256_int16}, ++ {idx: 13, exp: ne, fn: ne_256_int16}, ++ {idx: 14, exp: lt, fn: lt_32766_int16}, ++ {idx: 14, exp: le, fn: le_32766_int16}, ++ {idx: 14, exp: gt, fn: gt_32766_int16}, ++ {idx: 14, exp: ge, fn: ge_32766_int16}, ++ {idx: 14, exp: eq, fn: eq_32766_int16}, ++ {idx: 14, exp: ne, fn: ne_32766_int16}, ++ {idx: 15, exp: lt, fn: lt_32767_int16}, ++ {idx: 15, exp: le, fn: le_32767_int16}, ++ {idx: 15, exp: gt, fn: gt_32767_int16}, ++ {idx: 15, exp: ge, fn: ge_32767_int16}, ++ {idx: 15, exp: eq, fn: eq_32767_int16}, ++ {idx: 15, exp: ne, fn: ne_32767_int16}, ++} ++ ++// int8 tests ++var int8_vals = []int8{ ++ -128, ++ -127, ++ -1, ++ 0, ++ 1, ++ 126, ++ 127, ++} ++ ++func lt_neg128_int8(x int8) bool { return x < -128 } ++func le_neg128_int8(x int8) bool { return x <= -128 } ++func gt_neg128_int8(x int8) bool { return x > -128 } ++func ge_neg128_int8(x int8) bool { return x >= -128 } ++func eq_neg128_int8(x int8) bool { return x == -128 } ++func ne_neg128_int8(x int8) bool { return x != -128 } ++func lt_neg127_int8(x int8) bool { return x < -127 } ++func le_neg127_int8(x int8) bool { return x <= -127 } ++func gt_neg127_int8(x int8) bool { return x > -127 } ++func ge_neg127_int8(x int8) bool { return x >= -127 } ++func eq_neg127_int8(x int8) bool { return x == -127 } ++func ne_neg127_int8(x int8) bool { return x != -127 } ++func lt_neg1_int8(x int8) bool { return x < -1 } ++func le_neg1_int8(x int8) bool { return x <= -1 } ++func gt_neg1_int8(x int8) bool { return x > -1 } ++func ge_neg1_int8(x int8) bool { return x >= -1 } ++func eq_neg1_int8(x int8) bool { return x == -1 } ++func ne_neg1_int8(x int8) bool { return x != -1 } ++func lt_0_int8(x int8) bool { return x < 0 } ++func le_0_int8(x int8) bool { return x <= 0 } ++func gt_0_int8(x int8) bool { return x > 0 } ++func ge_0_int8(x int8) bool { return x >= 0 } ++func eq_0_int8(x int8) bool { return x == 0 } ++func ne_0_int8(x int8) bool { return x != 0 } ++func lt_1_int8(x int8) bool { return x < 1 } ++func le_1_int8(x int8) bool { return x <= 1 } ++func gt_1_int8(x int8) bool { return x > 1 } ++func ge_1_int8(x int8) bool { return x >= 1 } ++func eq_1_int8(x int8) bool { return x == 1 } ++func ne_1_int8(x int8) bool { return x != 1 } ++func lt_126_int8(x int8) bool { return x < 126 } ++func le_126_int8(x int8) bool { return x <= 126 } ++func gt_126_int8(x int8) bool { return x > 126 } ++func ge_126_int8(x int8) bool { return x >= 126 } ++func eq_126_int8(x int8) bool { return x == 126 } ++func ne_126_int8(x int8) bool { return x != 126 } ++func lt_127_int8(x int8) bool { return x < 127 } ++func le_127_int8(x int8) bool { return x <= 127 } ++func gt_127_int8(x int8) bool { return x > 127 } ++func ge_127_int8(x int8) bool { return x >= 127 } ++func eq_127_int8(x int8) bool { return x == 127 } ++func ne_127_int8(x int8) bool { return x != 127 } ++ ++var int8_tests = []struct { ++ idx int // index of the constant used ++ exp result // expected results ++ fn func(int8) bool ++}{ ++ {idx: 0, exp: lt, fn: lt_neg128_int8}, ++ {idx: 0, exp: le, fn: le_neg128_int8}, ++ {idx: 0, exp: gt, fn: gt_neg128_int8}, ++ {idx: 0, exp: ge, fn: ge_neg128_int8}, ++ {idx: 0, exp: eq, fn: eq_neg128_int8}, ++ {idx: 0, exp: ne, fn: ne_neg128_int8}, ++ {idx: 1, exp: lt, fn: lt_neg127_int8}, ++ {idx: 1, exp: le, fn: le_neg127_int8}, ++ {idx: 1, exp: gt, fn: gt_neg127_int8}, ++ {idx: 1, exp: ge, fn: ge_neg127_int8}, ++ {idx: 1, exp: eq, fn: eq_neg127_int8}, ++ {idx: 1, exp: ne, fn: ne_neg127_int8}, ++ {idx: 2, exp: lt, fn: lt_neg1_int8}, ++ {idx: 2, exp: le, fn: le_neg1_int8}, ++ {idx: 2, exp: gt, fn: gt_neg1_int8}, ++ {idx: 2, exp: ge, fn: ge_neg1_int8}, ++ {idx: 2, exp: eq, fn: eq_neg1_int8}, ++ {idx: 2, exp: ne, fn: ne_neg1_int8}, ++ {idx: 3, exp: lt, fn: lt_0_int8}, ++ {idx: 3, exp: le, fn: le_0_int8}, ++ {idx: 3, exp: gt, fn: gt_0_int8}, ++ {idx: 3, exp: ge, fn: ge_0_int8}, ++ {idx: 3, exp: eq, fn: eq_0_int8}, ++ {idx: 3, exp: ne, fn: ne_0_int8}, ++ {idx: 4, exp: lt, fn: lt_1_int8}, ++ {idx: 4, exp: le, fn: le_1_int8}, ++ {idx: 4, exp: gt, fn: gt_1_int8}, ++ {idx: 4, exp: ge, fn: ge_1_int8}, ++ {idx: 4, exp: eq, fn: eq_1_int8}, ++ {idx: 4, exp: ne, fn: ne_1_int8}, ++ {idx: 5, exp: lt, fn: lt_126_int8}, ++ {idx: 5, exp: le, fn: le_126_int8}, ++ {idx: 5, exp: gt, fn: gt_126_int8}, ++ {idx: 5, exp: ge, fn: ge_126_int8}, ++ {idx: 5, exp: eq, fn: eq_126_int8}, ++ {idx: 5, exp: ne, fn: ne_126_int8}, ++ {idx: 6, exp: lt, fn: lt_127_int8}, ++ {idx: 6, exp: le, fn: le_127_int8}, ++ {idx: 6, exp: gt, fn: gt_127_int8}, ++ {idx: 6, exp: ge, fn: ge_127_int8}, ++ {idx: 6, exp: eq, fn: eq_127_int8}, ++ {idx: 6, exp: ne, fn: ne_127_int8}, ++} ++ ++func main() { ++ for i, test := range uint64_tests { ++ for j, x := range uint64_vals { ++ want := test.exp.l ++ if j == test.idx { ++ want = test.exp.e ++ } else if j > test.idx { ++ want = test.exp.r ++ } ++ if test.fn(x) != want { ++ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() ++ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=uint64 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) ++ panic(msg) ++ } ++ } ++ } ++ for i, test := range uint32_tests { ++ for j, x := range uint32_vals { ++ want := test.exp.l ++ if j == test.idx { ++ want = test.exp.e ++ } else if j > test.idx { ++ want = test.exp.r ++ } ++ if test.fn(x) != want { ++ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() ++ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=uint32 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) ++ panic(msg) ++ } ++ } ++ } ++ for i, test := range uint16_tests { ++ for j, x := range uint16_vals { ++ want := test.exp.l ++ if j == test.idx { ++ want = test.exp.e ++ } else if j > test.idx { ++ want = test.exp.r ++ } ++ if test.fn(x) != want { ++ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() ++ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=uint16 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) ++ panic(msg) ++ } ++ } ++ } ++ for i, test := range uint8_tests { ++ for j, x := range uint8_vals { ++ want := test.exp.l ++ if j == test.idx { ++ want = test.exp.e ++ } else if j > test.idx { ++ want = test.exp.r ++ } ++ if test.fn(x) != want { ++ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() ++ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=uint8 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) ++ panic(msg) ++ } ++ } ++ } ++ for i, test := range int64_tests { ++ for j, x := range int64_vals { ++ want := test.exp.l ++ if j == test.idx { ++ want = test.exp.e ++ } else if j > test.idx { ++ want = test.exp.r ++ } ++ if test.fn(x) != want { ++ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() ++ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=int64 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) ++ panic(msg) ++ } ++ } ++ } ++ for i, test := range int32_tests { ++ for j, x := range int32_vals { ++ want := test.exp.l ++ if j == test.idx { ++ want = test.exp.e ++ } else if j > test.idx { ++ want = test.exp.r ++ } ++ if test.fn(x) != want { ++ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() ++ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=int32 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) ++ panic(msg) ++ } ++ } ++ } ++ for i, test := range int16_tests { ++ for j, x := range int16_vals { ++ want := test.exp.l ++ if j == test.idx { ++ want = test.exp.e ++ } else if j > test.idx { ++ want = test.exp.r ++ } ++ if test.fn(x) != want { ++ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() ++ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=int16 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) ++ panic(msg) ++ } ++ } ++ } ++ for i, test := range int8_tests { ++ for j, x := range int8_vals { ++ want := test.exp.l ++ if j == test.idx { ++ want = test.exp.e ++ } else if j > test.idx { ++ want = test.exp.r ++ } ++ if test.fn(x) != want { ++ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() ++ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=int8 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) ++ panic(msg) ++ } ++ } ++ } ++} +diff --git a/src/cmd/compile/internal/gc/testdata/gen/cmpConstGen.go b/src/cmd/compile/internal/gc/testdata/gen/cmpConstGen.go +new file mode 100644 +index 0000000..defa4a9 +--- /dev/null ++++ b/src/cmd/compile/internal/gc/testdata/gen/cmpConstGen.go +@@ -0,0 +1,248 @@ ++// Copyright 2017 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. ++ ++// This program generates a test to verify that the standard comparison ++// operators properly handle one const operand. The test file should be ++// generated with a known working version of go. ++// launch with `go run cmpConstGen.go` a file called cmpConst.go ++// will be written into the parent directory containing the tests ++ ++package main ++ ++import ( ++ "bytes" ++ "fmt" ++ "go/format" ++ "io/ioutil" ++ "log" ++ "math/big" ++ "sort" ++) ++ ++const ( ++ maxU64 = (1 << 64) - 1 ++ maxU32 = (1 << 32) - 1 ++ maxU16 = (1 << 16) - 1 ++ maxU8 = (1 << 8) - 1 ++ ++ maxI64 = (1 << 63) - 1 ++ maxI32 = (1 << 31) - 1 ++ maxI16 = (1 << 15) - 1 ++ maxI8 = (1 << 7) - 1 ++ ++ minI64 = -(1 << 63) ++ minI32 = -(1 << 31) ++ minI16 = -(1 << 15) ++ minI8 = -(1 << 7) ++) ++ ++func cmp(left *big.Int, op string, right *big.Int) bool { ++ switch left.Cmp(right) { ++ case -1: // less than ++ return op == "<" || op == "<=" || op == "!=" ++ case 0: // equal ++ return op == "==" || op == "<=" || op == ">=" ++ case 1: // greater than ++ return op == ">" || op == ">=" || op == "!=" ++ } ++ panic("unexpected comparison value") ++} ++ ++func inRange(typ string, val *big.Int) bool { ++ min, max := &big.Int{}, &big.Int{} ++ switch typ { ++ case "uint64": ++ max = max.SetUint64(maxU64) ++ case "uint32": ++ max = max.SetUint64(maxU32) ++ case "uint16": ++ max = max.SetUint64(maxU16) ++ case "uint8": ++ max = max.SetUint64(maxU8) ++ case "int64": ++ min = min.SetInt64(minI64) ++ max = max.SetInt64(maxI64) ++ case "int32": ++ min = min.SetInt64(minI32) ++ max = max.SetInt64(maxI32) ++ case "int16": ++ min = min.SetInt64(minI16) ++ max = max.SetInt64(maxI16) ++ case "int8": ++ min = min.SetInt64(minI8) ++ max = max.SetInt64(maxI8) ++ default: ++ panic("unexpected type") ++ } ++ return cmp(min, "<=", val) && cmp(val, "<=", max) ++} ++ ++func getValues(typ string) []*big.Int { ++ Uint := func(v uint64) *big.Int { return big.NewInt(0).SetUint64(v) } ++ Int := func(v int64) *big.Int { return big.NewInt(0).SetInt64(v) } ++ values := []*big.Int{ ++ // limits ++ Uint(maxU64), ++ Uint(maxU64 - 1), ++ Uint(maxI64 + 1), ++ Uint(maxI64), ++ Uint(maxI64 - 1), ++ Uint(maxU32 + 1), ++ Uint(maxU32), ++ Uint(maxU32 - 1), ++ Uint(maxI32 + 1), ++ Uint(maxI32), ++ Uint(maxI32 - 1), ++ Uint(maxU16 + 1), ++ Uint(maxU16), ++ Uint(maxU16 - 1), ++ Uint(maxI16 + 1), ++ Uint(maxI16), ++ Uint(maxI16 - 1), ++ Uint(maxU8 + 1), ++ Uint(maxU8), ++ Uint(maxU8 - 1), ++ Uint(maxI8 + 1), ++ Uint(maxI8), ++ Uint(maxI8 - 1), ++ Uint(0), ++ Int(minI8 + 1), ++ Int(minI8), ++ Int(minI8 - 1), ++ Int(minI16 + 1), ++ Int(minI16), ++ Int(minI16 - 1), ++ Int(minI32 + 1), ++ Int(minI32), ++ Int(minI32 - 1), ++ Int(minI64 + 1), ++ Int(minI64), ++ ++ // other possibly interesting values ++ Uint(1), ++ Int(-1), ++ Uint(0xff << 56), ++ Uint(0xff << 32), ++ Uint(0xff << 24), ++ } ++ sort.Slice(values, func(i, j int) bool { return values[i].Cmp(values[j]) == -1 }) ++ var ret []*big.Int ++ for _, val := range values { ++ if !inRange(typ, val) { ++ continue ++ } ++ ret = append(ret, val) ++ } ++ return ret ++} ++ ++func sigString(v *big.Int) string { ++ var t big.Int ++ t.Abs(v) ++ if v.Sign() == -1 { ++ return "neg" + t.String() ++ } ++ return t.String() ++} ++ ++func main() { ++ types := []string{ ++ "uint64", "uint32", "uint16", "uint8", ++ "int64", "int32", "int16", "int8", ++ } ++ ++ w := new(bytes.Buffer) ++ fmt.Fprintf(w, "// run\n") ++ fmt.Fprintf(w, "// Code generated by gen/cmpConstGen.go. DO NOT EDIT.\n\n") ++ fmt.Fprintf(w, "package main;\n") ++ fmt.Fprintf(w, "import (\"fmt\"; \"reflect\"; \"runtime\";)\n") ++ fmt.Fprintf(w, "// results show the expected result for the elements left of, equal to and right of the index.\n") ++ fmt.Fprintf(w, "type result struct{l, e, r bool}\n") ++ fmt.Fprintf(w, "var (\n") ++ fmt.Fprintf(w, " eq = result{l: false, e: true, r: false}\n") ++ fmt.Fprintf(w, " ne = result{l: true, e: false, r: true}\n") ++ fmt.Fprintf(w, " lt = result{l: true, e: false, r: false}\n") ++ fmt.Fprintf(w, " le = result{l: true, e: true, r: false}\n") ++ fmt.Fprintf(w, " gt = result{l: false, e: false, r: true}\n") ++ fmt.Fprintf(w, " ge = result{l: false, e: true, r: true}\n") ++ fmt.Fprintf(w, ")\n") ++ ++ operators := []struct{ op, name string }{ ++ {"<", "lt"}, ++ {"<=", "le"}, ++ {">", "gt"}, ++ {">=", "ge"}, ++ {"==", "eq"}, ++ {"!=", "ne"}, ++ } ++ ++ for _, typ := range types { ++ // generate a slice containing valid values for this type ++ fmt.Fprintf(w, "\n// %v tests\n", typ) ++ values := getValues(typ) ++ fmt.Fprintf(w, "var %v_vals = []%v{\n", typ, typ) ++ for _, val := range values { ++ fmt.Fprintf(w, "%v,\n", val.String()) ++ } ++ fmt.Fprintf(w, "}\n") ++ ++ // generate test functions ++ for _, r := range values { ++ // TODO: could also test constant on lhs. ++ sig := sigString(r) ++ for _, op := range operators { ++ // no need for go:noinline because the function is called indirectly ++ fmt.Fprintf(w, "func %v_%v_%v(x %v) bool { return x %v %v; }\n", op.name, sig, typ, typ, op.op, r.String()) ++ } ++ } ++ ++ // generate a table of test cases ++ fmt.Fprintf(w, "var %v_tests = []struct{\n", typ) ++ fmt.Fprintf(w, " idx int // index of the constant used\n") ++ fmt.Fprintf(w, " exp result // expected results\n") ++ fmt.Fprintf(w, " fn func(%v) bool\n", typ) ++ fmt.Fprintf(w, "}{\n") ++ for i, r := range values { ++ sig := sigString(r) ++ for _, op := range operators { ++ fmt.Fprintf(w, "{idx: %v,", i) ++ fmt.Fprintf(w, "exp: %v,", op.name) ++ fmt.Fprintf(w, "fn: %v_%v_%v},\n", op.name, sig, typ) ++ } ++ } ++ fmt.Fprintf(w, "}\n") ++ } ++ ++ // emit the main function, looping over all test cases ++ fmt.Fprintf(w, "func main() {\n") ++ for _, typ := range types { ++ fmt.Fprintf(w, "for i, test := range %v_tests {\n", typ) ++ fmt.Fprintf(w, " for j, x := range %v_vals {\n", typ) ++ fmt.Fprintf(w, " want := test.exp.l\n") ++ fmt.Fprintf(w, " if j == test.idx {\nwant = test.exp.e\n}") ++ fmt.Fprintf(w, " else if j > test.idx {\nwant = test.exp.r\n}\n") ++ fmt.Fprintf(w, " if test.fn(x) != want {\n") ++ fmt.Fprintf(w, " fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name()\n") ++ fmt.Fprintf(w, " msg := fmt.Sprintf(\"test failed: %%v(%%v) != %%v [type=%v i=%%v j=%%v idx=%%v]\", fn, x, want, i, j, test.idx)\n", typ) ++ fmt.Fprintf(w, " panic(msg)\n") ++ fmt.Fprintf(w, " }\n") ++ fmt.Fprintf(w, " }\n") ++ fmt.Fprintf(w, "}\n") ++ } ++ fmt.Fprintf(w, "}\n") ++ ++ // gofmt result ++ b := w.Bytes() ++ src, err := format.Source(b) ++ if err != nil { ++ fmt.Printf("%s\n", b) ++ panic(err) ++ } ++ ++ // write to file ++ err = ioutil.WriteFile("../cmpConst.go", src, 0666) ++ if err != nil { ++ log.Fatalf("can't write output: %v\n", err) ++ } ++} +diff --git a/src/cmd/compile/internal/ssa/gen/S390X.rules b/src/cmd/compile/internal/ssa/gen/S390X.rules +index 7ecea02..caea050 100644 +--- a/src/cmd/compile/internal/ssa/gen/S390X.rules ++++ b/src/cmd/compile/internal/ssa/gen/S390X.rules +@@ -537,8 +537,8 @@ + (CMP (MOVDconst [c]) x) && is32Bit(c) -> (InvertFlags (CMPconst x [c])) + (CMPW x (MOVDconst [c])) -> (CMPWconst x [c]) + (CMPW (MOVDconst [c]) x) -> (InvertFlags (CMPWconst x [c])) +-(CMPU x (MOVDconst [c])) && is32Bit(c) -> (CMPUconst x [int64(uint32(c))]) +-(CMPU (MOVDconst [c]) x) && is32Bit(c) -> (InvertFlags (CMPUconst x [int64(uint32(c))])) ++(CMPU x (MOVDconst [c])) && isU32Bit(c) -> (CMPUconst x [int64(uint32(c))]) ++(CMPU (MOVDconst [c]) x) && isU32Bit(c) -> (InvertFlags (CMPUconst x [int64(uint32(c))])) + (CMPWU x (MOVDconst [c])) -> (CMPWUconst x [int64(uint32(c))]) + (CMPWU (MOVDconst [c]) x) -> (InvertFlags (CMPWUconst x [int64(uint32(c))])) + +diff --git a/src/cmd/compile/internal/ssa/rewriteS390X.go b/src/cmd/compile/internal/ssa/rewriteS390X.go +index 866cf50..af8fd1d 100644 +--- a/src/cmd/compile/internal/ssa/rewriteS390X.go ++++ b/src/cmd/compile/internal/ssa/rewriteS390X.go +@@ -6784,7 +6784,7 @@ func rewriteValueS390X_OpS390XCMPU(v *Value, config *Config) bool { + b := v.Block + _ = b + // match: (CMPU x (MOVDconst [c])) +- // cond: is32Bit(c) ++ // cond: isU32Bit(c) + // result: (CMPUconst x [int64(uint32(c))]) + for { + x := v.Args[0] +@@ -6793,7 +6793,7 @@ func rewriteValueS390X_OpS390XCMPU(v *Value, config *Config) bool { + break + } + c := v_1.AuxInt +- if !(is32Bit(c)) { ++ if !(isU32Bit(c)) { + break + } + v.reset(OpS390XCMPUconst) +@@ -6802,7 +6802,7 @@ func rewriteValueS390X_OpS390XCMPU(v *Value, config *Config) bool { + return true + } + // match: (CMPU (MOVDconst [c]) x) +- // cond: is32Bit(c) ++ // cond: isU32Bit(c) + // result: (InvertFlags (CMPUconst x [int64(uint32(c))])) + for { + v_0 := v.Args[0] +@@ -6811,7 +6811,7 @@ func rewriteValueS390X_OpS390XCMPU(v *Value, config *Config) bool { + } + c := v_0.AuxInt + x := v.Args[1] +- if !(is32Bit(c)) { ++ if !(isU32Bit(c)) { + break + } + v.reset(OpS390XInvertFlags) From 45041c89feaa2cd8d29311a264fb4cbe6540dcc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 26 May 2017 14:45:09 +0200 Subject: [PATCH 112/156] bump to 1.8.3 fix for CVE-2017-8932 make possible to use 31bit OID in ASN1 Resolves: BZ#1454978, BZ#14551 --- .gitignore | 1 + 31bit-OID-asn1.patch | 83 ++ golang.spec | 15 +- s390x-uint-codegen.patch | 2579 -------------------------------------- sources | 2 +- 5 files changed, 96 insertions(+), 2584 deletions(-) create mode 100644 31bit-OID-asn1.patch delete mode 100644 s390x-uint-codegen.patch diff --git a/.gitignore b/.gitignore index 349cda1..992c313 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ /go1.8rc3.src.tar.gz /go1.8.src.tar.gz /go1.8.1.src.tar.gz +/go1.8.3.src.tar.gz diff --git a/31bit-OID-asn1.patch b/31bit-OID-asn1.patch new file mode 100644 index 0000000..4d01b3d --- /dev/null +++ b/31bit-OID-asn1.patch @@ -0,0 +1,83 @@ +From 94aba76639cf4d5e30975d846bb0368db8202269 Mon Sep 17 00:00:00 2001 +From: Monis Khan +Date: Wed, 12 Apr 2017 16:00:58 -0400 +Subject: [PATCH] encoding/asn1: support 31 bit identifiers with OID + +The current implementation uses a max of 28 bits when decoding an +ObjectIdentifier. This change makes it so that an int64 is used to +accumulate up to 35 bits. If the resulting data would not overflow +an int32, it is used as an int. Thus up to 31 bits may be used to +represent each subidentifier of an ObjectIdentifier. + +Fixes #19933 + +Change-Id: I95d74b64b24cdb1339ff13421055bce61c80243c +Reviewed-on: https://go-review.googlesource.com/40436 +Reviewed-by: Adam Langley +Run-TryBot: Adam Langley +--- + src/encoding/asn1/asn1.go | 15 ++++++++++++--- + src/encoding/asn1/asn1_test.go | 3 +++ + 2 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/src/encoding/asn1/asn1.go b/src/encoding/asn1/asn1.go +index c2c0ee420ac..65f018d0148 100644 +--- a/src/encoding/asn1/asn1.go ++++ b/src/encoding/asn1/asn1.go +@@ -22,6 +22,7 @@ package asn1 + import ( + "errors" + "fmt" ++ "math" + "math/big" + "reflect" + "strconv" +@@ -293,16 +294,24 @@ type Flag bool + // given byte slice. It returns the value and the new offset. + func parseBase128Int(bytes []byte, initOffset int) (ret, offset int, err error) { + offset = initOffset ++ var ret64 int64 + for shifted := 0; offset < len(bytes); shifted++ { +- if shifted == 4 { ++ // 5 * 7 bits per byte == 35 bits of data ++ // Thus the representation is either non-minimal or too large for an int32 ++ if shifted == 5 { + err = StructuralError{"base 128 integer too large"} + return + } +- ret <<= 7 ++ ret64 <<= 7 + b := bytes[offset] +- ret |= int(b & 0x7f) ++ ret64 |= int64(b & 0x7f) + offset++ + if b&0x80 == 0 { ++ ret = int(ret64) ++ // Ensure that the returned value fits in an int on all platforms ++ if ret64 > math.MaxInt32 { ++ err = StructuralError{"base 128 integer too large"} ++ } + return + } + } +diff --git a/src/encoding/asn1/asn1_test.go b/src/encoding/asn1/asn1_test.go +index 9976656df89..2dd799f2362 100644 +--- a/src/encoding/asn1/asn1_test.go ++++ b/src/encoding/asn1/asn1_test.go +@@ -7,6 +7,7 @@ package asn1 + import ( + "bytes" + "fmt" ++ "math" + "math/big" + "reflect" + "strings" +@@ -386,6 +387,8 @@ var tagAndLengthData = []tagAndLengthTest{ + {[]byte{0xa0, 0x81, 0x7f}, false, tagAndLength{}}, + // Tag numbers which would overflow int32 are rejected. (The value below is 2^31.) + {[]byte{0x1f, 0x88, 0x80, 0x80, 0x80, 0x00, 0x00}, false, tagAndLength{}}, ++ // Tag numbers that fit in an int32 are valid. (The value below is 2^31 - 1.) ++ {[]byte{0x1f, 0x87, 0xFF, 0xFF, 0xFF, 0x7F, 0x00}, true, tagAndLength{tag: math.MaxInt32}}, + // Long tag number form may not be used for tags that fit in short form. + {[]byte{0x1f, 0x1e, 0x00}, false, tagAndLength{}}, + } diff --git a/golang.spec b/golang.spec index 4f21026..e1b8d21 100644 --- a/golang.spec +++ b/golang.spec @@ -94,11 +94,11 @@ %endif %global go_api 1.8 -%global go_version 1.8.1 +%global go_version 1.8.3 Name: golang -Version: 1.8.1 -Release: 2%{?dist} +Version: 1.8.3 +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -137,7 +137,8 @@ Patch215: ./go1.5-zoneinfo_testing_only.patch # Proposed patch by mmunday https://golang.org/cl/35262 Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch -Patch220: s390x-uint-codegen.patch +# https://github.com/golang/go/commit/94aba76639cf4d5e30975d846bb0368db8202269 +Patch220: 31bit-OID-asn1.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -508,6 +509,12 @@ fi %endif %changelog +* Thu May 25 2017 Jakub Čajka - 1.8.3-1 +- bump to 1.8.3 +- fix for CVE-2017-8932 +- make possible to use 31bit OID in ASN1 +- Resolves: BZ#1454978, BZ#1455191 + * Fri Apr 21 2017 Jakub Čajka - 1.8.1-2 - fix uint64 constant codegen on s390x - Resolves: BZ#1441078 diff --git a/s390x-uint-codegen.patch b/s390x-uint-codegen.patch deleted file mode 100644 index 5a1cbbb..0000000 --- a/s390x-uint-codegen.patch +++ /dev/null @@ -1,2579 +0,0 @@ -From 708966abce5d301411c18f01187ff56fd951b17a Mon Sep 17 00:00:00 2001 -From: Michael Munday -Date: Mon, 17 Apr 2017 12:29:32 -0400 -Subject: [PATCH] [release-branch.go1.8] cmd/compile: fix s390x unsigned - comparison constant merging rules - -On s390x unsigned integer comparisons with immediates require the immediate -to be an unsigned 32-bit integer. The rule was checking that the immediate -was a signed 32-bit integer. - -This CL also adds a test for comparisons that could be turned into compare -with immediate or equivalent instructions (depending on architecture and -optimizations applied). - -Cherry-pick of CL 40433 and CL 40873. - -Fixes #19940. - -Change-Id: I1331558a0ee0c4ac33bf8ea488f3ea190d06f110 -Reviewed-on: https://go-review.googlesource.com/40931 -Reviewed-by: Brad Fitzpatrick -Run-TryBot: Brad Fitzpatrick -TryBot-Result: Gobot Gobot ---- - src/cmd/compile/internal/gc/ssa_test.go | 3 + - src/cmd/compile/internal/gc/testdata/cmpConst.go | 2217 ++++++++++++++++++++ - .../internal/gc/testdata/gen/cmpConstGen.go | 248 +++ - src/cmd/compile/internal/ssa/gen/S390X.rules | 4 +- - src/cmd/compile/internal/ssa/rewriteS390X.go | 8 +- - 5 files changed, 2474 insertions(+), 6 deletions(-) - create mode 100644 src/cmd/compile/internal/gc/testdata/cmpConst.go - create mode 100644 src/cmd/compile/internal/gc/testdata/gen/cmpConstGen.go - -diff --git a/src/cmd/compile/internal/gc/ssa_test.go b/src/cmd/compile/internal/gc/ssa_test.go -index 1aebd90..bb315b9 100644 ---- a/src/cmd/compile/internal/gc/ssa_test.go -+++ b/src/cmd/compile/internal/gc/ssa_test.go -@@ -63,6 +63,9 @@ func TestArithmeticConst(t *testing.T) { runTest(t, "arithConst.go") } - - func TestChan(t *testing.T) { runTest(t, "chan.go") } - -+// TestComparisonsConst tests results for comparison operations against constants. -+func TestComparisonsConst(t *testing.T) { runTest(t, "cmpConst.go") } -+ - func TestCompound(t *testing.T) { runTest(t, "compound.go") } - - func TestCtl(t *testing.T) { runTest(t, "ctl.go") } -diff --git a/src/cmd/compile/internal/gc/testdata/cmpConst.go b/src/cmd/compile/internal/gc/testdata/cmpConst.go -new file mode 100644 -index 0000000..f7067be ---- /dev/null -+++ b/src/cmd/compile/internal/gc/testdata/cmpConst.go -@@ -0,0 +1,2217 @@ -+// run -+// Code generated by gen/cmpConstGen.go. DO NOT EDIT. -+ -+package main -+ -+import ( -+ "fmt" -+ "reflect" -+ "runtime" -+) -+ -+// results show the expected result for the elements left of, equal to and right of the index. -+type result struct{ l, e, r bool } -+ -+var ( -+ eq = result{l: false, e: true, r: false} -+ ne = result{l: true, e: false, r: true} -+ lt = result{l: true, e: false, r: false} -+ le = result{l: true, e: true, r: false} -+ gt = result{l: false, e: false, r: true} -+ ge = result{l: false, e: true, r: true} -+) -+ -+// uint64 tests -+var uint64_vals = []uint64{ -+ 0, -+ 1, -+ 126, -+ 127, -+ 128, -+ 254, -+ 255, -+ 256, -+ 32766, -+ 32767, -+ 32768, -+ 65534, -+ 65535, -+ 65536, -+ 2147483646, -+ 2147483647, -+ 2147483648, -+ 4278190080, -+ 4294967294, -+ 4294967295, -+ 4294967296, -+ 1095216660480, -+ 9223372036854775806, -+ 9223372036854775807, -+ 9223372036854775808, -+ 18374686479671623680, -+ 18446744073709551614, -+ 18446744073709551615, -+} -+ -+func lt_0_uint64(x uint64) bool { return x < 0 } -+func le_0_uint64(x uint64) bool { return x <= 0 } -+func gt_0_uint64(x uint64) bool { return x > 0 } -+func ge_0_uint64(x uint64) bool { return x >= 0 } -+func eq_0_uint64(x uint64) bool { return x == 0 } -+func ne_0_uint64(x uint64) bool { return x != 0 } -+func lt_1_uint64(x uint64) bool { return x < 1 } -+func le_1_uint64(x uint64) bool { return x <= 1 } -+func gt_1_uint64(x uint64) bool { return x > 1 } -+func ge_1_uint64(x uint64) bool { return x >= 1 } -+func eq_1_uint64(x uint64) bool { return x == 1 } -+func ne_1_uint64(x uint64) bool { return x != 1 } -+func lt_126_uint64(x uint64) bool { return x < 126 } -+func le_126_uint64(x uint64) bool { return x <= 126 } -+func gt_126_uint64(x uint64) bool { return x > 126 } -+func ge_126_uint64(x uint64) bool { return x >= 126 } -+func eq_126_uint64(x uint64) bool { return x == 126 } -+func ne_126_uint64(x uint64) bool { return x != 126 } -+func lt_127_uint64(x uint64) bool { return x < 127 } -+func le_127_uint64(x uint64) bool { return x <= 127 } -+func gt_127_uint64(x uint64) bool { return x > 127 } -+func ge_127_uint64(x uint64) bool { return x >= 127 } -+func eq_127_uint64(x uint64) bool { return x == 127 } -+func ne_127_uint64(x uint64) bool { return x != 127 } -+func lt_128_uint64(x uint64) bool { return x < 128 } -+func le_128_uint64(x uint64) bool { return x <= 128 } -+func gt_128_uint64(x uint64) bool { return x > 128 } -+func ge_128_uint64(x uint64) bool { return x >= 128 } -+func eq_128_uint64(x uint64) bool { return x == 128 } -+func ne_128_uint64(x uint64) bool { return x != 128 } -+func lt_254_uint64(x uint64) bool { return x < 254 } -+func le_254_uint64(x uint64) bool { return x <= 254 } -+func gt_254_uint64(x uint64) bool { return x > 254 } -+func ge_254_uint64(x uint64) bool { return x >= 254 } -+func eq_254_uint64(x uint64) bool { return x == 254 } -+func ne_254_uint64(x uint64) bool { return x != 254 } -+func lt_255_uint64(x uint64) bool { return x < 255 } -+func le_255_uint64(x uint64) bool { return x <= 255 } -+func gt_255_uint64(x uint64) bool { return x > 255 } -+func ge_255_uint64(x uint64) bool { return x >= 255 } -+func eq_255_uint64(x uint64) bool { return x == 255 } -+func ne_255_uint64(x uint64) bool { return x != 255 } -+func lt_256_uint64(x uint64) bool { return x < 256 } -+func le_256_uint64(x uint64) bool { return x <= 256 } -+func gt_256_uint64(x uint64) bool { return x > 256 } -+func ge_256_uint64(x uint64) bool { return x >= 256 } -+func eq_256_uint64(x uint64) bool { return x == 256 } -+func ne_256_uint64(x uint64) bool { return x != 256 } -+func lt_32766_uint64(x uint64) bool { return x < 32766 } -+func le_32766_uint64(x uint64) bool { return x <= 32766 } -+func gt_32766_uint64(x uint64) bool { return x > 32766 } -+func ge_32766_uint64(x uint64) bool { return x >= 32766 } -+func eq_32766_uint64(x uint64) bool { return x == 32766 } -+func ne_32766_uint64(x uint64) bool { return x != 32766 } -+func lt_32767_uint64(x uint64) bool { return x < 32767 } -+func le_32767_uint64(x uint64) bool { return x <= 32767 } -+func gt_32767_uint64(x uint64) bool { return x > 32767 } -+func ge_32767_uint64(x uint64) bool { return x >= 32767 } -+func eq_32767_uint64(x uint64) bool { return x == 32767 } -+func ne_32767_uint64(x uint64) bool { return x != 32767 } -+func lt_32768_uint64(x uint64) bool { return x < 32768 } -+func le_32768_uint64(x uint64) bool { return x <= 32768 } -+func gt_32768_uint64(x uint64) bool { return x > 32768 } -+func ge_32768_uint64(x uint64) bool { return x >= 32768 } -+func eq_32768_uint64(x uint64) bool { return x == 32768 } -+func ne_32768_uint64(x uint64) bool { return x != 32768 } -+func lt_65534_uint64(x uint64) bool { return x < 65534 } -+func le_65534_uint64(x uint64) bool { return x <= 65534 } -+func gt_65534_uint64(x uint64) bool { return x > 65534 } -+func ge_65534_uint64(x uint64) bool { return x >= 65534 } -+func eq_65534_uint64(x uint64) bool { return x == 65534 } -+func ne_65534_uint64(x uint64) bool { return x != 65534 } -+func lt_65535_uint64(x uint64) bool { return x < 65535 } -+func le_65535_uint64(x uint64) bool { return x <= 65535 } -+func gt_65535_uint64(x uint64) bool { return x > 65535 } -+func ge_65535_uint64(x uint64) bool { return x >= 65535 } -+func eq_65535_uint64(x uint64) bool { return x == 65535 } -+func ne_65535_uint64(x uint64) bool { return x != 65535 } -+func lt_65536_uint64(x uint64) bool { return x < 65536 } -+func le_65536_uint64(x uint64) bool { return x <= 65536 } -+func gt_65536_uint64(x uint64) bool { return x > 65536 } -+func ge_65536_uint64(x uint64) bool { return x >= 65536 } -+func eq_65536_uint64(x uint64) bool { return x == 65536 } -+func ne_65536_uint64(x uint64) bool { return x != 65536 } -+func lt_2147483646_uint64(x uint64) bool { return x < 2147483646 } -+func le_2147483646_uint64(x uint64) bool { return x <= 2147483646 } -+func gt_2147483646_uint64(x uint64) bool { return x > 2147483646 } -+func ge_2147483646_uint64(x uint64) bool { return x >= 2147483646 } -+func eq_2147483646_uint64(x uint64) bool { return x == 2147483646 } -+func ne_2147483646_uint64(x uint64) bool { return x != 2147483646 } -+func lt_2147483647_uint64(x uint64) bool { return x < 2147483647 } -+func le_2147483647_uint64(x uint64) bool { return x <= 2147483647 } -+func gt_2147483647_uint64(x uint64) bool { return x > 2147483647 } -+func ge_2147483647_uint64(x uint64) bool { return x >= 2147483647 } -+func eq_2147483647_uint64(x uint64) bool { return x == 2147483647 } -+func ne_2147483647_uint64(x uint64) bool { return x != 2147483647 } -+func lt_2147483648_uint64(x uint64) bool { return x < 2147483648 } -+func le_2147483648_uint64(x uint64) bool { return x <= 2147483648 } -+func gt_2147483648_uint64(x uint64) bool { return x > 2147483648 } -+func ge_2147483648_uint64(x uint64) bool { return x >= 2147483648 } -+func eq_2147483648_uint64(x uint64) bool { return x == 2147483648 } -+func ne_2147483648_uint64(x uint64) bool { return x != 2147483648 } -+func lt_4278190080_uint64(x uint64) bool { return x < 4278190080 } -+func le_4278190080_uint64(x uint64) bool { return x <= 4278190080 } -+func gt_4278190080_uint64(x uint64) bool { return x > 4278190080 } -+func ge_4278190080_uint64(x uint64) bool { return x >= 4278190080 } -+func eq_4278190080_uint64(x uint64) bool { return x == 4278190080 } -+func ne_4278190080_uint64(x uint64) bool { return x != 4278190080 } -+func lt_4294967294_uint64(x uint64) bool { return x < 4294967294 } -+func le_4294967294_uint64(x uint64) bool { return x <= 4294967294 } -+func gt_4294967294_uint64(x uint64) bool { return x > 4294967294 } -+func ge_4294967294_uint64(x uint64) bool { return x >= 4294967294 } -+func eq_4294967294_uint64(x uint64) bool { return x == 4294967294 } -+func ne_4294967294_uint64(x uint64) bool { return x != 4294967294 } -+func lt_4294967295_uint64(x uint64) bool { return x < 4294967295 } -+func le_4294967295_uint64(x uint64) bool { return x <= 4294967295 } -+func gt_4294967295_uint64(x uint64) bool { return x > 4294967295 } -+func ge_4294967295_uint64(x uint64) bool { return x >= 4294967295 } -+func eq_4294967295_uint64(x uint64) bool { return x == 4294967295 } -+func ne_4294967295_uint64(x uint64) bool { return x != 4294967295 } -+func lt_4294967296_uint64(x uint64) bool { return x < 4294967296 } -+func le_4294967296_uint64(x uint64) bool { return x <= 4294967296 } -+func gt_4294967296_uint64(x uint64) bool { return x > 4294967296 } -+func ge_4294967296_uint64(x uint64) bool { return x >= 4294967296 } -+func eq_4294967296_uint64(x uint64) bool { return x == 4294967296 } -+func ne_4294967296_uint64(x uint64) bool { return x != 4294967296 } -+func lt_1095216660480_uint64(x uint64) bool { return x < 1095216660480 } -+func le_1095216660480_uint64(x uint64) bool { return x <= 1095216660480 } -+func gt_1095216660480_uint64(x uint64) bool { return x > 1095216660480 } -+func ge_1095216660480_uint64(x uint64) bool { return x >= 1095216660480 } -+func eq_1095216660480_uint64(x uint64) bool { return x == 1095216660480 } -+func ne_1095216660480_uint64(x uint64) bool { return x != 1095216660480 } -+func lt_9223372036854775806_uint64(x uint64) bool { return x < 9223372036854775806 } -+func le_9223372036854775806_uint64(x uint64) bool { return x <= 9223372036854775806 } -+func gt_9223372036854775806_uint64(x uint64) bool { return x > 9223372036854775806 } -+func ge_9223372036854775806_uint64(x uint64) bool { return x >= 9223372036854775806 } -+func eq_9223372036854775806_uint64(x uint64) bool { return x == 9223372036854775806 } -+func ne_9223372036854775806_uint64(x uint64) bool { return x != 9223372036854775806 } -+func lt_9223372036854775807_uint64(x uint64) bool { return x < 9223372036854775807 } -+func le_9223372036854775807_uint64(x uint64) bool { return x <= 9223372036854775807 } -+func gt_9223372036854775807_uint64(x uint64) bool { return x > 9223372036854775807 } -+func ge_9223372036854775807_uint64(x uint64) bool { return x >= 9223372036854775807 } -+func eq_9223372036854775807_uint64(x uint64) bool { return x == 9223372036854775807 } -+func ne_9223372036854775807_uint64(x uint64) bool { return x != 9223372036854775807 } -+func lt_9223372036854775808_uint64(x uint64) bool { return x < 9223372036854775808 } -+func le_9223372036854775808_uint64(x uint64) bool { return x <= 9223372036854775808 } -+func gt_9223372036854775808_uint64(x uint64) bool { return x > 9223372036854775808 } -+func ge_9223372036854775808_uint64(x uint64) bool { return x >= 9223372036854775808 } -+func eq_9223372036854775808_uint64(x uint64) bool { return x == 9223372036854775808 } -+func ne_9223372036854775808_uint64(x uint64) bool { return x != 9223372036854775808 } -+func lt_18374686479671623680_uint64(x uint64) bool { return x < 18374686479671623680 } -+func le_18374686479671623680_uint64(x uint64) bool { return x <= 18374686479671623680 } -+func gt_18374686479671623680_uint64(x uint64) bool { return x > 18374686479671623680 } -+func ge_18374686479671623680_uint64(x uint64) bool { return x >= 18374686479671623680 } -+func eq_18374686479671623680_uint64(x uint64) bool { return x == 18374686479671623680 } -+func ne_18374686479671623680_uint64(x uint64) bool { return x != 18374686479671623680 } -+func lt_18446744073709551614_uint64(x uint64) bool { return x < 18446744073709551614 } -+func le_18446744073709551614_uint64(x uint64) bool { return x <= 18446744073709551614 } -+func gt_18446744073709551614_uint64(x uint64) bool { return x > 18446744073709551614 } -+func ge_18446744073709551614_uint64(x uint64) bool { return x >= 18446744073709551614 } -+func eq_18446744073709551614_uint64(x uint64) bool { return x == 18446744073709551614 } -+func ne_18446744073709551614_uint64(x uint64) bool { return x != 18446744073709551614 } -+func lt_18446744073709551615_uint64(x uint64) bool { return x < 18446744073709551615 } -+func le_18446744073709551615_uint64(x uint64) bool { return x <= 18446744073709551615 } -+func gt_18446744073709551615_uint64(x uint64) bool { return x > 18446744073709551615 } -+func ge_18446744073709551615_uint64(x uint64) bool { return x >= 18446744073709551615 } -+func eq_18446744073709551615_uint64(x uint64) bool { return x == 18446744073709551615 } -+func ne_18446744073709551615_uint64(x uint64) bool { return x != 18446744073709551615 } -+ -+var uint64_tests = []struct { -+ idx int // index of the constant used -+ exp result // expected results -+ fn func(uint64) bool -+}{ -+ {idx: 0, exp: lt, fn: lt_0_uint64}, -+ {idx: 0, exp: le, fn: le_0_uint64}, -+ {idx: 0, exp: gt, fn: gt_0_uint64}, -+ {idx: 0, exp: ge, fn: ge_0_uint64}, -+ {idx: 0, exp: eq, fn: eq_0_uint64}, -+ {idx: 0, exp: ne, fn: ne_0_uint64}, -+ {idx: 1, exp: lt, fn: lt_1_uint64}, -+ {idx: 1, exp: le, fn: le_1_uint64}, -+ {idx: 1, exp: gt, fn: gt_1_uint64}, -+ {idx: 1, exp: ge, fn: ge_1_uint64}, -+ {idx: 1, exp: eq, fn: eq_1_uint64}, -+ {idx: 1, exp: ne, fn: ne_1_uint64}, -+ {idx: 2, exp: lt, fn: lt_126_uint64}, -+ {idx: 2, exp: le, fn: le_126_uint64}, -+ {idx: 2, exp: gt, fn: gt_126_uint64}, -+ {idx: 2, exp: ge, fn: ge_126_uint64}, -+ {idx: 2, exp: eq, fn: eq_126_uint64}, -+ {idx: 2, exp: ne, fn: ne_126_uint64}, -+ {idx: 3, exp: lt, fn: lt_127_uint64}, -+ {idx: 3, exp: le, fn: le_127_uint64}, -+ {idx: 3, exp: gt, fn: gt_127_uint64}, -+ {idx: 3, exp: ge, fn: ge_127_uint64}, -+ {idx: 3, exp: eq, fn: eq_127_uint64}, -+ {idx: 3, exp: ne, fn: ne_127_uint64}, -+ {idx: 4, exp: lt, fn: lt_128_uint64}, -+ {idx: 4, exp: le, fn: le_128_uint64}, -+ {idx: 4, exp: gt, fn: gt_128_uint64}, -+ {idx: 4, exp: ge, fn: ge_128_uint64}, -+ {idx: 4, exp: eq, fn: eq_128_uint64}, -+ {idx: 4, exp: ne, fn: ne_128_uint64}, -+ {idx: 5, exp: lt, fn: lt_254_uint64}, -+ {idx: 5, exp: le, fn: le_254_uint64}, -+ {idx: 5, exp: gt, fn: gt_254_uint64}, -+ {idx: 5, exp: ge, fn: ge_254_uint64}, -+ {idx: 5, exp: eq, fn: eq_254_uint64}, -+ {idx: 5, exp: ne, fn: ne_254_uint64}, -+ {idx: 6, exp: lt, fn: lt_255_uint64}, -+ {idx: 6, exp: le, fn: le_255_uint64}, -+ {idx: 6, exp: gt, fn: gt_255_uint64}, -+ {idx: 6, exp: ge, fn: ge_255_uint64}, -+ {idx: 6, exp: eq, fn: eq_255_uint64}, -+ {idx: 6, exp: ne, fn: ne_255_uint64}, -+ {idx: 7, exp: lt, fn: lt_256_uint64}, -+ {idx: 7, exp: le, fn: le_256_uint64}, -+ {idx: 7, exp: gt, fn: gt_256_uint64}, -+ {idx: 7, exp: ge, fn: ge_256_uint64}, -+ {idx: 7, exp: eq, fn: eq_256_uint64}, -+ {idx: 7, exp: ne, fn: ne_256_uint64}, -+ {idx: 8, exp: lt, fn: lt_32766_uint64}, -+ {idx: 8, exp: le, fn: le_32766_uint64}, -+ {idx: 8, exp: gt, fn: gt_32766_uint64}, -+ {idx: 8, exp: ge, fn: ge_32766_uint64}, -+ {idx: 8, exp: eq, fn: eq_32766_uint64}, -+ {idx: 8, exp: ne, fn: ne_32766_uint64}, -+ {idx: 9, exp: lt, fn: lt_32767_uint64}, -+ {idx: 9, exp: le, fn: le_32767_uint64}, -+ {idx: 9, exp: gt, fn: gt_32767_uint64}, -+ {idx: 9, exp: ge, fn: ge_32767_uint64}, -+ {idx: 9, exp: eq, fn: eq_32767_uint64}, -+ {idx: 9, exp: ne, fn: ne_32767_uint64}, -+ {idx: 10, exp: lt, fn: lt_32768_uint64}, -+ {idx: 10, exp: le, fn: le_32768_uint64}, -+ {idx: 10, exp: gt, fn: gt_32768_uint64}, -+ {idx: 10, exp: ge, fn: ge_32768_uint64}, -+ {idx: 10, exp: eq, fn: eq_32768_uint64}, -+ {idx: 10, exp: ne, fn: ne_32768_uint64}, -+ {idx: 11, exp: lt, fn: lt_65534_uint64}, -+ {idx: 11, exp: le, fn: le_65534_uint64}, -+ {idx: 11, exp: gt, fn: gt_65534_uint64}, -+ {idx: 11, exp: ge, fn: ge_65534_uint64}, -+ {idx: 11, exp: eq, fn: eq_65534_uint64}, -+ {idx: 11, exp: ne, fn: ne_65534_uint64}, -+ {idx: 12, exp: lt, fn: lt_65535_uint64}, -+ {idx: 12, exp: le, fn: le_65535_uint64}, -+ {idx: 12, exp: gt, fn: gt_65535_uint64}, -+ {idx: 12, exp: ge, fn: ge_65535_uint64}, -+ {idx: 12, exp: eq, fn: eq_65535_uint64}, -+ {idx: 12, exp: ne, fn: ne_65535_uint64}, -+ {idx: 13, exp: lt, fn: lt_65536_uint64}, -+ {idx: 13, exp: le, fn: le_65536_uint64}, -+ {idx: 13, exp: gt, fn: gt_65536_uint64}, -+ {idx: 13, exp: ge, fn: ge_65536_uint64}, -+ {idx: 13, exp: eq, fn: eq_65536_uint64}, -+ {idx: 13, exp: ne, fn: ne_65536_uint64}, -+ {idx: 14, exp: lt, fn: lt_2147483646_uint64}, -+ {idx: 14, exp: le, fn: le_2147483646_uint64}, -+ {idx: 14, exp: gt, fn: gt_2147483646_uint64}, -+ {idx: 14, exp: ge, fn: ge_2147483646_uint64}, -+ {idx: 14, exp: eq, fn: eq_2147483646_uint64}, -+ {idx: 14, exp: ne, fn: ne_2147483646_uint64}, -+ {idx: 15, exp: lt, fn: lt_2147483647_uint64}, -+ {idx: 15, exp: le, fn: le_2147483647_uint64}, -+ {idx: 15, exp: gt, fn: gt_2147483647_uint64}, -+ {idx: 15, exp: ge, fn: ge_2147483647_uint64}, -+ {idx: 15, exp: eq, fn: eq_2147483647_uint64}, -+ {idx: 15, exp: ne, fn: ne_2147483647_uint64}, -+ {idx: 16, exp: lt, fn: lt_2147483648_uint64}, -+ {idx: 16, exp: le, fn: le_2147483648_uint64}, -+ {idx: 16, exp: gt, fn: gt_2147483648_uint64}, -+ {idx: 16, exp: ge, fn: ge_2147483648_uint64}, -+ {idx: 16, exp: eq, fn: eq_2147483648_uint64}, -+ {idx: 16, exp: ne, fn: ne_2147483648_uint64}, -+ {idx: 17, exp: lt, fn: lt_4278190080_uint64}, -+ {idx: 17, exp: le, fn: le_4278190080_uint64}, -+ {idx: 17, exp: gt, fn: gt_4278190080_uint64}, -+ {idx: 17, exp: ge, fn: ge_4278190080_uint64}, -+ {idx: 17, exp: eq, fn: eq_4278190080_uint64}, -+ {idx: 17, exp: ne, fn: ne_4278190080_uint64}, -+ {idx: 18, exp: lt, fn: lt_4294967294_uint64}, -+ {idx: 18, exp: le, fn: le_4294967294_uint64}, -+ {idx: 18, exp: gt, fn: gt_4294967294_uint64}, -+ {idx: 18, exp: ge, fn: ge_4294967294_uint64}, -+ {idx: 18, exp: eq, fn: eq_4294967294_uint64}, -+ {idx: 18, exp: ne, fn: ne_4294967294_uint64}, -+ {idx: 19, exp: lt, fn: lt_4294967295_uint64}, -+ {idx: 19, exp: le, fn: le_4294967295_uint64}, -+ {idx: 19, exp: gt, fn: gt_4294967295_uint64}, -+ {idx: 19, exp: ge, fn: ge_4294967295_uint64}, -+ {idx: 19, exp: eq, fn: eq_4294967295_uint64}, -+ {idx: 19, exp: ne, fn: ne_4294967295_uint64}, -+ {idx: 20, exp: lt, fn: lt_4294967296_uint64}, -+ {idx: 20, exp: le, fn: le_4294967296_uint64}, -+ {idx: 20, exp: gt, fn: gt_4294967296_uint64}, -+ {idx: 20, exp: ge, fn: ge_4294967296_uint64}, -+ {idx: 20, exp: eq, fn: eq_4294967296_uint64}, -+ {idx: 20, exp: ne, fn: ne_4294967296_uint64}, -+ {idx: 21, exp: lt, fn: lt_1095216660480_uint64}, -+ {idx: 21, exp: le, fn: le_1095216660480_uint64}, -+ {idx: 21, exp: gt, fn: gt_1095216660480_uint64}, -+ {idx: 21, exp: ge, fn: ge_1095216660480_uint64}, -+ {idx: 21, exp: eq, fn: eq_1095216660480_uint64}, -+ {idx: 21, exp: ne, fn: ne_1095216660480_uint64}, -+ {idx: 22, exp: lt, fn: lt_9223372036854775806_uint64}, -+ {idx: 22, exp: le, fn: le_9223372036854775806_uint64}, -+ {idx: 22, exp: gt, fn: gt_9223372036854775806_uint64}, -+ {idx: 22, exp: ge, fn: ge_9223372036854775806_uint64}, -+ {idx: 22, exp: eq, fn: eq_9223372036854775806_uint64}, -+ {idx: 22, exp: ne, fn: ne_9223372036854775806_uint64}, -+ {idx: 23, exp: lt, fn: lt_9223372036854775807_uint64}, -+ {idx: 23, exp: le, fn: le_9223372036854775807_uint64}, -+ {idx: 23, exp: gt, fn: gt_9223372036854775807_uint64}, -+ {idx: 23, exp: ge, fn: ge_9223372036854775807_uint64}, -+ {idx: 23, exp: eq, fn: eq_9223372036854775807_uint64}, -+ {idx: 23, exp: ne, fn: ne_9223372036854775807_uint64}, -+ {idx: 24, exp: lt, fn: lt_9223372036854775808_uint64}, -+ {idx: 24, exp: le, fn: le_9223372036854775808_uint64}, -+ {idx: 24, exp: gt, fn: gt_9223372036854775808_uint64}, -+ {idx: 24, exp: ge, fn: ge_9223372036854775808_uint64}, -+ {idx: 24, exp: eq, fn: eq_9223372036854775808_uint64}, -+ {idx: 24, exp: ne, fn: ne_9223372036854775808_uint64}, -+ {idx: 25, exp: lt, fn: lt_18374686479671623680_uint64}, -+ {idx: 25, exp: le, fn: le_18374686479671623680_uint64}, -+ {idx: 25, exp: gt, fn: gt_18374686479671623680_uint64}, -+ {idx: 25, exp: ge, fn: ge_18374686479671623680_uint64}, -+ {idx: 25, exp: eq, fn: eq_18374686479671623680_uint64}, -+ {idx: 25, exp: ne, fn: ne_18374686479671623680_uint64}, -+ {idx: 26, exp: lt, fn: lt_18446744073709551614_uint64}, -+ {idx: 26, exp: le, fn: le_18446744073709551614_uint64}, -+ {idx: 26, exp: gt, fn: gt_18446744073709551614_uint64}, -+ {idx: 26, exp: ge, fn: ge_18446744073709551614_uint64}, -+ {idx: 26, exp: eq, fn: eq_18446744073709551614_uint64}, -+ {idx: 26, exp: ne, fn: ne_18446744073709551614_uint64}, -+ {idx: 27, exp: lt, fn: lt_18446744073709551615_uint64}, -+ {idx: 27, exp: le, fn: le_18446744073709551615_uint64}, -+ {idx: 27, exp: gt, fn: gt_18446744073709551615_uint64}, -+ {idx: 27, exp: ge, fn: ge_18446744073709551615_uint64}, -+ {idx: 27, exp: eq, fn: eq_18446744073709551615_uint64}, -+ {idx: 27, exp: ne, fn: ne_18446744073709551615_uint64}, -+} -+ -+// uint32 tests -+var uint32_vals = []uint32{ -+ 0, -+ 1, -+ 126, -+ 127, -+ 128, -+ 254, -+ 255, -+ 256, -+ 32766, -+ 32767, -+ 32768, -+ 65534, -+ 65535, -+ 65536, -+ 2147483646, -+ 2147483647, -+ 2147483648, -+ 4278190080, -+ 4294967294, -+ 4294967295, -+} -+ -+func lt_0_uint32(x uint32) bool { return x < 0 } -+func le_0_uint32(x uint32) bool { return x <= 0 } -+func gt_0_uint32(x uint32) bool { return x > 0 } -+func ge_0_uint32(x uint32) bool { return x >= 0 } -+func eq_0_uint32(x uint32) bool { return x == 0 } -+func ne_0_uint32(x uint32) bool { return x != 0 } -+func lt_1_uint32(x uint32) bool { return x < 1 } -+func le_1_uint32(x uint32) bool { return x <= 1 } -+func gt_1_uint32(x uint32) bool { return x > 1 } -+func ge_1_uint32(x uint32) bool { return x >= 1 } -+func eq_1_uint32(x uint32) bool { return x == 1 } -+func ne_1_uint32(x uint32) bool { return x != 1 } -+func lt_126_uint32(x uint32) bool { return x < 126 } -+func le_126_uint32(x uint32) bool { return x <= 126 } -+func gt_126_uint32(x uint32) bool { return x > 126 } -+func ge_126_uint32(x uint32) bool { return x >= 126 } -+func eq_126_uint32(x uint32) bool { return x == 126 } -+func ne_126_uint32(x uint32) bool { return x != 126 } -+func lt_127_uint32(x uint32) bool { return x < 127 } -+func le_127_uint32(x uint32) bool { return x <= 127 } -+func gt_127_uint32(x uint32) bool { return x > 127 } -+func ge_127_uint32(x uint32) bool { return x >= 127 } -+func eq_127_uint32(x uint32) bool { return x == 127 } -+func ne_127_uint32(x uint32) bool { return x != 127 } -+func lt_128_uint32(x uint32) bool { return x < 128 } -+func le_128_uint32(x uint32) bool { return x <= 128 } -+func gt_128_uint32(x uint32) bool { return x > 128 } -+func ge_128_uint32(x uint32) bool { return x >= 128 } -+func eq_128_uint32(x uint32) bool { return x == 128 } -+func ne_128_uint32(x uint32) bool { return x != 128 } -+func lt_254_uint32(x uint32) bool { return x < 254 } -+func le_254_uint32(x uint32) bool { return x <= 254 } -+func gt_254_uint32(x uint32) bool { return x > 254 } -+func ge_254_uint32(x uint32) bool { return x >= 254 } -+func eq_254_uint32(x uint32) bool { return x == 254 } -+func ne_254_uint32(x uint32) bool { return x != 254 } -+func lt_255_uint32(x uint32) bool { return x < 255 } -+func le_255_uint32(x uint32) bool { return x <= 255 } -+func gt_255_uint32(x uint32) bool { return x > 255 } -+func ge_255_uint32(x uint32) bool { return x >= 255 } -+func eq_255_uint32(x uint32) bool { return x == 255 } -+func ne_255_uint32(x uint32) bool { return x != 255 } -+func lt_256_uint32(x uint32) bool { return x < 256 } -+func le_256_uint32(x uint32) bool { return x <= 256 } -+func gt_256_uint32(x uint32) bool { return x > 256 } -+func ge_256_uint32(x uint32) bool { return x >= 256 } -+func eq_256_uint32(x uint32) bool { return x == 256 } -+func ne_256_uint32(x uint32) bool { return x != 256 } -+func lt_32766_uint32(x uint32) bool { return x < 32766 } -+func le_32766_uint32(x uint32) bool { return x <= 32766 } -+func gt_32766_uint32(x uint32) bool { return x > 32766 } -+func ge_32766_uint32(x uint32) bool { return x >= 32766 } -+func eq_32766_uint32(x uint32) bool { return x == 32766 } -+func ne_32766_uint32(x uint32) bool { return x != 32766 } -+func lt_32767_uint32(x uint32) bool { return x < 32767 } -+func le_32767_uint32(x uint32) bool { return x <= 32767 } -+func gt_32767_uint32(x uint32) bool { return x > 32767 } -+func ge_32767_uint32(x uint32) bool { return x >= 32767 } -+func eq_32767_uint32(x uint32) bool { return x == 32767 } -+func ne_32767_uint32(x uint32) bool { return x != 32767 } -+func lt_32768_uint32(x uint32) bool { return x < 32768 } -+func le_32768_uint32(x uint32) bool { return x <= 32768 } -+func gt_32768_uint32(x uint32) bool { return x > 32768 } -+func ge_32768_uint32(x uint32) bool { return x >= 32768 } -+func eq_32768_uint32(x uint32) bool { return x == 32768 } -+func ne_32768_uint32(x uint32) bool { return x != 32768 } -+func lt_65534_uint32(x uint32) bool { return x < 65534 } -+func le_65534_uint32(x uint32) bool { return x <= 65534 } -+func gt_65534_uint32(x uint32) bool { return x > 65534 } -+func ge_65534_uint32(x uint32) bool { return x >= 65534 } -+func eq_65534_uint32(x uint32) bool { return x == 65534 } -+func ne_65534_uint32(x uint32) bool { return x != 65534 } -+func lt_65535_uint32(x uint32) bool { return x < 65535 } -+func le_65535_uint32(x uint32) bool { return x <= 65535 } -+func gt_65535_uint32(x uint32) bool { return x > 65535 } -+func ge_65535_uint32(x uint32) bool { return x >= 65535 } -+func eq_65535_uint32(x uint32) bool { return x == 65535 } -+func ne_65535_uint32(x uint32) bool { return x != 65535 } -+func lt_65536_uint32(x uint32) bool { return x < 65536 } -+func le_65536_uint32(x uint32) bool { return x <= 65536 } -+func gt_65536_uint32(x uint32) bool { return x > 65536 } -+func ge_65536_uint32(x uint32) bool { return x >= 65536 } -+func eq_65536_uint32(x uint32) bool { return x == 65536 } -+func ne_65536_uint32(x uint32) bool { return x != 65536 } -+func lt_2147483646_uint32(x uint32) bool { return x < 2147483646 } -+func le_2147483646_uint32(x uint32) bool { return x <= 2147483646 } -+func gt_2147483646_uint32(x uint32) bool { return x > 2147483646 } -+func ge_2147483646_uint32(x uint32) bool { return x >= 2147483646 } -+func eq_2147483646_uint32(x uint32) bool { return x == 2147483646 } -+func ne_2147483646_uint32(x uint32) bool { return x != 2147483646 } -+func lt_2147483647_uint32(x uint32) bool { return x < 2147483647 } -+func le_2147483647_uint32(x uint32) bool { return x <= 2147483647 } -+func gt_2147483647_uint32(x uint32) bool { return x > 2147483647 } -+func ge_2147483647_uint32(x uint32) bool { return x >= 2147483647 } -+func eq_2147483647_uint32(x uint32) bool { return x == 2147483647 } -+func ne_2147483647_uint32(x uint32) bool { return x != 2147483647 } -+func lt_2147483648_uint32(x uint32) bool { return x < 2147483648 } -+func le_2147483648_uint32(x uint32) bool { return x <= 2147483648 } -+func gt_2147483648_uint32(x uint32) bool { return x > 2147483648 } -+func ge_2147483648_uint32(x uint32) bool { return x >= 2147483648 } -+func eq_2147483648_uint32(x uint32) bool { return x == 2147483648 } -+func ne_2147483648_uint32(x uint32) bool { return x != 2147483648 } -+func lt_4278190080_uint32(x uint32) bool { return x < 4278190080 } -+func le_4278190080_uint32(x uint32) bool { return x <= 4278190080 } -+func gt_4278190080_uint32(x uint32) bool { return x > 4278190080 } -+func ge_4278190080_uint32(x uint32) bool { return x >= 4278190080 } -+func eq_4278190080_uint32(x uint32) bool { return x == 4278190080 } -+func ne_4278190080_uint32(x uint32) bool { return x != 4278190080 } -+func lt_4294967294_uint32(x uint32) bool { return x < 4294967294 } -+func le_4294967294_uint32(x uint32) bool { return x <= 4294967294 } -+func gt_4294967294_uint32(x uint32) bool { return x > 4294967294 } -+func ge_4294967294_uint32(x uint32) bool { return x >= 4294967294 } -+func eq_4294967294_uint32(x uint32) bool { return x == 4294967294 } -+func ne_4294967294_uint32(x uint32) bool { return x != 4294967294 } -+func lt_4294967295_uint32(x uint32) bool { return x < 4294967295 } -+func le_4294967295_uint32(x uint32) bool { return x <= 4294967295 } -+func gt_4294967295_uint32(x uint32) bool { return x > 4294967295 } -+func ge_4294967295_uint32(x uint32) bool { return x >= 4294967295 } -+func eq_4294967295_uint32(x uint32) bool { return x == 4294967295 } -+func ne_4294967295_uint32(x uint32) bool { return x != 4294967295 } -+ -+var uint32_tests = []struct { -+ idx int // index of the constant used -+ exp result // expected results -+ fn func(uint32) bool -+}{ -+ {idx: 0, exp: lt, fn: lt_0_uint32}, -+ {idx: 0, exp: le, fn: le_0_uint32}, -+ {idx: 0, exp: gt, fn: gt_0_uint32}, -+ {idx: 0, exp: ge, fn: ge_0_uint32}, -+ {idx: 0, exp: eq, fn: eq_0_uint32}, -+ {idx: 0, exp: ne, fn: ne_0_uint32}, -+ {idx: 1, exp: lt, fn: lt_1_uint32}, -+ {idx: 1, exp: le, fn: le_1_uint32}, -+ {idx: 1, exp: gt, fn: gt_1_uint32}, -+ {idx: 1, exp: ge, fn: ge_1_uint32}, -+ {idx: 1, exp: eq, fn: eq_1_uint32}, -+ {idx: 1, exp: ne, fn: ne_1_uint32}, -+ {idx: 2, exp: lt, fn: lt_126_uint32}, -+ {idx: 2, exp: le, fn: le_126_uint32}, -+ {idx: 2, exp: gt, fn: gt_126_uint32}, -+ {idx: 2, exp: ge, fn: ge_126_uint32}, -+ {idx: 2, exp: eq, fn: eq_126_uint32}, -+ {idx: 2, exp: ne, fn: ne_126_uint32}, -+ {idx: 3, exp: lt, fn: lt_127_uint32}, -+ {idx: 3, exp: le, fn: le_127_uint32}, -+ {idx: 3, exp: gt, fn: gt_127_uint32}, -+ {idx: 3, exp: ge, fn: ge_127_uint32}, -+ {idx: 3, exp: eq, fn: eq_127_uint32}, -+ {idx: 3, exp: ne, fn: ne_127_uint32}, -+ {idx: 4, exp: lt, fn: lt_128_uint32}, -+ {idx: 4, exp: le, fn: le_128_uint32}, -+ {idx: 4, exp: gt, fn: gt_128_uint32}, -+ {idx: 4, exp: ge, fn: ge_128_uint32}, -+ {idx: 4, exp: eq, fn: eq_128_uint32}, -+ {idx: 4, exp: ne, fn: ne_128_uint32}, -+ {idx: 5, exp: lt, fn: lt_254_uint32}, -+ {idx: 5, exp: le, fn: le_254_uint32}, -+ {idx: 5, exp: gt, fn: gt_254_uint32}, -+ {idx: 5, exp: ge, fn: ge_254_uint32}, -+ {idx: 5, exp: eq, fn: eq_254_uint32}, -+ {idx: 5, exp: ne, fn: ne_254_uint32}, -+ {idx: 6, exp: lt, fn: lt_255_uint32}, -+ {idx: 6, exp: le, fn: le_255_uint32}, -+ {idx: 6, exp: gt, fn: gt_255_uint32}, -+ {idx: 6, exp: ge, fn: ge_255_uint32}, -+ {idx: 6, exp: eq, fn: eq_255_uint32}, -+ {idx: 6, exp: ne, fn: ne_255_uint32}, -+ {idx: 7, exp: lt, fn: lt_256_uint32}, -+ {idx: 7, exp: le, fn: le_256_uint32}, -+ {idx: 7, exp: gt, fn: gt_256_uint32}, -+ {idx: 7, exp: ge, fn: ge_256_uint32}, -+ {idx: 7, exp: eq, fn: eq_256_uint32}, -+ {idx: 7, exp: ne, fn: ne_256_uint32}, -+ {idx: 8, exp: lt, fn: lt_32766_uint32}, -+ {idx: 8, exp: le, fn: le_32766_uint32}, -+ {idx: 8, exp: gt, fn: gt_32766_uint32}, -+ {idx: 8, exp: ge, fn: ge_32766_uint32}, -+ {idx: 8, exp: eq, fn: eq_32766_uint32}, -+ {idx: 8, exp: ne, fn: ne_32766_uint32}, -+ {idx: 9, exp: lt, fn: lt_32767_uint32}, -+ {idx: 9, exp: le, fn: le_32767_uint32}, -+ {idx: 9, exp: gt, fn: gt_32767_uint32}, -+ {idx: 9, exp: ge, fn: ge_32767_uint32}, -+ {idx: 9, exp: eq, fn: eq_32767_uint32}, -+ {idx: 9, exp: ne, fn: ne_32767_uint32}, -+ {idx: 10, exp: lt, fn: lt_32768_uint32}, -+ {idx: 10, exp: le, fn: le_32768_uint32}, -+ {idx: 10, exp: gt, fn: gt_32768_uint32}, -+ {idx: 10, exp: ge, fn: ge_32768_uint32}, -+ {idx: 10, exp: eq, fn: eq_32768_uint32}, -+ {idx: 10, exp: ne, fn: ne_32768_uint32}, -+ {idx: 11, exp: lt, fn: lt_65534_uint32}, -+ {idx: 11, exp: le, fn: le_65534_uint32}, -+ {idx: 11, exp: gt, fn: gt_65534_uint32}, -+ {idx: 11, exp: ge, fn: ge_65534_uint32}, -+ {idx: 11, exp: eq, fn: eq_65534_uint32}, -+ {idx: 11, exp: ne, fn: ne_65534_uint32}, -+ {idx: 12, exp: lt, fn: lt_65535_uint32}, -+ {idx: 12, exp: le, fn: le_65535_uint32}, -+ {idx: 12, exp: gt, fn: gt_65535_uint32}, -+ {idx: 12, exp: ge, fn: ge_65535_uint32}, -+ {idx: 12, exp: eq, fn: eq_65535_uint32}, -+ {idx: 12, exp: ne, fn: ne_65535_uint32}, -+ {idx: 13, exp: lt, fn: lt_65536_uint32}, -+ {idx: 13, exp: le, fn: le_65536_uint32}, -+ {idx: 13, exp: gt, fn: gt_65536_uint32}, -+ {idx: 13, exp: ge, fn: ge_65536_uint32}, -+ {idx: 13, exp: eq, fn: eq_65536_uint32}, -+ {idx: 13, exp: ne, fn: ne_65536_uint32}, -+ {idx: 14, exp: lt, fn: lt_2147483646_uint32}, -+ {idx: 14, exp: le, fn: le_2147483646_uint32}, -+ {idx: 14, exp: gt, fn: gt_2147483646_uint32}, -+ {idx: 14, exp: ge, fn: ge_2147483646_uint32}, -+ {idx: 14, exp: eq, fn: eq_2147483646_uint32}, -+ {idx: 14, exp: ne, fn: ne_2147483646_uint32}, -+ {idx: 15, exp: lt, fn: lt_2147483647_uint32}, -+ {idx: 15, exp: le, fn: le_2147483647_uint32}, -+ {idx: 15, exp: gt, fn: gt_2147483647_uint32}, -+ {idx: 15, exp: ge, fn: ge_2147483647_uint32}, -+ {idx: 15, exp: eq, fn: eq_2147483647_uint32}, -+ {idx: 15, exp: ne, fn: ne_2147483647_uint32}, -+ {idx: 16, exp: lt, fn: lt_2147483648_uint32}, -+ {idx: 16, exp: le, fn: le_2147483648_uint32}, -+ {idx: 16, exp: gt, fn: gt_2147483648_uint32}, -+ {idx: 16, exp: ge, fn: ge_2147483648_uint32}, -+ {idx: 16, exp: eq, fn: eq_2147483648_uint32}, -+ {idx: 16, exp: ne, fn: ne_2147483648_uint32}, -+ {idx: 17, exp: lt, fn: lt_4278190080_uint32}, -+ {idx: 17, exp: le, fn: le_4278190080_uint32}, -+ {idx: 17, exp: gt, fn: gt_4278190080_uint32}, -+ {idx: 17, exp: ge, fn: ge_4278190080_uint32}, -+ {idx: 17, exp: eq, fn: eq_4278190080_uint32}, -+ {idx: 17, exp: ne, fn: ne_4278190080_uint32}, -+ {idx: 18, exp: lt, fn: lt_4294967294_uint32}, -+ {idx: 18, exp: le, fn: le_4294967294_uint32}, -+ {idx: 18, exp: gt, fn: gt_4294967294_uint32}, -+ {idx: 18, exp: ge, fn: ge_4294967294_uint32}, -+ {idx: 18, exp: eq, fn: eq_4294967294_uint32}, -+ {idx: 18, exp: ne, fn: ne_4294967294_uint32}, -+ {idx: 19, exp: lt, fn: lt_4294967295_uint32}, -+ {idx: 19, exp: le, fn: le_4294967295_uint32}, -+ {idx: 19, exp: gt, fn: gt_4294967295_uint32}, -+ {idx: 19, exp: ge, fn: ge_4294967295_uint32}, -+ {idx: 19, exp: eq, fn: eq_4294967295_uint32}, -+ {idx: 19, exp: ne, fn: ne_4294967295_uint32}, -+} -+ -+// uint16 tests -+var uint16_vals = []uint16{ -+ 0, -+ 1, -+ 126, -+ 127, -+ 128, -+ 254, -+ 255, -+ 256, -+ 32766, -+ 32767, -+ 32768, -+ 65534, -+ 65535, -+} -+ -+func lt_0_uint16(x uint16) bool { return x < 0 } -+func le_0_uint16(x uint16) bool { return x <= 0 } -+func gt_0_uint16(x uint16) bool { return x > 0 } -+func ge_0_uint16(x uint16) bool { return x >= 0 } -+func eq_0_uint16(x uint16) bool { return x == 0 } -+func ne_0_uint16(x uint16) bool { return x != 0 } -+func lt_1_uint16(x uint16) bool { return x < 1 } -+func le_1_uint16(x uint16) bool { return x <= 1 } -+func gt_1_uint16(x uint16) bool { return x > 1 } -+func ge_1_uint16(x uint16) bool { return x >= 1 } -+func eq_1_uint16(x uint16) bool { return x == 1 } -+func ne_1_uint16(x uint16) bool { return x != 1 } -+func lt_126_uint16(x uint16) bool { return x < 126 } -+func le_126_uint16(x uint16) bool { return x <= 126 } -+func gt_126_uint16(x uint16) bool { return x > 126 } -+func ge_126_uint16(x uint16) bool { return x >= 126 } -+func eq_126_uint16(x uint16) bool { return x == 126 } -+func ne_126_uint16(x uint16) bool { return x != 126 } -+func lt_127_uint16(x uint16) bool { return x < 127 } -+func le_127_uint16(x uint16) bool { return x <= 127 } -+func gt_127_uint16(x uint16) bool { return x > 127 } -+func ge_127_uint16(x uint16) bool { return x >= 127 } -+func eq_127_uint16(x uint16) bool { return x == 127 } -+func ne_127_uint16(x uint16) bool { return x != 127 } -+func lt_128_uint16(x uint16) bool { return x < 128 } -+func le_128_uint16(x uint16) bool { return x <= 128 } -+func gt_128_uint16(x uint16) bool { return x > 128 } -+func ge_128_uint16(x uint16) bool { return x >= 128 } -+func eq_128_uint16(x uint16) bool { return x == 128 } -+func ne_128_uint16(x uint16) bool { return x != 128 } -+func lt_254_uint16(x uint16) bool { return x < 254 } -+func le_254_uint16(x uint16) bool { return x <= 254 } -+func gt_254_uint16(x uint16) bool { return x > 254 } -+func ge_254_uint16(x uint16) bool { return x >= 254 } -+func eq_254_uint16(x uint16) bool { return x == 254 } -+func ne_254_uint16(x uint16) bool { return x != 254 } -+func lt_255_uint16(x uint16) bool { return x < 255 } -+func le_255_uint16(x uint16) bool { return x <= 255 } -+func gt_255_uint16(x uint16) bool { return x > 255 } -+func ge_255_uint16(x uint16) bool { return x >= 255 } -+func eq_255_uint16(x uint16) bool { return x == 255 } -+func ne_255_uint16(x uint16) bool { return x != 255 } -+func lt_256_uint16(x uint16) bool { return x < 256 } -+func le_256_uint16(x uint16) bool { return x <= 256 } -+func gt_256_uint16(x uint16) bool { return x > 256 } -+func ge_256_uint16(x uint16) bool { return x >= 256 } -+func eq_256_uint16(x uint16) bool { return x == 256 } -+func ne_256_uint16(x uint16) bool { return x != 256 } -+func lt_32766_uint16(x uint16) bool { return x < 32766 } -+func le_32766_uint16(x uint16) bool { return x <= 32766 } -+func gt_32766_uint16(x uint16) bool { return x > 32766 } -+func ge_32766_uint16(x uint16) bool { return x >= 32766 } -+func eq_32766_uint16(x uint16) bool { return x == 32766 } -+func ne_32766_uint16(x uint16) bool { return x != 32766 } -+func lt_32767_uint16(x uint16) bool { return x < 32767 } -+func le_32767_uint16(x uint16) bool { return x <= 32767 } -+func gt_32767_uint16(x uint16) bool { return x > 32767 } -+func ge_32767_uint16(x uint16) bool { return x >= 32767 } -+func eq_32767_uint16(x uint16) bool { return x == 32767 } -+func ne_32767_uint16(x uint16) bool { return x != 32767 } -+func lt_32768_uint16(x uint16) bool { return x < 32768 } -+func le_32768_uint16(x uint16) bool { return x <= 32768 } -+func gt_32768_uint16(x uint16) bool { return x > 32768 } -+func ge_32768_uint16(x uint16) bool { return x >= 32768 } -+func eq_32768_uint16(x uint16) bool { return x == 32768 } -+func ne_32768_uint16(x uint16) bool { return x != 32768 } -+func lt_65534_uint16(x uint16) bool { return x < 65534 } -+func le_65534_uint16(x uint16) bool { return x <= 65534 } -+func gt_65534_uint16(x uint16) bool { return x > 65534 } -+func ge_65534_uint16(x uint16) bool { return x >= 65534 } -+func eq_65534_uint16(x uint16) bool { return x == 65534 } -+func ne_65534_uint16(x uint16) bool { return x != 65534 } -+func lt_65535_uint16(x uint16) bool { return x < 65535 } -+func le_65535_uint16(x uint16) bool { return x <= 65535 } -+func gt_65535_uint16(x uint16) bool { return x > 65535 } -+func ge_65535_uint16(x uint16) bool { return x >= 65535 } -+func eq_65535_uint16(x uint16) bool { return x == 65535 } -+func ne_65535_uint16(x uint16) bool { return x != 65535 } -+ -+var uint16_tests = []struct { -+ idx int // index of the constant used -+ exp result // expected results -+ fn func(uint16) bool -+}{ -+ {idx: 0, exp: lt, fn: lt_0_uint16}, -+ {idx: 0, exp: le, fn: le_0_uint16}, -+ {idx: 0, exp: gt, fn: gt_0_uint16}, -+ {idx: 0, exp: ge, fn: ge_0_uint16}, -+ {idx: 0, exp: eq, fn: eq_0_uint16}, -+ {idx: 0, exp: ne, fn: ne_0_uint16}, -+ {idx: 1, exp: lt, fn: lt_1_uint16}, -+ {idx: 1, exp: le, fn: le_1_uint16}, -+ {idx: 1, exp: gt, fn: gt_1_uint16}, -+ {idx: 1, exp: ge, fn: ge_1_uint16}, -+ {idx: 1, exp: eq, fn: eq_1_uint16}, -+ {idx: 1, exp: ne, fn: ne_1_uint16}, -+ {idx: 2, exp: lt, fn: lt_126_uint16}, -+ {idx: 2, exp: le, fn: le_126_uint16}, -+ {idx: 2, exp: gt, fn: gt_126_uint16}, -+ {idx: 2, exp: ge, fn: ge_126_uint16}, -+ {idx: 2, exp: eq, fn: eq_126_uint16}, -+ {idx: 2, exp: ne, fn: ne_126_uint16}, -+ {idx: 3, exp: lt, fn: lt_127_uint16}, -+ {idx: 3, exp: le, fn: le_127_uint16}, -+ {idx: 3, exp: gt, fn: gt_127_uint16}, -+ {idx: 3, exp: ge, fn: ge_127_uint16}, -+ {idx: 3, exp: eq, fn: eq_127_uint16}, -+ {idx: 3, exp: ne, fn: ne_127_uint16}, -+ {idx: 4, exp: lt, fn: lt_128_uint16}, -+ {idx: 4, exp: le, fn: le_128_uint16}, -+ {idx: 4, exp: gt, fn: gt_128_uint16}, -+ {idx: 4, exp: ge, fn: ge_128_uint16}, -+ {idx: 4, exp: eq, fn: eq_128_uint16}, -+ {idx: 4, exp: ne, fn: ne_128_uint16}, -+ {idx: 5, exp: lt, fn: lt_254_uint16}, -+ {idx: 5, exp: le, fn: le_254_uint16}, -+ {idx: 5, exp: gt, fn: gt_254_uint16}, -+ {idx: 5, exp: ge, fn: ge_254_uint16}, -+ {idx: 5, exp: eq, fn: eq_254_uint16}, -+ {idx: 5, exp: ne, fn: ne_254_uint16}, -+ {idx: 6, exp: lt, fn: lt_255_uint16}, -+ {idx: 6, exp: le, fn: le_255_uint16}, -+ {idx: 6, exp: gt, fn: gt_255_uint16}, -+ {idx: 6, exp: ge, fn: ge_255_uint16}, -+ {idx: 6, exp: eq, fn: eq_255_uint16}, -+ {idx: 6, exp: ne, fn: ne_255_uint16}, -+ {idx: 7, exp: lt, fn: lt_256_uint16}, -+ {idx: 7, exp: le, fn: le_256_uint16}, -+ {idx: 7, exp: gt, fn: gt_256_uint16}, -+ {idx: 7, exp: ge, fn: ge_256_uint16}, -+ {idx: 7, exp: eq, fn: eq_256_uint16}, -+ {idx: 7, exp: ne, fn: ne_256_uint16}, -+ {idx: 8, exp: lt, fn: lt_32766_uint16}, -+ {idx: 8, exp: le, fn: le_32766_uint16}, -+ {idx: 8, exp: gt, fn: gt_32766_uint16}, -+ {idx: 8, exp: ge, fn: ge_32766_uint16}, -+ {idx: 8, exp: eq, fn: eq_32766_uint16}, -+ {idx: 8, exp: ne, fn: ne_32766_uint16}, -+ {idx: 9, exp: lt, fn: lt_32767_uint16}, -+ {idx: 9, exp: le, fn: le_32767_uint16}, -+ {idx: 9, exp: gt, fn: gt_32767_uint16}, -+ {idx: 9, exp: ge, fn: ge_32767_uint16}, -+ {idx: 9, exp: eq, fn: eq_32767_uint16}, -+ {idx: 9, exp: ne, fn: ne_32767_uint16}, -+ {idx: 10, exp: lt, fn: lt_32768_uint16}, -+ {idx: 10, exp: le, fn: le_32768_uint16}, -+ {idx: 10, exp: gt, fn: gt_32768_uint16}, -+ {idx: 10, exp: ge, fn: ge_32768_uint16}, -+ {idx: 10, exp: eq, fn: eq_32768_uint16}, -+ {idx: 10, exp: ne, fn: ne_32768_uint16}, -+ {idx: 11, exp: lt, fn: lt_65534_uint16}, -+ {idx: 11, exp: le, fn: le_65534_uint16}, -+ {idx: 11, exp: gt, fn: gt_65534_uint16}, -+ {idx: 11, exp: ge, fn: ge_65534_uint16}, -+ {idx: 11, exp: eq, fn: eq_65534_uint16}, -+ {idx: 11, exp: ne, fn: ne_65534_uint16}, -+ {idx: 12, exp: lt, fn: lt_65535_uint16}, -+ {idx: 12, exp: le, fn: le_65535_uint16}, -+ {idx: 12, exp: gt, fn: gt_65535_uint16}, -+ {idx: 12, exp: ge, fn: ge_65535_uint16}, -+ {idx: 12, exp: eq, fn: eq_65535_uint16}, -+ {idx: 12, exp: ne, fn: ne_65535_uint16}, -+} -+ -+// uint8 tests -+var uint8_vals = []uint8{ -+ 0, -+ 1, -+ 126, -+ 127, -+ 128, -+ 254, -+ 255, -+} -+ -+func lt_0_uint8(x uint8) bool { return x < 0 } -+func le_0_uint8(x uint8) bool { return x <= 0 } -+func gt_0_uint8(x uint8) bool { return x > 0 } -+func ge_0_uint8(x uint8) bool { return x >= 0 } -+func eq_0_uint8(x uint8) bool { return x == 0 } -+func ne_0_uint8(x uint8) bool { return x != 0 } -+func lt_1_uint8(x uint8) bool { return x < 1 } -+func le_1_uint8(x uint8) bool { return x <= 1 } -+func gt_1_uint8(x uint8) bool { return x > 1 } -+func ge_1_uint8(x uint8) bool { return x >= 1 } -+func eq_1_uint8(x uint8) bool { return x == 1 } -+func ne_1_uint8(x uint8) bool { return x != 1 } -+func lt_126_uint8(x uint8) bool { return x < 126 } -+func le_126_uint8(x uint8) bool { return x <= 126 } -+func gt_126_uint8(x uint8) bool { return x > 126 } -+func ge_126_uint8(x uint8) bool { return x >= 126 } -+func eq_126_uint8(x uint8) bool { return x == 126 } -+func ne_126_uint8(x uint8) bool { return x != 126 } -+func lt_127_uint8(x uint8) bool { return x < 127 } -+func le_127_uint8(x uint8) bool { return x <= 127 } -+func gt_127_uint8(x uint8) bool { return x > 127 } -+func ge_127_uint8(x uint8) bool { return x >= 127 } -+func eq_127_uint8(x uint8) bool { return x == 127 } -+func ne_127_uint8(x uint8) bool { return x != 127 } -+func lt_128_uint8(x uint8) bool { return x < 128 } -+func le_128_uint8(x uint8) bool { return x <= 128 } -+func gt_128_uint8(x uint8) bool { return x > 128 } -+func ge_128_uint8(x uint8) bool { return x >= 128 } -+func eq_128_uint8(x uint8) bool { return x == 128 } -+func ne_128_uint8(x uint8) bool { return x != 128 } -+func lt_254_uint8(x uint8) bool { return x < 254 } -+func le_254_uint8(x uint8) bool { return x <= 254 } -+func gt_254_uint8(x uint8) bool { return x > 254 } -+func ge_254_uint8(x uint8) bool { return x >= 254 } -+func eq_254_uint8(x uint8) bool { return x == 254 } -+func ne_254_uint8(x uint8) bool { return x != 254 } -+func lt_255_uint8(x uint8) bool { return x < 255 } -+func le_255_uint8(x uint8) bool { return x <= 255 } -+func gt_255_uint8(x uint8) bool { return x > 255 } -+func ge_255_uint8(x uint8) bool { return x >= 255 } -+func eq_255_uint8(x uint8) bool { return x == 255 } -+func ne_255_uint8(x uint8) bool { return x != 255 } -+ -+var uint8_tests = []struct { -+ idx int // index of the constant used -+ exp result // expected results -+ fn func(uint8) bool -+}{ -+ {idx: 0, exp: lt, fn: lt_0_uint8}, -+ {idx: 0, exp: le, fn: le_0_uint8}, -+ {idx: 0, exp: gt, fn: gt_0_uint8}, -+ {idx: 0, exp: ge, fn: ge_0_uint8}, -+ {idx: 0, exp: eq, fn: eq_0_uint8}, -+ {idx: 0, exp: ne, fn: ne_0_uint8}, -+ {idx: 1, exp: lt, fn: lt_1_uint8}, -+ {idx: 1, exp: le, fn: le_1_uint8}, -+ {idx: 1, exp: gt, fn: gt_1_uint8}, -+ {idx: 1, exp: ge, fn: ge_1_uint8}, -+ {idx: 1, exp: eq, fn: eq_1_uint8}, -+ {idx: 1, exp: ne, fn: ne_1_uint8}, -+ {idx: 2, exp: lt, fn: lt_126_uint8}, -+ {idx: 2, exp: le, fn: le_126_uint8}, -+ {idx: 2, exp: gt, fn: gt_126_uint8}, -+ {idx: 2, exp: ge, fn: ge_126_uint8}, -+ {idx: 2, exp: eq, fn: eq_126_uint8}, -+ {idx: 2, exp: ne, fn: ne_126_uint8}, -+ {idx: 3, exp: lt, fn: lt_127_uint8}, -+ {idx: 3, exp: le, fn: le_127_uint8}, -+ {idx: 3, exp: gt, fn: gt_127_uint8}, -+ {idx: 3, exp: ge, fn: ge_127_uint8}, -+ {idx: 3, exp: eq, fn: eq_127_uint8}, -+ {idx: 3, exp: ne, fn: ne_127_uint8}, -+ {idx: 4, exp: lt, fn: lt_128_uint8}, -+ {idx: 4, exp: le, fn: le_128_uint8}, -+ {idx: 4, exp: gt, fn: gt_128_uint8}, -+ {idx: 4, exp: ge, fn: ge_128_uint8}, -+ {idx: 4, exp: eq, fn: eq_128_uint8}, -+ {idx: 4, exp: ne, fn: ne_128_uint8}, -+ {idx: 5, exp: lt, fn: lt_254_uint8}, -+ {idx: 5, exp: le, fn: le_254_uint8}, -+ {idx: 5, exp: gt, fn: gt_254_uint8}, -+ {idx: 5, exp: ge, fn: ge_254_uint8}, -+ {idx: 5, exp: eq, fn: eq_254_uint8}, -+ {idx: 5, exp: ne, fn: ne_254_uint8}, -+ {idx: 6, exp: lt, fn: lt_255_uint8}, -+ {idx: 6, exp: le, fn: le_255_uint8}, -+ {idx: 6, exp: gt, fn: gt_255_uint8}, -+ {idx: 6, exp: ge, fn: ge_255_uint8}, -+ {idx: 6, exp: eq, fn: eq_255_uint8}, -+ {idx: 6, exp: ne, fn: ne_255_uint8}, -+} -+ -+// int64 tests -+var int64_vals = []int64{ -+ -9223372036854775808, -+ -9223372036854775807, -+ -2147483649, -+ -2147483648, -+ -2147483647, -+ -32769, -+ -32768, -+ -32767, -+ -129, -+ -128, -+ -127, -+ -1, -+ 0, -+ 1, -+ 126, -+ 127, -+ 128, -+ 254, -+ 255, -+ 256, -+ 32766, -+ 32767, -+ 32768, -+ 65534, -+ 65535, -+ 65536, -+ 2147483646, -+ 2147483647, -+ 2147483648, -+ 4278190080, -+ 4294967294, -+ 4294967295, -+ 4294967296, -+ 1095216660480, -+ 9223372036854775806, -+ 9223372036854775807, -+} -+ -+func lt_neg9223372036854775808_int64(x int64) bool { return x < -9223372036854775808 } -+func le_neg9223372036854775808_int64(x int64) bool { return x <= -9223372036854775808 } -+func gt_neg9223372036854775808_int64(x int64) bool { return x > -9223372036854775808 } -+func ge_neg9223372036854775808_int64(x int64) bool { return x >= -9223372036854775808 } -+func eq_neg9223372036854775808_int64(x int64) bool { return x == -9223372036854775808 } -+func ne_neg9223372036854775808_int64(x int64) bool { return x != -9223372036854775808 } -+func lt_neg9223372036854775807_int64(x int64) bool { return x < -9223372036854775807 } -+func le_neg9223372036854775807_int64(x int64) bool { return x <= -9223372036854775807 } -+func gt_neg9223372036854775807_int64(x int64) bool { return x > -9223372036854775807 } -+func ge_neg9223372036854775807_int64(x int64) bool { return x >= -9223372036854775807 } -+func eq_neg9223372036854775807_int64(x int64) bool { return x == -9223372036854775807 } -+func ne_neg9223372036854775807_int64(x int64) bool { return x != -9223372036854775807 } -+func lt_neg2147483649_int64(x int64) bool { return x < -2147483649 } -+func le_neg2147483649_int64(x int64) bool { return x <= -2147483649 } -+func gt_neg2147483649_int64(x int64) bool { return x > -2147483649 } -+func ge_neg2147483649_int64(x int64) bool { return x >= -2147483649 } -+func eq_neg2147483649_int64(x int64) bool { return x == -2147483649 } -+func ne_neg2147483649_int64(x int64) bool { return x != -2147483649 } -+func lt_neg2147483648_int64(x int64) bool { return x < -2147483648 } -+func le_neg2147483648_int64(x int64) bool { return x <= -2147483648 } -+func gt_neg2147483648_int64(x int64) bool { return x > -2147483648 } -+func ge_neg2147483648_int64(x int64) bool { return x >= -2147483648 } -+func eq_neg2147483648_int64(x int64) bool { return x == -2147483648 } -+func ne_neg2147483648_int64(x int64) bool { return x != -2147483648 } -+func lt_neg2147483647_int64(x int64) bool { return x < -2147483647 } -+func le_neg2147483647_int64(x int64) bool { return x <= -2147483647 } -+func gt_neg2147483647_int64(x int64) bool { return x > -2147483647 } -+func ge_neg2147483647_int64(x int64) bool { return x >= -2147483647 } -+func eq_neg2147483647_int64(x int64) bool { return x == -2147483647 } -+func ne_neg2147483647_int64(x int64) bool { return x != -2147483647 } -+func lt_neg32769_int64(x int64) bool { return x < -32769 } -+func le_neg32769_int64(x int64) bool { return x <= -32769 } -+func gt_neg32769_int64(x int64) bool { return x > -32769 } -+func ge_neg32769_int64(x int64) bool { return x >= -32769 } -+func eq_neg32769_int64(x int64) bool { return x == -32769 } -+func ne_neg32769_int64(x int64) bool { return x != -32769 } -+func lt_neg32768_int64(x int64) bool { return x < -32768 } -+func le_neg32768_int64(x int64) bool { return x <= -32768 } -+func gt_neg32768_int64(x int64) bool { return x > -32768 } -+func ge_neg32768_int64(x int64) bool { return x >= -32768 } -+func eq_neg32768_int64(x int64) bool { return x == -32768 } -+func ne_neg32768_int64(x int64) bool { return x != -32768 } -+func lt_neg32767_int64(x int64) bool { return x < -32767 } -+func le_neg32767_int64(x int64) bool { return x <= -32767 } -+func gt_neg32767_int64(x int64) bool { return x > -32767 } -+func ge_neg32767_int64(x int64) bool { return x >= -32767 } -+func eq_neg32767_int64(x int64) bool { return x == -32767 } -+func ne_neg32767_int64(x int64) bool { return x != -32767 } -+func lt_neg129_int64(x int64) bool { return x < -129 } -+func le_neg129_int64(x int64) bool { return x <= -129 } -+func gt_neg129_int64(x int64) bool { return x > -129 } -+func ge_neg129_int64(x int64) bool { return x >= -129 } -+func eq_neg129_int64(x int64) bool { return x == -129 } -+func ne_neg129_int64(x int64) bool { return x != -129 } -+func lt_neg128_int64(x int64) bool { return x < -128 } -+func le_neg128_int64(x int64) bool { return x <= -128 } -+func gt_neg128_int64(x int64) bool { return x > -128 } -+func ge_neg128_int64(x int64) bool { return x >= -128 } -+func eq_neg128_int64(x int64) bool { return x == -128 } -+func ne_neg128_int64(x int64) bool { return x != -128 } -+func lt_neg127_int64(x int64) bool { return x < -127 } -+func le_neg127_int64(x int64) bool { return x <= -127 } -+func gt_neg127_int64(x int64) bool { return x > -127 } -+func ge_neg127_int64(x int64) bool { return x >= -127 } -+func eq_neg127_int64(x int64) bool { return x == -127 } -+func ne_neg127_int64(x int64) bool { return x != -127 } -+func lt_neg1_int64(x int64) bool { return x < -1 } -+func le_neg1_int64(x int64) bool { return x <= -1 } -+func gt_neg1_int64(x int64) bool { return x > -1 } -+func ge_neg1_int64(x int64) bool { return x >= -1 } -+func eq_neg1_int64(x int64) bool { return x == -1 } -+func ne_neg1_int64(x int64) bool { return x != -1 } -+func lt_0_int64(x int64) bool { return x < 0 } -+func le_0_int64(x int64) bool { return x <= 0 } -+func gt_0_int64(x int64) bool { return x > 0 } -+func ge_0_int64(x int64) bool { return x >= 0 } -+func eq_0_int64(x int64) bool { return x == 0 } -+func ne_0_int64(x int64) bool { return x != 0 } -+func lt_1_int64(x int64) bool { return x < 1 } -+func le_1_int64(x int64) bool { return x <= 1 } -+func gt_1_int64(x int64) bool { return x > 1 } -+func ge_1_int64(x int64) bool { return x >= 1 } -+func eq_1_int64(x int64) bool { return x == 1 } -+func ne_1_int64(x int64) bool { return x != 1 } -+func lt_126_int64(x int64) bool { return x < 126 } -+func le_126_int64(x int64) bool { return x <= 126 } -+func gt_126_int64(x int64) bool { return x > 126 } -+func ge_126_int64(x int64) bool { return x >= 126 } -+func eq_126_int64(x int64) bool { return x == 126 } -+func ne_126_int64(x int64) bool { return x != 126 } -+func lt_127_int64(x int64) bool { return x < 127 } -+func le_127_int64(x int64) bool { return x <= 127 } -+func gt_127_int64(x int64) bool { return x > 127 } -+func ge_127_int64(x int64) bool { return x >= 127 } -+func eq_127_int64(x int64) bool { return x == 127 } -+func ne_127_int64(x int64) bool { return x != 127 } -+func lt_128_int64(x int64) bool { return x < 128 } -+func le_128_int64(x int64) bool { return x <= 128 } -+func gt_128_int64(x int64) bool { return x > 128 } -+func ge_128_int64(x int64) bool { return x >= 128 } -+func eq_128_int64(x int64) bool { return x == 128 } -+func ne_128_int64(x int64) bool { return x != 128 } -+func lt_254_int64(x int64) bool { return x < 254 } -+func le_254_int64(x int64) bool { return x <= 254 } -+func gt_254_int64(x int64) bool { return x > 254 } -+func ge_254_int64(x int64) bool { return x >= 254 } -+func eq_254_int64(x int64) bool { return x == 254 } -+func ne_254_int64(x int64) bool { return x != 254 } -+func lt_255_int64(x int64) bool { return x < 255 } -+func le_255_int64(x int64) bool { return x <= 255 } -+func gt_255_int64(x int64) bool { return x > 255 } -+func ge_255_int64(x int64) bool { return x >= 255 } -+func eq_255_int64(x int64) bool { return x == 255 } -+func ne_255_int64(x int64) bool { return x != 255 } -+func lt_256_int64(x int64) bool { return x < 256 } -+func le_256_int64(x int64) bool { return x <= 256 } -+func gt_256_int64(x int64) bool { return x > 256 } -+func ge_256_int64(x int64) bool { return x >= 256 } -+func eq_256_int64(x int64) bool { return x == 256 } -+func ne_256_int64(x int64) bool { return x != 256 } -+func lt_32766_int64(x int64) bool { return x < 32766 } -+func le_32766_int64(x int64) bool { return x <= 32766 } -+func gt_32766_int64(x int64) bool { return x > 32766 } -+func ge_32766_int64(x int64) bool { return x >= 32766 } -+func eq_32766_int64(x int64) bool { return x == 32766 } -+func ne_32766_int64(x int64) bool { return x != 32766 } -+func lt_32767_int64(x int64) bool { return x < 32767 } -+func le_32767_int64(x int64) bool { return x <= 32767 } -+func gt_32767_int64(x int64) bool { return x > 32767 } -+func ge_32767_int64(x int64) bool { return x >= 32767 } -+func eq_32767_int64(x int64) bool { return x == 32767 } -+func ne_32767_int64(x int64) bool { return x != 32767 } -+func lt_32768_int64(x int64) bool { return x < 32768 } -+func le_32768_int64(x int64) bool { return x <= 32768 } -+func gt_32768_int64(x int64) bool { return x > 32768 } -+func ge_32768_int64(x int64) bool { return x >= 32768 } -+func eq_32768_int64(x int64) bool { return x == 32768 } -+func ne_32768_int64(x int64) bool { return x != 32768 } -+func lt_65534_int64(x int64) bool { return x < 65534 } -+func le_65534_int64(x int64) bool { return x <= 65534 } -+func gt_65534_int64(x int64) bool { return x > 65534 } -+func ge_65534_int64(x int64) bool { return x >= 65534 } -+func eq_65534_int64(x int64) bool { return x == 65534 } -+func ne_65534_int64(x int64) bool { return x != 65534 } -+func lt_65535_int64(x int64) bool { return x < 65535 } -+func le_65535_int64(x int64) bool { return x <= 65535 } -+func gt_65535_int64(x int64) bool { return x > 65535 } -+func ge_65535_int64(x int64) bool { return x >= 65535 } -+func eq_65535_int64(x int64) bool { return x == 65535 } -+func ne_65535_int64(x int64) bool { return x != 65535 } -+func lt_65536_int64(x int64) bool { return x < 65536 } -+func le_65536_int64(x int64) bool { return x <= 65536 } -+func gt_65536_int64(x int64) bool { return x > 65536 } -+func ge_65536_int64(x int64) bool { return x >= 65536 } -+func eq_65536_int64(x int64) bool { return x == 65536 } -+func ne_65536_int64(x int64) bool { return x != 65536 } -+func lt_2147483646_int64(x int64) bool { return x < 2147483646 } -+func le_2147483646_int64(x int64) bool { return x <= 2147483646 } -+func gt_2147483646_int64(x int64) bool { return x > 2147483646 } -+func ge_2147483646_int64(x int64) bool { return x >= 2147483646 } -+func eq_2147483646_int64(x int64) bool { return x == 2147483646 } -+func ne_2147483646_int64(x int64) bool { return x != 2147483646 } -+func lt_2147483647_int64(x int64) bool { return x < 2147483647 } -+func le_2147483647_int64(x int64) bool { return x <= 2147483647 } -+func gt_2147483647_int64(x int64) bool { return x > 2147483647 } -+func ge_2147483647_int64(x int64) bool { return x >= 2147483647 } -+func eq_2147483647_int64(x int64) bool { return x == 2147483647 } -+func ne_2147483647_int64(x int64) bool { return x != 2147483647 } -+func lt_2147483648_int64(x int64) bool { return x < 2147483648 } -+func le_2147483648_int64(x int64) bool { return x <= 2147483648 } -+func gt_2147483648_int64(x int64) bool { return x > 2147483648 } -+func ge_2147483648_int64(x int64) bool { return x >= 2147483648 } -+func eq_2147483648_int64(x int64) bool { return x == 2147483648 } -+func ne_2147483648_int64(x int64) bool { return x != 2147483648 } -+func lt_4278190080_int64(x int64) bool { return x < 4278190080 } -+func le_4278190080_int64(x int64) bool { return x <= 4278190080 } -+func gt_4278190080_int64(x int64) bool { return x > 4278190080 } -+func ge_4278190080_int64(x int64) bool { return x >= 4278190080 } -+func eq_4278190080_int64(x int64) bool { return x == 4278190080 } -+func ne_4278190080_int64(x int64) bool { return x != 4278190080 } -+func lt_4294967294_int64(x int64) bool { return x < 4294967294 } -+func le_4294967294_int64(x int64) bool { return x <= 4294967294 } -+func gt_4294967294_int64(x int64) bool { return x > 4294967294 } -+func ge_4294967294_int64(x int64) bool { return x >= 4294967294 } -+func eq_4294967294_int64(x int64) bool { return x == 4294967294 } -+func ne_4294967294_int64(x int64) bool { return x != 4294967294 } -+func lt_4294967295_int64(x int64) bool { return x < 4294967295 } -+func le_4294967295_int64(x int64) bool { return x <= 4294967295 } -+func gt_4294967295_int64(x int64) bool { return x > 4294967295 } -+func ge_4294967295_int64(x int64) bool { return x >= 4294967295 } -+func eq_4294967295_int64(x int64) bool { return x == 4294967295 } -+func ne_4294967295_int64(x int64) bool { return x != 4294967295 } -+func lt_4294967296_int64(x int64) bool { return x < 4294967296 } -+func le_4294967296_int64(x int64) bool { return x <= 4294967296 } -+func gt_4294967296_int64(x int64) bool { return x > 4294967296 } -+func ge_4294967296_int64(x int64) bool { return x >= 4294967296 } -+func eq_4294967296_int64(x int64) bool { return x == 4294967296 } -+func ne_4294967296_int64(x int64) bool { return x != 4294967296 } -+func lt_1095216660480_int64(x int64) bool { return x < 1095216660480 } -+func le_1095216660480_int64(x int64) bool { return x <= 1095216660480 } -+func gt_1095216660480_int64(x int64) bool { return x > 1095216660480 } -+func ge_1095216660480_int64(x int64) bool { return x >= 1095216660480 } -+func eq_1095216660480_int64(x int64) bool { return x == 1095216660480 } -+func ne_1095216660480_int64(x int64) bool { return x != 1095216660480 } -+func lt_9223372036854775806_int64(x int64) bool { return x < 9223372036854775806 } -+func le_9223372036854775806_int64(x int64) bool { return x <= 9223372036854775806 } -+func gt_9223372036854775806_int64(x int64) bool { return x > 9223372036854775806 } -+func ge_9223372036854775806_int64(x int64) bool { return x >= 9223372036854775806 } -+func eq_9223372036854775806_int64(x int64) bool { return x == 9223372036854775806 } -+func ne_9223372036854775806_int64(x int64) bool { return x != 9223372036854775806 } -+func lt_9223372036854775807_int64(x int64) bool { return x < 9223372036854775807 } -+func le_9223372036854775807_int64(x int64) bool { return x <= 9223372036854775807 } -+func gt_9223372036854775807_int64(x int64) bool { return x > 9223372036854775807 } -+func ge_9223372036854775807_int64(x int64) bool { return x >= 9223372036854775807 } -+func eq_9223372036854775807_int64(x int64) bool { return x == 9223372036854775807 } -+func ne_9223372036854775807_int64(x int64) bool { return x != 9223372036854775807 } -+ -+var int64_tests = []struct { -+ idx int // index of the constant used -+ exp result // expected results -+ fn func(int64) bool -+}{ -+ {idx: 0, exp: lt, fn: lt_neg9223372036854775808_int64}, -+ {idx: 0, exp: le, fn: le_neg9223372036854775808_int64}, -+ {idx: 0, exp: gt, fn: gt_neg9223372036854775808_int64}, -+ {idx: 0, exp: ge, fn: ge_neg9223372036854775808_int64}, -+ {idx: 0, exp: eq, fn: eq_neg9223372036854775808_int64}, -+ {idx: 0, exp: ne, fn: ne_neg9223372036854775808_int64}, -+ {idx: 1, exp: lt, fn: lt_neg9223372036854775807_int64}, -+ {idx: 1, exp: le, fn: le_neg9223372036854775807_int64}, -+ {idx: 1, exp: gt, fn: gt_neg9223372036854775807_int64}, -+ {idx: 1, exp: ge, fn: ge_neg9223372036854775807_int64}, -+ {idx: 1, exp: eq, fn: eq_neg9223372036854775807_int64}, -+ {idx: 1, exp: ne, fn: ne_neg9223372036854775807_int64}, -+ {idx: 2, exp: lt, fn: lt_neg2147483649_int64}, -+ {idx: 2, exp: le, fn: le_neg2147483649_int64}, -+ {idx: 2, exp: gt, fn: gt_neg2147483649_int64}, -+ {idx: 2, exp: ge, fn: ge_neg2147483649_int64}, -+ {idx: 2, exp: eq, fn: eq_neg2147483649_int64}, -+ {idx: 2, exp: ne, fn: ne_neg2147483649_int64}, -+ {idx: 3, exp: lt, fn: lt_neg2147483648_int64}, -+ {idx: 3, exp: le, fn: le_neg2147483648_int64}, -+ {idx: 3, exp: gt, fn: gt_neg2147483648_int64}, -+ {idx: 3, exp: ge, fn: ge_neg2147483648_int64}, -+ {idx: 3, exp: eq, fn: eq_neg2147483648_int64}, -+ {idx: 3, exp: ne, fn: ne_neg2147483648_int64}, -+ {idx: 4, exp: lt, fn: lt_neg2147483647_int64}, -+ {idx: 4, exp: le, fn: le_neg2147483647_int64}, -+ {idx: 4, exp: gt, fn: gt_neg2147483647_int64}, -+ {idx: 4, exp: ge, fn: ge_neg2147483647_int64}, -+ {idx: 4, exp: eq, fn: eq_neg2147483647_int64}, -+ {idx: 4, exp: ne, fn: ne_neg2147483647_int64}, -+ {idx: 5, exp: lt, fn: lt_neg32769_int64}, -+ {idx: 5, exp: le, fn: le_neg32769_int64}, -+ {idx: 5, exp: gt, fn: gt_neg32769_int64}, -+ {idx: 5, exp: ge, fn: ge_neg32769_int64}, -+ {idx: 5, exp: eq, fn: eq_neg32769_int64}, -+ {idx: 5, exp: ne, fn: ne_neg32769_int64}, -+ {idx: 6, exp: lt, fn: lt_neg32768_int64}, -+ {idx: 6, exp: le, fn: le_neg32768_int64}, -+ {idx: 6, exp: gt, fn: gt_neg32768_int64}, -+ {idx: 6, exp: ge, fn: ge_neg32768_int64}, -+ {idx: 6, exp: eq, fn: eq_neg32768_int64}, -+ {idx: 6, exp: ne, fn: ne_neg32768_int64}, -+ {idx: 7, exp: lt, fn: lt_neg32767_int64}, -+ {idx: 7, exp: le, fn: le_neg32767_int64}, -+ {idx: 7, exp: gt, fn: gt_neg32767_int64}, -+ {idx: 7, exp: ge, fn: ge_neg32767_int64}, -+ {idx: 7, exp: eq, fn: eq_neg32767_int64}, -+ {idx: 7, exp: ne, fn: ne_neg32767_int64}, -+ {idx: 8, exp: lt, fn: lt_neg129_int64}, -+ {idx: 8, exp: le, fn: le_neg129_int64}, -+ {idx: 8, exp: gt, fn: gt_neg129_int64}, -+ {idx: 8, exp: ge, fn: ge_neg129_int64}, -+ {idx: 8, exp: eq, fn: eq_neg129_int64}, -+ {idx: 8, exp: ne, fn: ne_neg129_int64}, -+ {idx: 9, exp: lt, fn: lt_neg128_int64}, -+ {idx: 9, exp: le, fn: le_neg128_int64}, -+ {idx: 9, exp: gt, fn: gt_neg128_int64}, -+ {idx: 9, exp: ge, fn: ge_neg128_int64}, -+ {idx: 9, exp: eq, fn: eq_neg128_int64}, -+ {idx: 9, exp: ne, fn: ne_neg128_int64}, -+ {idx: 10, exp: lt, fn: lt_neg127_int64}, -+ {idx: 10, exp: le, fn: le_neg127_int64}, -+ {idx: 10, exp: gt, fn: gt_neg127_int64}, -+ {idx: 10, exp: ge, fn: ge_neg127_int64}, -+ {idx: 10, exp: eq, fn: eq_neg127_int64}, -+ {idx: 10, exp: ne, fn: ne_neg127_int64}, -+ {idx: 11, exp: lt, fn: lt_neg1_int64}, -+ {idx: 11, exp: le, fn: le_neg1_int64}, -+ {idx: 11, exp: gt, fn: gt_neg1_int64}, -+ {idx: 11, exp: ge, fn: ge_neg1_int64}, -+ {idx: 11, exp: eq, fn: eq_neg1_int64}, -+ {idx: 11, exp: ne, fn: ne_neg1_int64}, -+ {idx: 12, exp: lt, fn: lt_0_int64}, -+ {idx: 12, exp: le, fn: le_0_int64}, -+ {idx: 12, exp: gt, fn: gt_0_int64}, -+ {idx: 12, exp: ge, fn: ge_0_int64}, -+ {idx: 12, exp: eq, fn: eq_0_int64}, -+ {idx: 12, exp: ne, fn: ne_0_int64}, -+ {idx: 13, exp: lt, fn: lt_1_int64}, -+ {idx: 13, exp: le, fn: le_1_int64}, -+ {idx: 13, exp: gt, fn: gt_1_int64}, -+ {idx: 13, exp: ge, fn: ge_1_int64}, -+ {idx: 13, exp: eq, fn: eq_1_int64}, -+ {idx: 13, exp: ne, fn: ne_1_int64}, -+ {idx: 14, exp: lt, fn: lt_126_int64}, -+ {idx: 14, exp: le, fn: le_126_int64}, -+ {idx: 14, exp: gt, fn: gt_126_int64}, -+ {idx: 14, exp: ge, fn: ge_126_int64}, -+ {idx: 14, exp: eq, fn: eq_126_int64}, -+ {idx: 14, exp: ne, fn: ne_126_int64}, -+ {idx: 15, exp: lt, fn: lt_127_int64}, -+ {idx: 15, exp: le, fn: le_127_int64}, -+ {idx: 15, exp: gt, fn: gt_127_int64}, -+ {idx: 15, exp: ge, fn: ge_127_int64}, -+ {idx: 15, exp: eq, fn: eq_127_int64}, -+ {idx: 15, exp: ne, fn: ne_127_int64}, -+ {idx: 16, exp: lt, fn: lt_128_int64}, -+ {idx: 16, exp: le, fn: le_128_int64}, -+ {idx: 16, exp: gt, fn: gt_128_int64}, -+ {idx: 16, exp: ge, fn: ge_128_int64}, -+ {idx: 16, exp: eq, fn: eq_128_int64}, -+ {idx: 16, exp: ne, fn: ne_128_int64}, -+ {idx: 17, exp: lt, fn: lt_254_int64}, -+ {idx: 17, exp: le, fn: le_254_int64}, -+ {idx: 17, exp: gt, fn: gt_254_int64}, -+ {idx: 17, exp: ge, fn: ge_254_int64}, -+ {idx: 17, exp: eq, fn: eq_254_int64}, -+ {idx: 17, exp: ne, fn: ne_254_int64}, -+ {idx: 18, exp: lt, fn: lt_255_int64}, -+ {idx: 18, exp: le, fn: le_255_int64}, -+ {idx: 18, exp: gt, fn: gt_255_int64}, -+ {idx: 18, exp: ge, fn: ge_255_int64}, -+ {idx: 18, exp: eq, fn: eq_255_int64}, -+ {idx: 18, exp: ne, fn: ne_255_int64}, -+ {idx: 19, exp: lt, fn: lt_256_int64}, -+ {idx: 19, exp: le, fn: le_256_int64}, -+ {idx: 19, exp: gt, fn: gt_256_int64}, -+ {idx: 19, exp: ge, fn: ge_256_int64}, -+ {idx: 19, exp: eq, fn: eq_256_int64}, -+ {idx: 19, exp: ne, fn: ne_256_int64}, -+ {idx: 20, exp: lt, fn: lt_32766_int64}, -+ {idx: 20, exp: le, fn: le_32766_int64}, -+ {idx: 20, exp: gt, fn: gt_32766_int64}, -+ {idx: 20, exp: ge, fn: ge_32766_int64}, -+ {idx: 20, exp: eq, fn: eq_32766_int64}, -+ {idx: 20, exp: ne, fn: ne_32766_int64}, -+ {idx: 21, exp: lt, fn: lt_32767_int64}, -+ {idx: 21, exp: le, fn: le_32767_int64}, -+ {idx: 21, exp: gt, fn: gt_32767_int64}, -+ {idx: 21, exp: ge, fn: ge_32767_int64}, -+ {idx: 21, exp: eq, fn: eq_32767_int64}, -+ {idx: 21, exp: ne, fn: ne_32767_int64}, -+ {idx: 22, exp: lt, fn: lt_32768_int64}, -+ {idx: 22, exp: le, fn: le_32768_int64}, -+ {idx: 22, exp: gt, fn: gt_32768_int64}, -+ {idx: 22, exp: ge, fn: ge_32768_int64}, -+ {idx: 22, exp: eq, fn: eq_32768_int64}, -+ {idx: 22, exp: ne, fn: ne_32768_int64}, -+ {idx: 23, exp: lt, fn: lt_65534_int64}, -+ {idx: 23, exp: le, fn: le_65534_int64}, -+ {idx: 23, exp: gt, fn: gt_65534_int64}, -+ {idx: 23, exp: ge, fn: ge_65534_int64}, -+ {idx: 23, exp: eq, fn: eq_65534_int64}, -+ {idx: 23, exp: ne, fn: ne_65534_int64}, -+ {idx: 24, exp: lt, fn: lt_65535_int64}, -+ {idx: 24, exp: le, fn: le_65535_int64}, -+ {idx: 24, exp: gt, fn: gt_65535_int64}, -+ {idx: 24, exp: ge, fn: ge_65535_int64}, -+ {idx: 24, exp: eq, fn: eq_65535_int64}, -+ {idx: 24, exp: ne, fn: ne_65535_int64}, -+ {idx: 25, exp: lt, fn: lt_65536_int64}, -+ {idx: 25, exp: le, fn: le_65536_int64}, -+ {idx: 25, exp: gt, fn: gt_65536_int64}, -+ {idx: 25, exp: ge, fn: ge_65536_int64}, -+ {idx: 25, exp: eq, fn: eq_65536_int64}, -+ {idx: 25, exp: ne, fn: ne_65536_int64}, -+ {idx: 26, exp: lt, fn: lt_2147483646_int64}, -+ {idx: 26, exp: le, fn: le_2147483646_int64}, -+ {idx: 26, exp: gt, fn: gt_2147483646_int64}, -+ {idx: 26, exp: ge, fn: ge_2147483646_int64}, -+ {idx: 26, exp: eq, fn: eq_2147483646_int64}, -+ {idx: 26, exp: ne, fn: ne_2147483646_int64}, -+ {idx: 27, exp: lt, fn: lt_2147483647_int64}, -+ {idx: 27, exp: le, fn: le_2147483647_int64}, -+ {idx: 27, exp: gt, fn: gt_2147483647_int64}, -+ {idx: 27, exp: ge, fn: ge_2147483647_int64}, -+ {idx: 27, exp: eq, fn: eq_2147483647_int64}, -+ {idx: 27, exp: ne, fn: ne_2147483647_int64}, -+ {idx: 28, exp: lt, fn: lt_2147483648_int64}, -+ {idx: 28, exp: le, fn: le_2147483648_int64}, -+ {idx: 28, exp: gt, fn: gt_2147483648_int64}, -+ {idx: 28, exp: ge, fn: ge_2147483648_int64}, -+ {idx: 28, exp: eq, fn: eq_2147483648_int64}, -+ {idx: 28, exp: ne, fn: ne_2147483648_int64}, -+ {idx: 29, exp: lt, fn: lt_4278190080_int64}, -+ {idx: 29, exp: le, fn: le_4278190080_int64}, -+ {idx: 29, exp: gt, fn: gt_4278190080_int64}, -+ {idx: 29, exp: ge, fn: ge_4278190080_int64}, -+ {idx: 29, exp: eq, fn: eq_4278190080_int64}, -+ {idx: 29, exp: ne, fn: ne_4278190080_int64}, -+ {idx: 30, exp: lt, fn: lt_4294967294_int64}, -+ {idx: 30, exp: le, fn: le_4294967294_int64}, -+ {idx: 30, exp: gt, fn: gt_4294967294_int64}, -+ {idx: 30, exp: ge, fn: ge_4294967294_int64}, -+ {idx: 30, exp: eq, fn: eq_4294967294_int64}, -+ {idx: 30, exp: ne, fn: ne_4294967294_int64}, -+ {idx: 31, exp: lt, fn: lt_4294967295_int64}, -+ {idx: 31, exp: le, fn: le_4294967295_int64}, -+ {idx: 31, exp: gt, fn: gt_4294967295_int64}, -+ {idx: 31, exp: ge, fn: ge_4294967295_int64}, -+ {idx: 31, exp: eq, fn: eq_4294967295_int64}, -+ {idx: 31, exp: ne, fn: ne_4294967295_int64}, -+ {idx: 32, exp: lt, fn: lt_4294967296_int64}, -+ {idx: 32, exp: le, fn: le_4294967296_int64}, -+ {idx: 32, exp: gt, fn: gt_4294967296_int64}, -+ {idx: 32, exp: ge, fn: ge_4294967296_int64}, -+ {idx: 32, exp: eq, fn: eq_4294967296_int64}, -+ {idx: 32, exp: ne, fn: ne_4294967296_int64}, -+ {idx: 33, exp: lt, fn: lt_1095216660480_int64}, -+ {idx: 33, exp: le, fn: le_1095216660480_int64}, -+ {idx: 33, exp: gt, fn: gt_1095216660480_int64}, -+ {idx: 33, exp: ge, fn: ge_1095216660480_int64}, -+ {idx: 33, exp: eq, fn: eq_1095216660480_int64}, -+ {idx: 33, exp: ne, fn: ne_1095216660480_int64}, -+ {idx: 34, exp: lt, fn: lt_9223372036854775806_int64}, -+ {idx: 34, exp: le, fn: le_9223372036854775806_int64}, -+ {idx: 34, exp: gt, fn: gt_9223372036854775806_int64}, -+ {idx: 34, exp: ge, fn: ge_9223372036854775806_int64}, -+ {idx: 34, exp: eq, fn: eq_9223372036854775806_int64}, -+ {idx: 34, exp: ne, fn: ne_9223372036854775806_int64}, -+ {idx: 35, exp: lt, fn: lt_9223372036854775807_int64}, -+ {idx: 35, exp: le, fn: le_9223372036854775807_int64}, -+ {idx: 35, exp: gt, fn: gt_9223372036854775807_int64}, -+ {idx: 35, exp: ge, fn: ge_9223372036854775807_int64}, -+ {idx: 35, exp: eq, fn: eq_9223372036854775807_int64}, -+ {idx: 35, exp: ne, fn: ne_9223372036854775807_int64}, -+} -+ -+// int32 tests -+var int32_vals = []int32{ -+ -2147483648, -+ -2147483647, -+ -32769, -+ -32768, -+ -32767, -+ -129, -+ -128, -+ -127, -+ -1, -+ 0, -+ 1, -+ 126, -+ 127, -+ 128, -+ 254, -+ 255, -+ 256, -+ 32766, -+ 32767, -+ 32768, -+ 65534, -+ 65535, -+ 65536, -+ 2147483646, -+ 2147483647, -+} -+ -+func lt_neg2147483648_int32(x int32) bool { return x < -2147483648 } -+func le_neg2147483648_int32(x int32) bool { return x <= -2147483648 } -+func gt_neg2147483648_int32(x int32) bool { return x > -2147483648 } -+func ge_neg2147483648_int32(x int32) bool { return x >= -2147483648 } -+func eq_neg2147483648_int32(x int32) bool { return x == -2147483648 } -+func ne_neg2147483648_int32(x int32) bool { return x != -2147483648 } -+func lt_neg2147483647_int32(x int32) bool { return x < -2147483647 } -+func le_neg2147483647_int32(x int32) bool { return x <= -2147483647 } -+func gt_neg2147483647_int32(x int32) bool { return x > -2147483647 } -+func ge_neg2147483647_int32(x int32) bool { return x >= -2147483647 } -+func eq_neg2147483647_int32(x int32) bool { return x == -2147483647 } -+func ne_neg2147483647_int32(x int32) bool { return x != -2147483647 } -+func lt_neg32769_int32(x int32) bool { return x < -32769 } -+func le_neg32769_int32(x int32) bool { return x <= -32769 } -+func gt_neg32769_int32(x int32) bool { return x > -32769 } -+func ge_neg32769_int32(x int32) bool { return x >= -32769 } -+func eq_neg32769_int32(x int32) bool { return x == -32769 } -+func ne_neg32769_int32(x int32) bool { return x != -32769 } -+func lt_neg32768_int32(x int32) bool { return x < -32768 } -+func le_neg32768_int32(x int32) bool { return x <= -32768 } -+func gt_neg32768_int32(x int32) bool { return x > -32768 } -+func ge_neg32768_int32(x int32) bool { return x >= -32768 } -+func eq_neg32768_int32(x int32) bool { return x == -32768 } -+func ne_neg32768_int32(x int32) bool { return x != -32768 } -+func lt_neg32767_int32(x int32) bool { return x < -32767 } -+func le_neg32767_int32(x int32) bool { return x <= -32767 } -+func gt_neg32767_int32(x int32) bool { return x > -32767 } -+func ge_neg32767_int32(x int32) bool { return x >= -32767 } -+func eq_neg32767_int32(x int32) bool { return x == -32767 } -+func ne_neg32767_int32(x int32) bool { return x != -32767 } -+func lt_neg129_int32(x int32) bool { return x < -129 } -+func le_neg129_int32(x int32) bool { return x <= -129 } -+func gt_neg129_int32(x int32) bool { return x > -129 } -+func ge_neg129_int32(x int32) bool { return x >= -129 } -+func eq_neg129_int32(x int32) bool { return x == -129 } -+func ne_neg129_int32(x int32) bool { return x != -129 } -+func lt_neg128_int32(x int32) bool { return x < -128 } -+func le_neg128_int32(x int32) bool { return x <= -128 } -+func gt_neg128_int32(x int32) bool { return x > -128 } -+func ge_neg128_int32(x int32) bool { return x >= -128 } -+func eq_neg128_int32(x int32) bool { return x == -128 } -+func ne_neg128_int32(x int32) bool { return x != -128 } -+func lt_neg127_int32(x int32) bool { return x < -127 } -+func le_neg127_int32(x int32) bool { return x <= -127 } -+func gt_neg127_int32(x int32) bool { return x > -127 } -+func ge_neg127_int32(x int32) bool { return x >= -127 } -+func eq_neg127_int32(x int32) bool { return x == -127 } -+func ne_neg127_int32(x int32) bool { return x != -127 } -+func lt_neg1_int32(x int32) bool { return x < -1 } -+func le_neg1_int32(x int32) bool { return x <= -1 } -+func gt_neg1_int32(x int32) bool { return x > -1 } -+func ge_neg1_int32(x int32) bool { return x >= -1 } -+func eq_neg1_int32(x int32) bool { return x == -1 } -+func ne_neg1_int32(x int32) bool { return x != -1 } -+func lt_0_int32(x int32) bool { return x < 0 } -+func le_0_int32(x int32) bool { return x <= 0 } -+func gt_0_int32(x int32) bool { return x > 0 } -+func ge_0_int32(x int32) bool { return x >= 0 } -+func eq_0_int32(x int32) bool { return x == 0 } -+func ne_0_int32(x int32) bool { return x != 0 } -+func lt_1_int32(x int32) bool { return x < 1 } -+func le_1_int32(x int32) bool { return x <= 1 } -+func gt_1_int32(x int32) bool { return x > 1 } -+func ge_1_int32(x int32) bool { return x >= 1 } -+func eq_1_int32(x int32) bool { return x == 1 } -+func ne_1_int32(x int32) bool { return x != 1 } -+func lt_126_int32(x int32) bool { return x < 126 } -+func le_126_int32(x int32) bool { return x <= 126 } -+func gt_126_int32(x int32) bool { return x > 126 } -+func ge_126_int32(x int32) bool { return x >= 126 } -+func eq_126_int32(x int32) bool { return x == 126 } -+func ne_126_int32(x int32) bool { return x != 126 } -+func lt_127_int32(x int32) bool { return x < 127 } -+func le_127_int32(x int32) bool { return x <= 127 } -+func gt_127_int32(x int32) bool { return x > 127 } -+func ge_127_int32(x int32) bool { return x >= 127 } -+func eq_127_int32(x int32) bool { return x == 127 } -+func ne_127_int32(x int32) bool { return x != 127 } -+func lt_128_int32(x int32) bool { return x < 128 } -+func le_128_int32(x int32) bool { return x <= 128 } -+func gt_128_int32(x int32) bool { return x > 128 } -+func ge_128_int32(x int32) bool { return x >= 128 } -+func eq_128_int32(x int32) bool { return x == 128 } -+func ne_128_int32(x int32) bool { return x != 128 } -+func lt_254_int32(x int32) bool { return x < 254 } -+func le_254_int32(x int32) bool { return x <= 254 } -+func gt_254_int32(x int32) bool { return x > 254 } -+func ge_254_int32(x int32) bool { return x >= 254 } -+func eq_254_int32(x int32) bool { return x == 254 } -+func ne_254_int32(x int32) bool { return x != 254 } -+func lt_255_int32(x int32) bool { return x < 255 } -+func le_255_int32(x int32) bool { return x <= 255 } -+func gt_255_int32(x int32) bool { return x > 255 } -+func ge_255_int32(x int32) bool { return x >= 255 } -+func eq_255_int32(x int32) bool { return x == 255 } -+func ne_255_int32(x int32) bool { return x != 255 } -+func lt_256_int32(x int32) bool { return x < 256 } -+func le_256_int32(x int32) bool { return x <= 256 } -+func gt_256_int32(x int32) bool { return x > 256 } -+func ge_256_int32(x int32) bool { return x >= 256 } -+func eq_256_int32(x int32) bool { return x == 256 } -+func ne_256_int32(x int32) bool { return x != 256 } -+func lt_32766_int32(x int32) bool { return x < 32766 } -+func le_32766_int32(x int32) bool { return x <= 32766 } -+func gt_32766_int32(x int32) bool { return x > 32766 } -+func ge_32766_int32(x int32) bool { return x >= 32766 } -+func eq_32766_int32(x int32) bool { return x == 32766 } -+func ne_32766_int32(x int32) bool { return x != 32766 } -+func lt_32767_int32(x int32) bool { return x < 32767 } -+func le_32767_int32(x int32) bool { return x <= 32767 } -+func gt_32767_int32(x int32) bool { return x > 32767 } -+func ge_32767_int32(x int32) bool { return x >= 32767 } -+func eq_32767_int32(x int32) bool { return x == 32767 } -+func ne_32767_int32(x int32) bool { return x != 32767 } -+func lt_32768_int32(x int32) bool { return x < 32768 } -+func le_32768_int32(x int32) bool { return x <= 32768 } -+func gt_32768_int32(x int32) bool { return x > 32768 } -+func ge_32768_int32(x int32) bool { return x >= 32768 } -+func eq_32768_int32(x int32) bool { return x == 32768 } -+func ne_32768_int32(x int32) bool { return x != 32768 } -+func lt_65534_int32(x int32) bool { return x < 65534 } -+func le_65534_int32(x int32) bool { return x <= 65534 } -+func gt_65534_int32(x int32) bool { return x > 65534 } -+func ge_65534_int32(x int32) bool { return x >= 65534 } -+func eq_65534_int32(x int32) bool { return x == 65534 } -+func ne_65534_int32(x int32) bool { return x != 65534 } -+func lt_65535_int32(x int32) bool { return x < 65535 } -+func le_65535_int32(x int32) bool { return x <= 65535 } -+func gt_65535_int32(x int32) bool { return x > 65535 } -+func ge_65535_int32(x int32) bool { return x >= 65535 } -+func eq_65535_int32(x int32) bool { return x == 65535 } -+func ne_65535_int32(x int32) bool { return x != 65535 } -+func lt_65536_int32(x int32) bool { return x < 65536 } -+func le_65536_int32(x int32) bool { return x <= 65536 } -+func gt_65536_int32(x int32) bool { return x > 65536 } -+func ge_65536_int32(x int32) bool { return x >= 65536 } -+func eq_65536_int32(x int32) bool { return x == 65536 } -+func ne_65536_int32(x int32) bool { return x != 65536 } -+func lt_2147483646_int32(x int32) bool { return x < 2147483646 } -+func le_2147483646_int32(x int32) bool { return x <= 2147483646 } -+func gt_2147483646_int32(x int32) bool { return x > 2147483646 } -+func ge_2147483646_int32(x int32) bool { return x >= 2147483646 } -+func eq_2147483646_int32(x int32) bool { return x == 2147483646 } -+func ne_2147483646_int32(x int32) bool { return x != 2147483646 } -+func lt_2147483647_int32(x int32) bool { return x < 2147483647 } -+func le_2147483647_int32(x int32) bool { return x <= 2147483647 } -+func gt_2147483647_int32(x int32) bool { return x > 2147483647 } -+func ge_2147483647_int32(x int32) bool { return x >= 2147483647 } -+func eq_2147483647_int32(x int32) bool { return x == 2147483647 } -+func ne_2147483647_int32(x int32) bool { return x != 2147483647 } -+ -+var int32_tests = []struct { -+ idx int // index of the constant used -+ exp result // expected results -+ fn func(int32) bool -+}{ -+ {idx: 0, exp: lt, fn: lt_neg2147483648_int32}, -+ {idx: 0, exp: le, fn: le_neg2147483648_int32}, -+ {idx: 0, exp: gt, fn: gt_neg2147483648_int32}, -+ {idx: 0, exp: ge, fn: ge_neg2147483648_int32}, -+ {idx: 0, exp: eq, fn: eq_neg2147483648_int32}, -+ {idx: 0, exp: ne, fn: ne_neg2147483648_int32}, -+ {idx: 1, exp: lt, fn: lt_neg2147483647_int32}, -+ {idx: 1, exp: le, fn: le_neg2147483647_int32}, -+ {idx: 1, exp: gt, fn: gt_neg2147483647_int32}, -+ {idx: 1, exp: ge, fn: ge_neg2147483647_int32}, -+ {idx: 1, exp: eq, fn: eq_neg2147483647_int32}, -+ {idx: 1, exp: ne, fn: ne_neg2147483647_int32}, -+ {idx: 2, exp: lt, fn: lt_neg32769_int32}, -+ {idx: 2, exp: le, fn: le_neg32769_int32}, -+ {idx: 2, exp: gt, fn: gt_neg32769_int32}, -+ {idx: 2, exp: ge, fn: ge_neg32769_int32}, -+ {idx: 2, exp: eq, fn: eq_neg32769_int32}, -+ {idx: 2, exp: ne, fn: ne_neg32769_int32}, -+ {idx: 3, exp: lt, fn: lt_neg32768_int32}, -+ {idx: 3, exp: le, fn: le_neg32768_int32}, -+ {idx: 3, exp: gt, fn: gt_neg32768_int32}, -+ {idx: 3, exp: ge, fn: ge_neg32768_int32}, -+ {idx: 3, exp: eq, fn: eq_neg32768_int32}, -+ {idx: 3, exp: ne, fn: ne_neg32768_int32}, -+ {idx: 4, exp: lt, fn: lt_neg32767_int32}, -+ {idx: 4, exp: le, fn: le_neg32767_int32}, -+ {idx: 4, exp: gt, fn: gt_neg32767_int32}, -+ {idx: 4, exp: ge, fn: ge_neg32767_int32}, -+ {idx: 4, exp: eq, fn: eq_neg32767_int32}, -+ {idx: 4, exp: ne, fn: ne_neg32767_int32}, -+ {idx: 5, exp: lt, fn: lt_neg129_int32}, -+ {idx: 5, exp: le, fn: le_neg129_int32}, -+ {idx: 5, exp: gt, fn: gt_neg129_int32}, -+ {idx: 5, exp: ge, fn: ge_neg129_int32}, -+ {idx: 5, exp: eq, fn: eq_neg129_int32}, -+ {idx: 5, exp: ne, fn: ne_neg129_int32}, -+ {idx: 6, exp: lt, fn: lt_neg128_int32}, -+ {idx: 6, exp: le, fn: le_neg128_int32}, -+ {idx: 6, exp: gt, fn: gt_neg128_int32}, -+ {idx: 6, exp: ge, fn: ge_neg128_int32}, -+ {idx: 6, exp: eq, fn: eq_neg128_int32}, -+ {idx: 6, exp: ne, fn: ne_neg128_int32}, -+ {idx: 7, exp: lt, fn: lt_neg127_int32}, -+ {idx: 7, exp: le, fn: le_neg127_int32}, -+ {idx: 7, exp: gt, fn: gt_neg127_int32}, -+ {idx: 7, exp: ge, fn: ge_neg127_int32}, -+ {idx: 7, exp: eq, fn: eq_neg127_int32}, -+ {idx: 7, exp: ne, fn: ne_neg127_int32}, -+ {idx: 8, exp: lt, fn: lt_neg1_int32}, -+ {idx: 8, exp: le, fn: le_neg1_int32}, -+ {idx: 8, exp: gt, fn: gt_neg1_int32}, -+ {idx: 8, exp: ge, fn: ge_neg1_int32}, -+ {idx: 8, exp: eq, fn: eq_neg1_int32}, -+ {idx: 8, exp: ne, fn: ne_neg1_int32}, -+ {idx: 9, exp: lt, fn: lt_0_int32}, -+ {idx: 9, exp: le, fn: le_0_int32}, -+ {idx: 9, exp: gt, fn: gt_0_int32}, -+ {idx: 9, exp: ge, fn: ge_0_int32}, -+ {idx: 9, exp: eq, fn: eq_0_int32}, -+ {idx: 9, exp: ne, fn: ne_0_int32}, -+ {idx: 10, exp: lt, fn: lt_1_int32}, -+ {idx: 10, exp: le, fn: le_1_int32}, -+ {idx: 10, exp: gt, fn: gt_1_int32}, -+ {idx: 10, exp: ge, fn: ge_1_int32}, -+ {idx: 10, exp: eq, fn: eq_1_int32}, -+ {idx: 10, exp: ne, fn: ne_1_int32}, -+ {idx: 11, exp: lt, fn: lt_126_int32}, -+ {idx: 11, exp: le, fn: le_126_int32}, -+ {idx: 11, exp: gt, fn: gt_126_int32}, -+ {idx: 11, exp: ge, fn: ge_126_int32}, -+ {idx: 11, exp: eq, fn: eq_126_int32}, -+ {idx: 11, exp: ne, fn: ne_126_int32}, -+ {idx: 12, exp: lt, fn: lt_127_int32}, -+ {idx: 12, exp: le, fn: le_127_int32}, -+ {idx: 12, exp: gt, fn: gt_127_int32}, -+ {idx: 12, exp: ge, fn: ge_127_int32}, -+ {idx: 12, exp: eq, fn: eq_127_int32}, -+ {idx: 12, exp: ne, fn: ne_127_int32}, -+ {idx: 13, exp: lt, fn: lt_128_int32}, -+ {idx: 13, exp: le, fn: le_128_int32}, -+ {idx: 13, exp: gt, fn: gt_128_int32}, -+ {idx: 13, exp: ge, fn: ge_128_int32}, -+ {idx: 13, exp: eq, fn: eq_128_int32}, -+ {idx: 13, exp: ne, fn: ne_128_int32}, -+ {idx: 14, exp: lt, fn: lt_254_int32}, -+ {idx: 14, exp: le, fn: le_254_int32}, -+ {idx: 14, exp: gt, fn: gt_254_int32}, -+ {idx: 14, exp: ge, fn: ge_254_int32}, -+ {idx: 14, exp: eq, fn: eq_254_int32}, -+ {idx: 14, exp: ne, fn: ne_254_int32}, -+ {idx: 15, exp: lt, fn: lt_255_int32}, -+ {idx: 15, exp: le, fn: le_255_int32}, -+ {idx: 15, exp: gt, fn: gt_255_int32}, -+ {idx: 15, exp: ge, fn: ge_255_int32}, -+ {idx: 15, exp: eq, fn: eq_255_int32}, -+ {idx: 15, exp: ne, fn: ne_255_int32}, -+ {idx: 16, exp: lt, fn: lt_256_int32}, -+ {idx: 16, exp: le, fn: le_256_int32}, -+ {idx: 16, exp: gt, fn: gt_256_int32}, -+ {idx: 16, exp: ge, fn: ge_256_int32}, -+ {idx: 16, exp: eq, fn: eq_256_int32}, -+ {idx: 16, exp: ne, fn: ne_256_int32}, -+ {idx: 17, exp: lt, fn: lt_32766_int32}, -+ {idx: 17, exp: le, fn: le_32766_int32}, -+ {idx: 17, exp: gt, fn: gt_32766_int32}, -+ {idx: 17, exp: ge, fn: ge_32766_int32}, -+ {idx: 17, exp: eq, fn: eq_32766_int32}, -+ {idx: 17, exp: ne, fn: ne_32766_int32}, -+ {idx: 18, exp: lt, fn: lt_32767_int32}, -+ {idx: 18, exp: le, fn: le_32767_int32}, -+ {idx: 18, exp: gt, fn: gt_32767_int32}, -+ {idx: 18, exp: ge, fn: ge_32767_int32}, -+ {idx: 18, exp: eq, fn: eq_32767_int32}, -+ {idx: 18, exp: ne, fn: ne_32767_int32}, -+ {idx: 19, exp: lt, fn: lt_32768_int32}, -+ {idx: 19, exp: le, fn: le_32768_int32}, -+ {idx: 19, exp: gt, fn: gt_32768_int32}, -+ {idx: 19, exp: ge, fn: ge_32768_int32}, -+ {idx: 19, exp: eq, fn: eq_32768_int32}, -+ {idx: 19, exp: ne, fn: ne_32768_int32}, -+ {idx: 20, exp: lt, fn: lt_65534_int32}, -+ {idx: 20, exp: le, fn: le_65534_int32}, -+ {idx: 20, exp: gt, fn: gt_65534_int32}, -+ {idx: 20, exp: ge, fn: ge_65534_int32}, -+ {idx: 20, exp: eq, fn: eq_65534_int32}, -+ {idx: 20, exp: ne, fn: ne_65534_int32}, -+ {idx: 21, exp: lt, fn: lt_65535_int32}, -+ {idx: 21, exp: le, fn: le_65535_int32}, -+ {idx: 21, exp: gt, fn: gt_65535_int32}, -+ {idx: 21, exp: ge, fn: ge_65535_int32}, -+ {idx: 21, exp: eq, fn: eq_65535_int32}, -+ {idx: 21, exp: ne, fn: ne_65535_int32}, -+ {idx: 22, exp: lt, fn: lt_65536_int32}, -+ {idx: 22, exp: le, fn: le_65536_int32}, -+ {idx: 22, exp: gt, fn: gt_65536_int32}, -+ {idx: 22, exp: ge, fn: ge_65536_int32}, -+ {idx: 22, exp: eq, fn: eq_65536_int32}, -+ {idx: 22, exp: ne, fn: ne_65536_int32}, -+ {idx: 23, exp: lt, fn: lt_2147483646_int32}, -+ {idx: 23, exp: le, fn: le_2147483646_int32}, -+ {idx: 23, exp: gt, fn: gt_2147483646_int32}, -+ {idx: 23, exp: ge, fn: ge_2147483646_int32}, -+ {idx: 23, exp: eq, fn: eq_2147483646_int32}, -+ {idx: 23, exp: ne, fn: ne_2147483646_int32}, -+ {idx: 24, exp: lt, fn: lt_2147483647_int32}, -+ {idx: 24, exp: le, fn: le_2147483647_int32}, -+ {idx: 24, exp: gt, fn: gt_2147483647_int32}, -+ {idx: 24, exp: ge, fn: ge_2147483647_int32}, -+ {idx: 24, exp: eq, fn: eq_2147483647_int32}, -+ {idx: 24, exp: ne, fn: ne_2147483647_int32}, -+} -+ -+// int16 tests -+var int16_vals = []int16{ -+ -32768, -+ -32767, -+ -129, -+ -128, -+ -127, -+ -1, -+ 0, -+ 1, -+ 126, -+ 127, -+ 128, -+ 254, -+ 255, -+ 256, -+ 32766, -+ 32767, -+} -+ -+func lt_neg32768_int16(x int16) bool { return x < -32768 } -+func le_neg32768_int16(x int16) bool { return x <= -32768 } -+func gt_neg32768_int16(x int16) bool { return x > -32768 } -+func ge_neg32768_int16(x int16) bool { return x >= -32768 } -+func eq_neg32768_int16(x int16) bool { return x == -32768 } -+func ne_neg32768_int16(x int16) bool { return x != -32768 } -+func lt_neg32767_int16(x int16) bool { return x < -32767 } -+func le_neg32767_int16(x int16) bool { return x <= -32767 } -+func gt_neg32767_int16(x int16) bool { return x > -32767 } -+func ge_neg32767_int16(x int16) bool { return x >= -32767 } -+func eq_neg32767_int16(x int16) bool { return x == -32767 } -+func ne_neg32767_int16(x int16) bool { return x != -32767 } -+func lt_neg129_int16(x int16) bool { return x < -129 } -+func le_neg129_int16(x int16) bool { return x <= -129 } -+func gt_neg129_int16(x int16) bool { return x > -129 } -+func ge_neg129_int16(x int16) bool { return x >= -129 } -+func eq_neg129_int16(x int16) bool { return x == -129 } -+func ne_neg129_int16(x int16) bool { return x != -129 } -+func lt_neg128_int16(x int16) bool { return x < -128 } -+func le_neg128_int16(x int16) bool { return x <= -128 } -+func gt_neg128_int16(x int16) bool { return x > -128 } -+func ge_neg128_int16(x int16) bool { return x >= -128 } -+func eq_neg128_int16(x int16) bool { return x == -128 } -+func ne_neg128_int16(x int16) bool { return x != -128 } -+func lt_neg127_int16(x int16) bool { return x < -127 } -+func le_neg127_int16(x int16) bool { return x <= -127 } -+func gt_neg127_int16(x int16) bool { return x > -127 } -+func ge_neg127_int16(x int16) bool { return x >= -127 } -+func eq_neg127_int16(x int16) bool { return x == -127 } -+func ne_neg127_int16(x int16) bool { return x != -127 } -+func lt_neg1_int16(x int16) bool { return x < -1 } -+func le_neg1_int16(x int16) bool { return x <= -1 } -+func gt_neg1_int16(x int16) bool { return x > -1 } -+func ge_neg1_int16(x int16) bool { return x >= -1 } -+func eq_neg1_int16(x int16) bool { return x == -1 } -+func ne_neg1_int16(x int16) bool { return x != -1 } -+func lt_0_int16(x int16) bool { return x < 0 } -+func le_0_int16(x int16) bool { return x <= 0 } -+func gt_0_int16(x int16) bool { return x > 0 } -+func ge_0_int16(x int16) bool { return x >= 0 } -+func eq_0_int16(x int16) bool { return x == 0 } -+func ne_0_int16(x int16) bool { return x != 0 } -+func lt_1_int16(x int16) bool { return x < 1 } -+func le_1_int16(x int16) bool { return x <= 1 } -+func gt_1_int16(x int16) bool { return x > 1 } -+func ge_1_int16(x int16) bool { return x >= 1 } -+func eq_1_int16(x int16) bool { return x == 1 } -+func ne_1_int16(x int16) bool { return x != 1 } -+func lt_126_int16(x int16) bool { return x < 126 } -+func le_126_int16(x int16) bool { return x <= 126 } -+func gt_126_int16(x int16) bool { return x > 126 } -+func ge_126_int16(x int16) bool { return x >= 126 } -+func eq_126_int16(x int16) bool { return x == 126 } -+func ne_126_int16(x int16) bool { return x != 126 } -+func lt_127_int16(x int16) bool { return x < 127 } -+func le_127_int16(x int16) bool { return x <= 127 } -+func gt_127_int16(x int16) bool { return x > 127 } -+func ge_127_int16(x int16) bool { return x >= 127 } -+func eq_127_int16(x int16) bool { return x == 127 } -+func ne_127_int16(x int16) bool { return x != 127 } -+func lt_128_int16(x int16) bool { return x < 128 } -+func le_128_int16(x int16) bool { return x <= 128 } -+func gt_128_int16(x int16) bool { return x > 128 } -+func ge_128_int16(x int16) bool { return x >= 128 } -+func eq_128_int16(x int16) bool { return x == 128 } -+func ne_128_int16(x int16) bool { return x != 128 } -+func lt_254_int16(x int16) bool { return x < 254 } -+func le_254_int16(x int16) bool { return x <= 254 } -+func gt_254_int16(x int16) bool { return x > 254 } -+func ge_254_int16(x int16) bool { return x >= 254 } -+func eq_254_int16(x int16) bool { return x == 254 } -+func ne_254_int16(x int16) bool { return x != 254 } -+func lt_255_int16(x int16) bool { return x < 255 } -+func le_255_int16(x int16) bool { return x <= 255 } -+func gt_255_int16(x int16) bool { return x > 255 } -+func ge_255_int16(x int16) bool { return x >= 255 } -+func eq_255_int16(x int16) bool { return x == 255 } -+func ne_255_int16(x int16) bool { return x != 255 } -+func lt_256_int16(x int16) bool { return x < 256 } -+func le_256_int16(x int16) bool { return x <= 256 } -+func gt_256_int16(x int16) bool { return x > 256 } -+func ge_256_int16(x int16) bool { return x >= 256 } -+func eq_256_int16(x int16) bool { return x == 256 } -+func ne_256_int16(x int16) bool { return x != 256 } -+func lt_32766_int16(x int16) bool { return x < 32766 } -+func le_32766_int16(x int16) bool { return x <= 32766 } -+func gt_32766_int16(x int16) bool { return x > 32766 } -+func ge_32766_int16(x int16) bool { return x >= 32766 } -+func eq_32766_int16(x int16) bool { return x == 32766 } -+func ne_32766_int16(x int16) bool { return x != 32766 } -+func lt_32767_int16(x int16) bool { return x < 32767 } -+func le_32767_int16(x int16) bool { return x <= 32767 } -+func gt_32767_int16(x int16) bool { return x > 32767 } -+func ge_32767_int16(x int16) bool { return x >= 32767 } -+func eq_32767_int16(x int16) bool { return x == 32767 } -+func ne_32767_int16(x int16) bool { return x != 32767 } -+ -+var int16_tests = []struct { -+ idx int // index of the constant used -+ exp result // expected results -+ fn func(int16) bool -+}{ -+ {idx: 0, exp: lt, fn: lt_neg32768_int16}, -+ {idx: 0, exp: le, fn: le_neg32768_int16}, -+ {idx: 0, exp: gt, fn: gt_neg32768_int16}, -+ {idx: 0, exp: ge, fn: ge_neg32768_int16}, -+ {idx: 0, exp: eq, fn: eq_neg32768_int16}, -+ {idx: 0, exp: ne, fn: ne_neg32768_int16}, -+ {idx: 1, exp: lt, fn: lt_neg32767_int16}, -+ {idx: 1, exp: le, fn: le_neg32767_int16}, -+ {idx: 1, exp: gt, fn: gt_neg32767_int16}, -+ {idx: 1, exp: ge, fn: ge_neg32767_int16}, -+ {idx: 1, exp: eq, fn: eq_neg32767_int16}, -+ {idx: 1, exp: ne, fn: ne_neg32767_int16}, -+ {idx: 2, exp: lt, fn: lt_neg129_int16}, -+ {idx: 2, exp: le, fn: le_neg129_int16}, -+ {idx: 2, exp: gt, fn: gt_neg129_int16}, -+ {idx: 2, exp: ge, fn: ge_neg129_int16}, -+ {idx: 2, exp: eq, fn: eq_neg129_int16}, -+ {idx: 2, exp: ne, fn: ne_neg129_int16}, -+ {idx: 3, exp: lt, fn: lt_neg128_int16}, -+ {idx: 3, exp: le, fn: le_neg128_int16}, -+ {idx: 3, exp: gt, fn: gt_neg128_int16}, -+ {idx: 3, exp: ge, fn: ge_neg128_int16}, -+ {idx: 3, exp: eq, fn: eq_neg128_int16}, -+ {idx: 3, exp: ne, fn: ne_neg128_int16}, -+ {idx: 4, exp: lt, fn: lt_neg127_int16}, -+ {idx: 4, exp: le, fn: le_neg127_int16}, -+ {idx: 4, exp: gt, fn: gt_neg127_int16}, -+ {idx: 4, exp: ge, fn: ge_neg127_int16}, -+ {idx: 4, exp: eq, fn: eq_neg127_int16}, -+ {idx: 4, exp: ne, fn: ne_neg127_int16}, -+ {idx: 5, exp: lt, fn: lt_neg1_int16}, -+ {idx: 5, exp: le, fn: le_neg1_int16}, -+ {idx: 5, exp: gt, fn: gt_neg1_int16}, -+ {idx: 5, exp: ge, fn: ge_neg1_int16}, -+ {idx: 5, exp: eq, fn: eq_neg1_int16}, -+ {idx: 5, exp: ne, fn: ne_neg1_int16}, -+ {idx: 6, exp: lt, fn: lt_0_int16}, -+ {idx: 6, exp: le, fn: le_0_int16}, -+ {idx: 6, exp: gt, fn: gt_0_int16}, -+ {idx: 6, exp: ge, fn: ge_0_int16}, -+ {idx: 6, exp: eq, fn: eq_0_int16}, -+ {idx: 6, exp: ne, fn: ne_0_int16}, -+ {idx: 7, exp: lt, fn: lt_1_int16}, -+ {idx: 7, exp: le, fn: le_1_int16}, -+ {idx: 7, exp: gt, fn: gt_1_int16}, -+ {idx: 7, exp: ge, fn: ge_1_int16}, -+ {idx: 7, exp: eq, fn: eq_1_int16}, -+ {idx: 7, exp: ne, fn: ne_1_int16}, -+ {idx: 8, exp: lt, fn: lt_126_int16}, -+ {idx: 8, exp: le, fn: le_126_int16}, -+ {idx: 8, exp: gt, fn: gt_126_int16}, -+ {idx: 8, exp: ge, fn: ge_126_int16}, -+ {idx: 8, exp: eq, fn: eq_126_int16}, -+ {idx: 8, exp: ne, fn: ne_126_int16}, -+ {idx: 9, exp: lt, fn: lt_127_int16}, -+ {idx: 9, exp: le, fn: le_127_int16}, -+ {idx: 9, exp: gt, fn: gt_127_int16}, -+ {idx: 9, exp: ge, fn: ge_127_int16}, -+ {idx: 9, exp: eq, fn: eq_127_int16}, -+ {idx: 9, exp: ne, fn: ne_127_int16}, -+ {idx: 10, exp: lt, fn: lt_128_int16}, -+ {idx: 10, exp: le, fn: le_128_int16}, -+ {idx: 10, exp: gt, fn: gt_128_int16}, -+ {idx: 10, exp: ge, fn: ge_128_int16}, -+ {idx: 10, exp: eq, fn: eq_128_int16}, -+ {idx: 10, exp: ne, fn: ne_128_int16}, -+ {idx: 11, exp: lt, fn: lt_254_int16}, -+ {idx: 11, exp: le, fn: le_254_int16}, -+ {idx: 11, exp: gt, fn: gt_254_int16}, -+ {idx: 11, exp: ge, fn: ge_254_int16}, -+ {idx: 11, exp: eq, fn: eq_254_int16}, -+ {idx: 11, exp: ne, fn: ne_254_int16}, -+ {idx: 12, exp: lt, fn: lt_255_int16}, -+ {idx: 12, exp: le, fn: le_255_int16}, -+ {idx: 12, exp: gt, fn: gt_255_int16}, -+ {idx: 12, exp: ge, fn: ge_255_int16}, -+ {idx: 12, exp: eq, fn: eq_255_int16}, -+ {idx: 12, exp: ne, fn: ne_255_int16}, -+ {idx: 13, exp: lt, fn: lt_256_int16}, -+ {idx: 13, exp: le, fn: le_256_int16}, -+ {idx: 13, exp: gt, fn: gt_256_int16}, -+ {idx: 13, exp: ge, fn: ge_256_int16}, -+ {idx: 13, exp: eq, fn: eq_256_int16}, -+ {idx: 13, exp: ne, fn: ne_256_int16}, -+ {idx: 14, exp: lt, fn: lt_32766_int16}, -+ {idx: 14, exp: le, fn: le_32766_int16}, -+ {idx: 14, exp: gt, fn: gt_32766_int16}, -+ {idx: 14, exp: ge, fn: ge_32766_int16}, -+ {idx: 14, exp: eq, fn: eq_32766_int16}, -+ {idx: 14, exp: ne, fn: ne_32766_int16}, -+ {idx: 15, exp: lt, fn: lt_32767_int16}, -+ {idx: 15, exp: le, fn: le_32767_int16}, -+ {idx: 15, exp: gt, fn: gt_32767_int16}, -+ {idx: 15, exp: ge, fn: ge_32767_int16}, -+ {idx: 15, exp: eq, fn: eq_32767_int16}, -+ {idx: 15, exp: ne, fn: ne_32767_int16}, -+} -+ -+// int8 tests -+var int8_vals = []int8{ -+ -128, -+ -127, -+ -1, -+ 0, -+ 1, -+ 126, -+ 127, -+} -+ -+func lt_neg128_int8(x int8) bool { return x < -128 } -+func le_neg128_int8(x int8) bool { return x <= -128 } -+func gt_neg128_int8(x int8) bool { return x > -128 } -+func ge_neg128_int8(x int8) bool { return x >= -128 } -+func eq_neg128_int8(x int8) bool { return x == -128 } -+func ne_neg128_int8(x int8) bool { return x != -128 } -+func lt_neg127_int8(x int8) bool { return x < -127 } -+func le_neg127_int8(x int8) bool { return x <= -127 } -+func gt_neg127_int8(x int8) bool { return x > -127 } -+func ge_neg127_int8(x int8) bool { return x >= -127 } -+func eq_neg127_int8(x int8) bool { return x == -127 } -+func ne_neg127_int8(x int8) bool { return x != -127 } -+func lt_neg1_int8(x int8) bool { return x < -1 } -+func le_neg1_int8(x int8) bool { return x <= -1 } -+func gt_neg1_int8(x int8) bool { return x > -1 } -+func ge_neg1_int8(x int8) bool { return x >= -1 } -+func eq_neg1_int8(x int8) bool { return x == -1 } -+func ne_neg1_int8(x int8) bool { return x != -1 } -+func lt_0_int8(x int8) bool { return x < 0 } -+func le_0_int8(x int8) bool { return x <= 0 } -+func gt_0_int8(x int8) bool { return x > 0 } -+func ge_0_int8(x int8) bool { return x >= 0 } -+func eq_0_int8(x int8) bool { return x == 0 } -+func ne_0_int8(x int8) bool { return x != 0 } -+func lt_1_int8(x int8) bool { return x < 1 } -+func le_1_int8(x int8) bool { return x <= 1 } -+func gt_1_int8(x int8) bool { return x > 1 } -+func ge_1_int8(x int8) bool { return x >= 1 } -+func eq_1_int8(x int8) bool { return x == 1 } -+func ne_1_int8(x int8) bool { return x != 1 } -+func lt_126_int8(x int8) bool { return x < 126 } -+func le_126_int8(x int8) bool { return x <= 126 } -+func gt_126_int8(x int8) bool { return x > 126 } -+func ge_126_int8(x int8) bool { return x >= 126 } -+func eq_126_int8(x int8) bool { return x == 126 } -+func ne_126_int8(x int8) bool { return x != 126 } -+func lt_127_int8(x int8) bool { return x < 127 } -+func le_127_int8(x int8) bool { return x <= 127 } -+func gt_127_int8(x int8) bool { return x > 127 } -+func ge_127_int8(x int8) bool { return x >= 127 } -+func eq_127_int8(x int8) bool { return x == 127 } -+func ne_127_int8(x int8) bool { return x != 127 } -+ -+var int8_tests = []struct { -+ idx int // index of the constant used -+ exp result // expected results -+ fn func(int8) bool -+}{ -+ {idx: 0, exp: lt, fn: lt_neg128_int8}, -+ {idx: 0, exp: le, fn: le_neg128_int8}, -+ {idx: 0, exp: gt, fn: gt_neg128_int8}, -+ {idx: 0, exp: ge, fn: ge_neg128_int8}, -+ {idx: 0, exp: eq, fn: eq_neg128_int8}, -+ {idx: 0, exp: ne, fn: ne_neg128_int8}, -+ {idx: 1, exp: lt, fn: lt_neg127_int8}, -+ {idx: 1, exp: le, fn: le_neg127_int8}, -+ {idx: 1, exp: gt, fn: gt_neg127_int8}, -+ {idx: 1, exp: ge, fn: ge_neg127_int8}, -+ {idx: 1, exp: eq, fn: eq_neg127_int8}, -+ {idx: 1, exp: ne, fn: ne_neg127_int8}, -+ {idx: 2, exp: lt, fn: lt_neg1_int8}, -+ {idx: 2, exp: le, fn: le_neg1_int8}, -+ {idx: 2, exp: gt, fn: gt_neg1_int8}, -+ {idx: 2, exp: ge, fn: ge_neg1_int8}, -+ {idx: 2, exp: eq, fn: eq_neg1_int8}, -+ {idx: 2, exp: ne, fn: ne_neg1_int8}, -+ {idx: 3, exp: lt, fn: lt_0_int8}, -+ {idx: 3, exp: le, fn: le_0_int8}, -+ {idx: 3, exp: gt, fn: gt_0_int8}, -+ {idx: 3, exp: ge, fn: ge_0_int8}, -+ {idx: 3, exp: eq, fn: eq_0_int8}, -+ {idx: 3, exp: ne, fn: ne_0_int8}, -+ {idx: 4, exp: lt, fn: lt_1_int8}, -+ {idx: 4, exp: le, fn: le_1_int8}, -+ {idx: 4, exp: gt, fn: gt_1_int8}, -+ {idx: 4, exp: ge, fn: ge_1_int8}, -+ {idx: 4, exp: eq, fn: eq_1_int8}, -+ {idx: 4, exp: ne, fn: ne_1_int8}, -+ {idx: 5, exp: lt, fn: lt_126_int8}, -+ {idx: 5, exp: le, fn: le_126_int8}, -+ {idx: 5, exp: gt, fn: gt_126_int8}, -+ {idx: 5, exp: ge, fn: ge_126_int8}, -+ {idx: 5, exp: eq, fn: eq_126_int8}, -+ {idx: 5, exp: ne, fn: ne_126_int8}, -+ {idx: 6, exp: lt, fn: lt_127_int8}, -+ {idx: 6, exp: le, fn: le_127_int8}, -+ {idx: 6, exp: gt, fn: gt_127_int8}, -+ {idx: 6, exp: ge, fn: ge_127_int8}, -+ {idx: 6, exp: eq, fn: eq_127_int8}, -+ {idx: 6, exp: ne, fn: ne_127_int8}, -+} -+ -+func main() { -+ for i, test := range uint64_tests { -+ for j, x := range uint64_vals { -+ want := test.exp.l -+ if j == test.idx { -+ want = test.exp.e -+ } else if j > test.idx { -+ want = test.exp.r -+ } -+ if test.fn(x) != want { -+ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() -+ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=uint64 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) -+ panic(msg) -+ } -+ } -+ } -+ for i, test := range uint32_tests { -+ for j, x := range uint32_vals { -+ want := test.exp.l -+ if j == test.idx { -+ want = test.exp.e -+ } else if j > test.idx { -+ want = test.exp.r -+ } -+ if test.fn(x) != want { -+ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() -+ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=uint32 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) -+ panic(msg) -+ } -+ } -+ } -+ for i, test := range uint16_tests { -+ for j, x := range uint16_vals { -+ want := test.exp.l -+ if j == test.idx { -+ want = test.exp.e -+ } else if j > test.idx { -+ want = test.exp.r -+ } -+ if test.fn(x) != want { -+ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() -+ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=uint16 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) -+ panic(msg) -+ } -+ } -+ } -+ for i, test := range uint8_tests { -+ for j, x := range uint8_vals { -+ want := test.exp.l -+ if j == test.idx { -+ want = test.exp.e -+ } else if j > test.idx { -+ want = test.exp.r -+ } -+ if test.fn(x) != want { -+ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() -+ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=uint8 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) -+ panic(msg) -+ } -+ } -+ } -+ for i, test := range int64_tests { -+ for j, x := range int64_vals { -+ want := test.exp.l -+ if j == test.idx { -+ want = test.exp.e -+ } else if j > test.idx { -+ want = test.exp.r -+ } -+ if test.fn(x) != want { -+ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() -+ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=int64 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) -+ panic(msg) -+ } -+ } -+ } -+ for i, test := range int32_tests { -+ for j, x := range int32_vals { -+ want := test.exp.l -+ if j == test.idx { -+ want = test.exp.e -+ } else if j > test.idx { -+ want = test.exp.r -+ } -+ if test.fn(x) != want { -+ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() -+ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=int32 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) -+ panic(msg) -+ } -+ } -+ } -+ for i, test := range int16_tests { -+ for j, x := range int16_vals { -+ want := test.exp.l -+ if j == test.idx { -+ want = test.exp.e -+ } else if j > test.idx { -+ want = test.exp.r -+ } -+ if test.fn(x) != want { -+ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() -+ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=int16 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) -+ panic(msg) -+ } -+ } -+ } -+ for i, test := range int8_tests { -+ for j, x := range int8_vals { -+ want := test.exp.l -+ if j == test.idx { -+ want = test.exp.e -+ } else if j > test.idx { -+ want = test.exp.r -+ } -+ if test.fn(x) != want { -+ fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name() -+ msg := fmt.Sprintf("test failed: %v(%v) != %v [type=int8 i=%v j=%v idx=%v]", fn, x, want, i, j, test.idx) -+ panic(msg) -+ } -+ } -+ } -+} -diff --git a/src/cmd/compile/internal/gc/testdata/gen/cmpConstGen.go b/src/cmd/compile/internal/gc/testdata/gen/cmpConstGen.go -new file mode 100644 -index 0000000..defa4a9 ---- /dev/null -+++ b/src/cmd/compile/internal/gc/testdata/gen/cmpConstGen.go -@@ -0,0 +1,248 @@ -+// Copyright 2017 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. -+ -+// This program generates a test to verify that the standard comparison -+// operators properly handle one const operand. The test file should be -+// generated with a known working version of go. -+// launch with `go run cmpConstGen.go` a file called cmpConst.go -+// will be written into the parent directory containing the tests -+ -+package main -+ -+import ( -+ "bytes" -+ "fmt" -+ "go/format" -+ "io/ioutil" -+ "log" -+ "math/big" -+ "sort" -+) -+ -+const ( -+ maxU64 = (1 << 64) - 1 -+ maxU32 = (1 << 32) - 1 -+ maxU16 = (1 << 16) - 1 -+ maxU8 = (1 << 8) - 1 -+ -+ maxI64 = (1 << 63) - 1 -+ maxI32 = (1 << 31) - 1 -+ maxI16 = (1 << 15) - 1 -+ maxI8 = (1 << 7) - 1 -+ -+ minI64 = -(1 << 63) -+ minI32 = -(1 << 31) -+ minI16 = -(1 << 15) -+ minI8 = -(1 << 7) -+) -+ -+func cmp(left *big.Int, op string, right *big.Int) bool { -+ switch left.Cmp(right) { -+ case -1: // less than -+ return op == "<" || op == "<=" || op == "!=" -+ case 0: // equal -+ return op == "==" || op == "<=" || op == ">=" -+ case 1: // greater than -+ return op == ">" || op == ">=" || op == "!=" -+ } -+ panic("unexpected comparison value") -+} -+ -+func inRange(typ string, val *big.Int) bool { -+ min, max := &big.Int{}, &big.Int{} -+ switch typ { -+ case "uint64": -+ max = max.SetUint64(maxU64) -+ case "uint32": -+ max = max.SetUint64(maxU32) -+ case "uint16": -+ max = max.SetUint64(maxU16) -+ case "uint8": -+ max = max.SetUint64(maxU8) -+ case "int64": -+ min = min.SetInt64(minI64) -+ max = max.SetInt64(maxI64) -+ case "int32": -+ min = min.SetInt64(minI32) -+ max = max.SetInt64(maxI32) -+ case "int16": -+ min = min.SetInt64(minI16) -+ max = max.SetInt64(maxI16) -+ case "int8": -+ min = min.SetInt64(minI8) -+ max = max.SetInt64(maxI8) -+ default: -+ panic("unexpected type") -+ } -+ return cmp(min, "<=", val) && cmp(val, "<=", max) -+} -+ -+func getValues(typ string) []*big.Int { -+ Uint := func(v uint64) *big.Int { return big.NewInt(0).SetUint64(v) } -+ Int := func(v int64) *big.Int { return big.NewInt(0).SetInt64(v) } -+ values := []*big.Int{ -+ // limits -+ Uint(maxU64), -+ Uint(maxU64 - 1), -+ Uint(maxI64 + 1), -+ Uint(maxI64), -+ Uint(maxI64 - 1), -+ Uint(maxU32 + 1), -+ Uint(maxU32), -+ Uint(maxU32 - 1), -+ Uint(maxI32 + 1), -+ Uint(maxI32), -+ Uint(maxI32 - 1), -+ Uint(maxU16 + 1), -+ Uint(maxU16), -+ Uint(maxU16 - 1), -+ Uint(maxI16 + 1), -+ Uint(maxI16), -+ Uint(maxI16 - 1), -+ Uint(maxU8 + 1), -+ Uint(maxU8), -+ Uint(maxU8 - 1), -+ Uint(maxI8 + 1), -+ Uint(maxI8), -+ Uint(maxI8 - 1), -+ Uint(0), -+ Int(minI8 + 1), -+ Int(minI8), -+ Int(minI8 - 1), -+ Int(minI16 + 1), -+ Int(minI16), -+ Int(minI16 - 1), -+ Int(minI32 + 1), -+ Int(minI32), -+ Int(minI32 - 1), -+ Int(minI64 + 1), -+ Int(minI64), -+ -+ // other possibly interesting values -+ Uint(1), -+ Int(-1), -+ Uint(0xff << 56), -+ Uint(0xff << 32), -+ Uint(0xff << 24), -+ } -+ sort.Slice(values, func(i, j int) bool { return values[i].Cmp(values[j]) == -1 }) -+ var ret []*big.Int -+ for _, val := range values { -+ if !inRange(typ, val) { -+ continue -+ } -+ ret = append(ret, val) -+ } -+ return ret -+} -+ -+func sigString(v *big.Int) string { -+ var t big.Int -+ t.Abs(v) -+ if v.Sign() == -1 { -+ return "neg" + t.String() -+ } -+ return t.String() -+} -+ -+func main() { -+ types := []string{ -+ "uint64", "uint32", "uint16", "uint8", -+ "int64", "int32", "int16", "int8", -+ } -+ -+ w := new(bytes.Buffer) -+ fmt.Fprintf(w, "// run\n") -+ fmt.Fprintf(w, "// Code generated by gen/cmpConstGen.go. DO NOT EDIT.\n\n") -+ fmt.Fprintf(w, "package main;\n") -+ fmt.Fprintf(w, "import (\"fmt\"; \"reflect\"; \"runtime\";)\n") -+ fmt.Fprintf(w, "// results show the expected result for the elements left of, equal to and right of the index.\n") -+ fmt.Fprintf(w, "type result struct{l, e, r bool}\n") -+ fmt.Fprintf(w, "var (\n") -+ fmt.Fprintf(w, " eq = result{l: false, e: true, r: false}\n") -+ fmt.Fprintf(w, " ne = result{l: true, e: false, r: true}\n") -+ fmt.Fprintf(w, " lt = result{l: true, e: false, r: false}\n") -+ fmt.Fprintf(w, " le = result{l: true, e: true, r: false}\n") -+ fmt.Fprintf(w, " gt = result{l: false, e: false, r: true}\n") -+ fmt.Fprintf(w, " ge = result{l: false, e: true, r: true}\n") -+ fmt.Fprintf(w, ")\n") -+ -+ operators := []struct{ op, name string }{ -+ {"<", "lt"}, -+ {"<=", "le"}, -+ {">", "gt"}, -+ {">=", "ge"}, -+ {"==", "eq"}, -+ {"!=", "ne"}, -+ } -+ -+ for _, typ := range types { -+ // generate a slice containing valid values for this type -+ fmt.Fprintf(w, "\n// %v tests\n", typ) -+ values := getValues(typ) -+ fmt.Fprintf(w, "var %v_vals = []%v{\n", typ, typ) -+ for _, val := range values { -+ fmt.Fprintf(w, "%v,\n", val.String()) -+ } -+ fmt.Fprintf(w, "}\n") -+ -+ // generate test functions -+ for _, r := range values { -+ // TODO: could also test constant on lhs. -+ sig := sigString(r) -+ for _, op := range operators { -+ // no need for go:noinline because the function is called indirectly -+ fmt.Fprintf(w, "func %v_%v_%v(x %v) bool { return x %v %v; }\n", op.name, sig, typ, typ, op.op, r.String()) -+ } -+ } -+ -+ // generate a table of test cases -+ fmt.Fprintf(w, "var %v_tests = []struct{\n", typ) -+ fmt.Fprintf(w, " idx int // index of the constant used\n") -+ fmt.Fprintf(w, " exp result // expected results\n") -+ fmt.Fprintf(w, " fn func(%v) bool\n", typ) -+ fmt.Fprintf(w, "}{\n") -+ for i, r := range values { -+ sig := sigString(r) -+ for _, op := range operators { -+ fmt.Fprintf(w, "{idx: %v,", i) -+ fmt.Fprintf(w, "exp: %v,", op.name) -+ fmt.Fprintf(w, "fn: %v_%v_%v},\n", op.name, sig, typ) -+ } -+ } -+ fmt.Fprintf(w, "}\n") -+ } -+ -+ // emit the main function, looping over all test cases -+ fmt.Fprintf(w, "func main() {\n") -+ for _, typ := range types { -+ fmt.Fprintf(w, "for i, test := range %v_tests {\n", typ) -+ fmt.Fprintf(w, " for j, x := range %v_vals {\n", typ) -+ fmt.Fprintf(w, " want := test.exp.l\n") -+ fmt.Fprintf(w, " if j == test.idx {\nwant = test.exp.e\n}") -+ fmt.Fprintf(w, " else if j > test.idx {\nwant = test.exp.r\n}\n") -+ fmt.Fprintf(w, " if test.fn(x) != want {\n") -+ fmt.Fprintf(w, " fn := runtime.FuncForPC(reflect.ValueOf(test.fn).Pointer()).Name()\n") -+ fmt.Fprintf(w, " msg := fmt.Sprintf(\"test failed: %%v(%%v) != %%v [type=%v i=%%v j=%%v idx=%%v]\", fn, x, want, i, j, test.idx)\n", typ) -+ fmt.Fprintf(w, " panic(msg)\n") -+ fmt.Fprintf(w, " }\n") -+ fmt.Fprintf(w, " }\n") -+ fmt.Fprintf(w, "}\n") -+ } -+ fmt.Fprintf(w, "}\n") -+ -+ // gofmt result -+ b := w.Bytes() -+ src, err := format.Source(b) -+ if err != nil { -+ fmt.Printf("%s\n", b) -+ panic(err) -+ } -+ -+ // write to file -+ err = ioutil.WriteFile("../cmpConst.go", src, 0666) -+ if err != nil { -+ log.Fatalf("can't write output: %v\n", err) -+ } -+} -diff --git a/src/cmd/compile/internal/ssa/gen/S390X.rules b/src/cmd/compile/internal/ssa/gen/S390X.rules -index 7ecea02..caea050 100644 ---- a/src/cmd/compile/internal/ssa/gen/S390X.rules -+++ b/src/cmd/compile/internal/ssa/gen/S390X.rules -@@ -537,8 +537,8 @@ - (CMP (MOVDconst [c]) x) && is32Bit(c) -> (InvertFlags (CMPconst x [c])) - (CMPW x (MOVDconst [c])) -> (CMPWconst x [c]) - (CMPW (MOVDconst [c]) x) -> (InvertFlags (CMPWconst x [c])) --(CMPU x (MOVDconst [c])) && is32Bit(c) -> (CMPUconst x [int64(uint32(c))]) --(CMPU (MOVDconst [c]) x) && is32Bit(c) -> (InvertFlags (CMPUconst x [int64(uint32(c))])) -+(CMPU x (MOVDconst [c])) && isU32Bit(c) -> (CMPUconst x [int64(uint32(c))]) -+(CMPU (MOVDconst [c]) x) && isU32Bit(c) -> (InvertFlags (CMPUconst x [int64(uint32(c))])) - (CMPWU x (MOVDconst [c])) -> (CMPWUconst x [int64(uint32(c))]) - (CMPWU (MOVDconst [c]) x) -> (InvertFlags (CMPWUconst x [int64(uint32(c))])) - -diff --git a/src/cmd/compile/internal/ssa/rewriteS390X.go b/src/cmd/compile/internal/ssa/rewriteS390X.go -index 866cf50..af8fd1d 100644 ---- a/src/cmd/compile/internal/ssa/rewriteS390X.go -+++ b/src/cmd/compile/internal/ssa/rewriteS390X.go -@@ -6784,7 +6784,7 @@ func rewriteValueS390X_OpS390XCMPU(v *Value, config *Config) bool { - b := v.Block - _ = b - // match: (CMPU x (MOVDconst [c])) -- // cond: is32Bit(c) -+ // cond: isU32Bit(c) - // result: (CMPUconst x [int64(uint32(c))]) - for { - x := v.Args[0] -@@ -6793,7 +6793,7 @@ func rewriteValueS390X_OpS390XCMPU(v *Value, config *Config) bool { - break - } - c := v_1.AuxInt -- if !(is32Bit(c)) { -+ if !(isU32Bit(c)) { - break - } - v.reset(OpS390XCMPUconst) -@@ -6802,7 +6802,7 @@ func rewriteValueS390X_OpS390XCMPU(v *Value, config *Config) bool { - return true - } - // match: (CMPU (MOVDconst [c]) x) -- // cond: is32Bit(c) -+ // cond: isU32Bit(c) - // result: (InvertFlags (CMPUconst x [int64(uint32(c))])) - for { - v_0 := v.Args[0] -@@ -6811,7 +6811,7 @@ func rewriteValueS390X_OpS390XCMPU(v *Value, config *Config) bool { - } - c := v_0.AuxInt - x := v.Args[1] -- if !(is32Bit(c)) { -+ if !(isU32Bit(c)) { - break - } - v.reset(OpS390XInvertFlags) diff --git a/sources b/sources index 112d405..178856e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.8.1.src.tar.gz) = f01fe7b35ac23101610f6fc169b88dafe2edc49b3b044d5d0aff771b05dcb2c8d2e7a5090ed6dbe67f861e78e792ace32e209ed464399ca02dcd186b13ec8037 +SHA512 (go1.8.3.src.tar.gz) = c6e67dd9e3acdf2aa776d920f91f3fb1802d624ba5d51e06b2c7c6b71bcfaf91f4024f7a442cecde69175c589f7f1163f0ae86d887e15ddde710e53ce0961284 From 5c3bfeff0a8f8962aa1c6adc308c0baf802c748a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 15 Jun 2017 14:21:12 +0200 Subject: [PATCH 113/156] Bump to 1.7.6 Fix for CVE-2017-8932 Resolves: BZ#1455190 --- .gitignore | 1 + golang.spec | 10 +++-- sources | 2 +- tzdata-fix.patch | 113 ++++++++++++++++++++++++++++++++++++----------- 4 files changed, 97 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index ec82f39..6969e5f 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ /go1.7.1.src.tar.gz /go1.7.3.src.tar.gz /go1.7.4.src.tar.gz +/go1.7.6.src.tar.gz diff --git a/golang.spec b/golang.spec index 35324fe..6b72c37 100644 --- a/golang.spec +++ b/golang.spec @@ -44,10 +44,10 @@ %endif %global go_api 1.7 -%global go_version 1.7.4 +%global go_version 1.7.6 Name: golang -Version: 1.7.4 +Version: 1.7.6 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -86,7 +86,6 @@ Patch215: ./go1.5-zoneinfo_testing_only.patch Patch216: ppc64x-overflow-1.patch Patch217: ppc64x-overflow-2.patch -# Fix for https://github.com/golang/go/issues/17276 Patch218: tzdata-fix.patch # Having documentation separate was broken @@ -444,6 +443,11 @@ fi %endif %changelog +* Thu Jun 15 2017 Jakub Čajka - 1.7.4-1 +- Bump to 1.7.6 +- Fix for CVE-2017-8932 +- Resolves: BZ#1455190 + * Mon Dec 05 2016 Jakub Čajka - 1.7.4-1 - Bump to 1.7.4 - Resolves: BZ#1400732 diff --git a/sources b/sources index a66d54c..2eb8220 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -49c1076428a5d3b5ad7ac65233fcca2f go1.7.4.src.tar.gz +SHA512 (go1.7.6.src.tar.gz) = b01846bfb17bf91a9c493c4d6c43bbe7e17270b9e8a229a2be4032b78ef9395f5512917ea9faab74a120c755bbd53bbd816b033caadcbb7679e91702b37f8c7f diff --git a/tzdata-fix.patch b/tzdata-fix.patch index b7e6e41..8fb9f40 100644 --- a/tzdata-fix.patch +++ b/tzdata-fix.patch @@ -1,34 +1,97 @@ -From c5434f2973a87acff76bac359236e690d632ce95 Mon Sep 17 00:00:00 2001 +From 8890527476e25747f063377d637b106db0008329 Mon Sep 17 00:00:00 2001 From: Alberto Donizetti -Date: Thu, 29 Sep 2016 13:59:10 +0200 -Subject: [PATCH] time: update test for tzdata-2016g +Date: Thu, 9 Mar 2017 13:20:54 +0100 +Subject: [PATCH] [release-branch.go1.8] time: make the ParseInLocation test + more robust -Fixes #17276 +The tzdata 2017a update (2017-02-28) changed the abbreviation of the +Asia/Baghdad time zone (used in TestParseInLocation) from 'AST' to the +numeric '+03'. -Change-Id: I0188cf9bc5fdb48c71ad929cc54206d03e0b96e4 -Reviewed-on: https://go-review.googlesource.com/29995 -Reviewed-by: Brad Fitzpatrick -Run-TryBot: Brad Fitzpatrick +Update the test so that it skips the checks if we're using a recent +tzdata release. + +Fixes #19457 + +Change-Id: I45d705a5520743a611bdd194dc8f8d618679980c +Reviewed-on: https://go-review.googlesource.com/37964 +Reviewed-by: Ian Lance Taylor +Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot +(cherry picked from commit 91563ced5897faf729a34be7081568efcfedda31) +Reviewed-on: https://go-review.googlesource.com/37991 +Run-TryBot: Brad Fitzpatrick --- - src/time/time_test.go | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) + src/time/format_test.go | 41 +++++++++++++++++++++++++++++++---------- + 1 file changed, 31 insertions(+), 10 deletions(-) -diff --git a/src/time/time_test.go b/src/time/time_test.go -index 68236fd..2e47d08 100644 ---- a/src/time/time_test.go -+++ b/src/time/time_test.go -@@ -943,8 +943,11 @@ func TestLoadFixed(t *testing.T) { - // but Go and most other systems use "east is positive". - // So GMT+1 corresponds to -3600 in the Go zone, not +3600. - name, offset := Now().In(loc).Zone() -- if name != "GMT+1" || offset != -1*60*60 { -- t.Errorf("Now().In(loc).Zone() = %q, %d, want %q, %d", name, offset, "GMT+1", -1*60*60) -+ // The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1" -+ // on earlier versions; we accept both. (Issue #17276). -+ if !(name == "GMT+1" || name == "-01") || offset != -1*60*60 { -+ t.Errorf("Now().In(loc).Zone() = %q, %d, want %q or %q, %d", -+ name, offset, "GMT+1", "-01", -1*60*60) +diff --git a/src/time/format_test.go b/src/time/format_test.go +index 219c2ca..d0013bc 100644 +--- a/src/time/format_test.go ++++ b/src/time/format_test.go +@@ -245,27 +245,45 @@ func TestParseDayOutOfRange(t *testing.T) { } } ++// TestParseInLocation checks that the Parse and ParseInLocation ++// functions do not get confused by the fact that AST (Arabia Standard ++// Time) and AST (Atlantic Standard Time) are different time zones, ++// even though they have the same abbreviation. ++// ++// ICANN has been slowly phasing out invented abbreviation in favor of ++// numeric time zones (for example, the Asia/Baghdad time zone ++// abbreviation got changed from AST to +03 in the 2017a tzdata ++// release); but we still want to make sure that the time package does ++// not get confused on systems with slightly older tzdata packages. + func TestParseInLocation(t *testing.T) { +- // Check that Parse (and ParseInLocation) understand that +- // Feb 01 AST (Arabia Standard Time) and Feb 01 AST (Atlantic Standard Time) +- // are in different time zones even though both are called AST + + baghdad, err := LoadLocation("Asia/Baghdad") + if err != nil { + t.Fatal(err) + } + +- t1, err := ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", baghdad) ++ var t1, t2 Time ++ ++ t1, err = ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", baghdad) + if err != nil { + t.Fatal(err) + } +- t2 := Date(2013, February, 1, 00, 00, 00, 0, baghdad) +- if t1 != t2 { +- t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad) = %v, want %v", t1, t2) +- } ++ + _, offset := t1.Zone() +- if offset != 3*60*60 { +- t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad).Zone = _, %d, want _, %d", offset, 3*60*60) ++ ++ // A zero offset means that ParseInLocation did not recognize the ++ // 'AST' abbreviation as matching the current location (Baghdad, ++ // where we'd expect a +03 hrs offset); likely because we're using ++ // a recent tzdata release (2017a or newer). ++ // If it happens, skip the Baghdad test. ++ if offset != 0 { ++ t2 = Date(2013, February, 1, 00, 00, 00, 0, baghdad) ++ if t1 != t2 { ++ t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad) = %v, want %v", t1, t2) ++ } ++ if offset != 3*60*60 { ++ t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad).Zone = _, %d, want _, %d", offset, 3*60*60) ++ } + } + + blancSablon, err := LoadLocation("America/Blanc-Sablon") +@@ -273,6 +291,9 @@ func TestParseInLocation(t *testing.T) { + t.Fatal(err) + } + ++ // In this case 'AST' means 'Atlantic Standard Time', and we ++ // expect the abbreviation to correctly match the american ++ // location. + t1, err = ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", blancSablon) + if err != nil { + t.Fatal(err) From 5767354120e6457ba9b75f1266e8cc55f2307b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 12 Jul 2017 13:38:36 +0200 Subject: [PATCH 114/156] Bump to 1.9beta2 Workaround build failure on s390x --- .gitignore | 1 + golang-1.2-verbose-build.patch | 18 +++++++------ golang-1.5-bootstrap-binary-path.patch | 35 +++++++++++++------------- golang.spec | 21 ++++++++-------- s390x-ignore-L0syms.patch | 18 +++++++++++++ sources | 2 +- 6 files changed, 59 insertions(+), 36 deletions(-) create mode 100644 s390x-ignore-L0syms.patch diff --git a/.gitignore b/.gitignore index 992c313..927a316 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ /go1.8.src.tar.gz /go1.8.1.src.tar.gz /go1.8.3.src.tar.gz +/go1.9beta2.src.tar.gz diff --git a/golang-1.2-verbose-build.patch b/golang-1.2-verbose-build.patch index e9c5edf..c9dbba2 100644 --- a/golang-1.2-verbose-build.patch +++ b/golang-1.2-verbose-build.patch @@ -1,8 +1,7 @@ -Index: go/src/make.bash -=================================================================== ---- go.orig/src/make.bash -+++ go/src/make.bash -@@ -153,12 +153,12 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then +diff -up go/src/make.bash.verbose go/src/make.bash +--- go/src/make.bash.verbose 2017-07-11 12:00:09.513553508 +0200 ++++ go/src/make.bash 2017-07-11 12:01:25.288245720 +0200 +@@ -167,7 +167,7 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH # 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 \ @@ -11,9 +10,12 @@ Index: go/src/make.bash echo fi - echo "##### Building packages and commands for $GOOS/$GOARCH." +@@ -175,7 +175,7 @@ echo "##### Building packages and comman + + old_bin_files=$(cd $GOROOT/bin && echo *) + -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 + # Check that there are no new files in $GOROOT/bin other than go and gofmt + # and $GOOS_$GOARCH (a directory used when cross-compiling). diff --git a/golang-1.5-bootstrap-binary-path.patch b/golang-1.5-bootstrap-binary-path.patch index d0e1f34..af7d069 100644 --- a/golang-1.5-bootstrap-binary-path.patch +++ b/golang-1.5-bootstrap-binary-path.patch @@ -1,36 +1,37 @@ diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go ---- go/src/cmd/dist/buildtool.go.bootstrap 2016-10-24 12:54:57.620563325 +0200 -+++ go/src/cmd/dist/buildtool.go 2016-10-24 13:12:25.036466602 +0200 -@@ -131,17 +131,25 @@ func bootstrapBuildTools() { +--- go/src/cmd/dist/buildtool.go.bootstrap 2017-07-11 12:05:00.041373419 +0200 ++++ go/src/cmd/dist/buildtool.go 2017-07-11 12:07:27.141775914 +0200 +@@ -153,18 +153,26 @@ func bootstrapBuildTools() { defer os.Setenv("GOBIN", os.Getenv("GOBIN")) os.Setenv("GOBIN", "") -+ hostos := os.Getenv("GOHOSTOS") -+ hostarch := os.Getenv("GOHOSTARCH") ++ hostos := os.Getenv("GOHOSTOS") ++ hostarch := os.Getenv("GOHOSTARCH") + os.Setenv("GOOS", "") os.Setenv("GOHOSTOS", "") os.Setenv("GOARCH", "") 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) -+ } ++ 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. Use -gcflags=-l to disable inlining to // workaround bugs in Go 1.4's compiler. See discussion thread: // https://groups.google.com/d/msg/golang-dev/Ss7mCKsvk8w/Gsq7VYI0AwAJ // Use the math_big_pure_go build tag to disable the assembly in math/big // which may contain unsupported instructions. -- run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-gcflags=-l", "-tags=math_big_pure_go", "-v", "bootstrap/cmd/...") -+ run(workspace, ShowOutput|CheckExit, bingopath, "install", "-gcflags=-l", "-v", "-tags=math_big_pure_go", "bootstrap/...") - - // Copy binaries into tool binary directory. - for _, name := range bootstrapDirs { + cmd := []string{ +- pathf("%s/bin/go", goroot_bootstrap), ++ bingopath, + "install", + "-gcflags=-l", + "-tags=math_big_pure_go", diff -up go/src/make.bash.bootstrap go/src/make.bash ---- go/src/make.bash.bootstrap 2016-10-24 12:54:57.606563267 +0200 -+++ go/src/make.bash 2016-10-24 12:54:57.620563325 +0200 +--- go/src/make.bash.bootstrap 2017-07-11 12:05:00.036373439 +0200 ++++ go/src/make.bash 2017-07-11 12:05:00.041373419 +0200 @@ -120,8 +120,15 @@ echo '##### Building Go bootstrap tool.' echo cmd/dist export GOROOT="$(cd .. && pwd)" @@ -49,7 +50,7 @@ diff -up go/src/make.bash.bootstrap go/src/make.bash echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 exit 1 fi -@@ -130,8 +137,6 @@ if [ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]; +@@ -130,8 +137,6 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 exit 1 fi diff --git a/golang.spec b/golang.spec index e1b8d21..98a4112 100644 --- a/golang.spec +++ b/golang.spec @@ -93,12 +93,12 @@ %global gohostarch s390x %endif -%global go_api 1.8 -%global go_version 1.8.3 +%global go_api 1.9 +%global go_version 1.9beta2 Name: golang -Version: 1.8.3 -Release: 1%{?dist} +Version: 1.9 +Release: 0.beta2.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -119,7 +119,7 @@ BuildRequires: hostname BuildRequires: net-tools %endif # for tests -BuildRequires: pcre-devel, glibc-static, perl +BuildRequires: pcre-devel, glibc-static, perl, procps-ng Provides: go = %{version}-%{release} Requires: %{name}-bin = %{version}-%{release} @@ -137,8 +137,8 @@ Patch215: ./go1.5-zoneinfo_testing_only.patch # Proposed patch by mmunday https://golang.org/cl/35262 Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch -# https://github.com/golang/go/commit/94aba76639cf4d5e30975d846bb0368db8202269 -Patch220: 31bit-OID-asn1.patch + +Patch220: s390x-ignore-L0syms.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -270,13 +270,11 @@ Requires: %{name} = %{version}-%{release} %patch215 -p1 %patch219 -p1 + %patch220 -p1 cp %{SOURCE1} ./src/runtime/ -# don't include chacha test vectors in buildID -mv ./src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_test_vectors.go ./src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_vectors_test.go - %build # print out system information uname -a @@ -509,6 +507,9 @@ fi %endif %changelog +* Tue Jul 11 2017 Jakub Čajka - 1.9-0.beta2.1 +- bump to beta2 + * Thu May 25 2017 Jakub Čajka - 1.8.3-1 - bump to 1.8.3 - fix for CVE-2017-8932 diff --git a/s390x-ignore-L0syms.patch b/s390x-ignore-L0syms.patch new file mode 100644 index 0000000..5047f82 --- /dev/null +++ b/s390x-ignore-L0syms.patch @@ -0,0 +1,18 @@ +diff --git a/src/cmd/link/internal/ld/ldelf.go b/src/cmd/link/internal/ld/ldelf.go +index d4f9fc4..87dabaa 100644 +--- a/src/cmd/link/internal/ld/ldelf.go ++++ b/src/cmd/link/internal/ld/ldelf.go +@@ -799,6 +799,13 @@ func ldelf(ctxt *Link, f *bio.Reader, pkg string, length int64, pn string) { + continue + } + ++ if sect.name == ".debug_str" && strings.HasPrefix(sym.name, "L0") && sym.type_ == 0 { ++ // introduced by https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=49fced1206db40c71208c201165d65f92c69cebe on s390x ++ // TODO investigate from where they are actually coming from ++ // See issue ++ continue ++ } ++ + if strings.HasPrefix(sym.name, ".LASF") { // gcc on s390x does this + continue + } diff --git a/sources b/sources index 178856e..c5fd0fc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.8.3.src.tar.gz) = c6e67dd9e3acdf2aa776d920f91f3fb1802d624ba5d51e06b2c7c6b71bcfaf91f4024f7a442cecde69175c589f7f1163f0ae86d887e15ddde710e53ce0961284 +SHA512 (go1.9beta2.src.tar.gz) = 562770efb455465c19412c12053f6fc9aeadfaf045befbb5b0d23152b8d7956db28792100500feb6e89c7a608925247359292e534adf272f7d3286270a0621a5 From c7375398e70c41636e984dcad8d7a71927bdef65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 12 Jul 2017 14:32:33 +0200 Subject: [PATCH 115/156] perl dependency renamed to perl-interpreter --- golang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 98a4112..7c44128 100644 --- a/golang.spec +++ b/golang.spec @@ -119,7 +119,7 @@ BuildRequires: hostname BuildRequires: net-tools %endif # for tests -BuildRequires: pcre-devel, glibc-static, perl, procps-ng +BuildRequires: pcre-devel, glibc-static, perl-interpreter, procps-ng Provides: go = %{version}-%{release} Requires: %{name}-bin = %{version}-%{release} From 3cc854f4230879f9513708723bcc0b1e101abf7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 12 Jul 2017 17:26:26 +0200 Subject: [PATCH 116/156] Improved s390x patch --- s390x-ignore-L0syms.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s390x-ignore-L0syms.patch b/s390x-ignore-L0syms.patch index 5047f82..b832d79 100644 --- a/s390x-ignore-L0syms.patch +++ b/s390x-ignore-L0syms.patch @@ -6,9 +6,9 @@ index d4f9fc4..87dabaa 100644 continue } -+ if sect.name == ".debug_str" && strings.HasPrefix(sym.name, "L0") && sym.type_ == 0 { ++ if sect.name == ".debug_str" && sym.name == "L0" && sym.type_ == 0 { + // introduced by https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=49fced1206db40c71208c201165d65f92c69cebe on s390x -+ // TODO investigate from where they are actually coming from ++ // TODO investigate from where they are actually coming from, could be possible issue with elf parsing as seeing 0x1 in name is weird + // See issue + continue + } From 9941f71a5726a0a657ce9c9409a9c72bb08099c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 13 Jul 2017 12:39:15 +0200 Subject: [PATCH 117/156] Mention upstream issue in s390x-ignore... patch --- s390x-ignore-L0syms.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s390x-ignore-L0syms.patch b/s390x-ignore-L0syms.patch index b832d79..a6c65e0 100644 --- a/s390x-ignore-L0syms.patch +++ b/s390x-ignore-L0syms.patch @@ -9,7 +9,7 @@ index d4f9fc4..87dabaa 100644 + if sect.name == ".debug_str" && sym.name == "L0" && sym.type_ == 0 { + // introduced by https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=49fced1206db40c71208c201165d65f92c69cebe on s390x + // TODO investigate from where they are actually coming from, could be possible issue with elf parsing as seeing 0x1 in name is weird -+ // See issue ++ // See issue https://github.com/golang/go/issues/20996 + continue + } + From 494a6d19c33655b2ef756aeea00d93afd44379ca Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 26 Jul 2017 11:03:59 +0000 Subject: [PATCH 118/156] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 7c44128..a0404a9 100644 --- a/golang.spec +++ b/golang.spec @@ -98,7 +98,7 @@ Name: golang Version: 1.9 -Release: 0.beta2.1%{?dist} +Release: 0.beta2.1%{?dist}.1 Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -507,6 +507,9 @@ fi %endif %changelog +* Wed Jul 26 2017 Fedora Release Engineering - 1.9-0.beta2.1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Tue Jul 11 2017 Jakub Čajka - 1.9-0.beta2.1 - bump to beta2 From cb0891bb70522f64680e11df685d84f0ee32ac64 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 2 Aug 2017 22:14:37 +0000 Subject: [PATCH 119/156] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index a0404a9..1e9600a 100644 --- a/golang.spec +++ b/golang.spec @@ -98,7 +98,7 @@ Name: golang Version: 1.9 -Release: 0.beta2.1%{?dist}.1 +Release: 0.beta2.1%{?dist}.2 Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -507,6 +507,9 @@ fi %endif %changelog +* Wed Aug 02 2017 Fedora Release Engineering - 1.9-0.beta2.1.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Wed Jul 26 2017 Fedora Release Engineering - 1.9-0.beta2.1.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 903219bc9373740f336395f195a8fd84670dd342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 15 Sep 2017 13:25:24 +0200 Subject: [PATCH 120/156] Bump to release version --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 927a316..74d86c2 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ /go1.8.1.src.tar.gz /go1.8.3.src.tar.gz /go1.9beta2.src.tar.gz +/go1.9.src.tar.gz diff --git a/golang.spec b/golang.spec index 1e9600a..c042b10 100644 --- a/golang.spec +++ b/golang.spec @@ -94,11 +94,11 @@ %endif %global go_api 1.9 -%global go_version 1.9beta2 +%global go_version 1.9 Name: golang Version: 1.9 -Release: 0.beta2.1%{?dist}.2 +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -507,6 +507,9 @@ fi %endif %changelog +* Fri Sep 15 2017 Jakub Čajka - 1.9-1 +- bump to the relased version + * Wed Aug 02 2017 Fedora Release Engineering - 1.9-0.beta2.1.2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild diff --git a/sources b/sources index c5fd0fc..fc834b2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.9beta2.src.tar.gz) = 562770efb455465c19412c12053f6fc9aeadfaf045befbb5b0d23152b8d7956db28792100500feb6e89c7a608925247359292e534adf272f7d3286270a0621a5 +SHA512 (go1.9.src.tar.gz) = 70c4b892b6883fb21fc1a547a2b8d174df8c7aca282a3906e3816b4442b16c5da578b69c19443122a4a45e66fc95d170528d826b70932af09f4afd2a46615d74 From ceb83a748cd95e303fcd704e10c301d85158248c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 6 Oct 2017 13:12:30 +0200 Subject: [PATCH 121/156] fix CVE-2017-15041 and CVE-2017-15042 --- .gitignore | 1 + golang.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 74d86c2..b8bc76e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ /go1.8.3.src.tar.gz /go1.9beta2.src.tar.gz /go1.9.src.tar.gz +/go1.9.1.src.tar.gz diff --git a/golang.spec b/golang.spec index c042b10..93221f3 100644 --- a/golang.spec +++ b/golang.spec @@ -97,7 +97,7 @@ %global go_version 1.9 Name: golang -Version: 1.9 +Version: 1.9.1 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -507,6 +507,9 @@ fi %endif %changelog +* Fri Oct 06 2017 Jakub Čajka - 1.9.1-1 +- fix CVE-2017-15041 and CVE-2017-15042 + * Fri Sep 15 2017 Jakub Čajka - 1.9-1 - bump to the relased version diff --git a/sources b/sources index fc834b2..4255227 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.9.src.tar.gz) = 70c4b892b6883fb21fc1a547a2b8d174df8c7aca282a3906e3816b4442b16c5da578b69c19443122a4a45e66fc95d170528d826b70932af09f4afd2a46615d74 +SHA512 (go1.9.1.src.tar.gz) = 3c5d11089a54c61acd1a4fad9618ddb2058cc783a54564407ee50e37c864deaadfd5effeab623080c136a599096f448aae091ef41d0afca1abfcdb98adf4a793 From 387b897724a95eda343d90e726fe1daa30de4a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 6 Oct 2017 13:17:08 +0200 Subject: [PATCH 122/156] Use corect version --- golang.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 93221f3..104674b 100644 --- a/golang.spec +++ b/golang.spec @@ -94,7 +94,7 @@ %endif %global go_api 1.9 -%global go_version 1.9 +%global go_version 1.9.1 Name: golang Version: 1.9.1 From 920ea390832d9c30bc98fe5bc4da1475ffdf2983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 12 Oct 2017 15:52:28 +0200 Subject: [PATCH 123/156] add bcond for bootstraping --- golang.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/golang.spec b/golang.spec index 104674b..bc26775 100644 --- a/golang.spec +++ b/golang.spec @@ -1,3 +1,4 @@ +%bcond_with bootstrap # build ids are not currently generated: # https://code.google.com/p/go/issues/detail?id=5238 # @@ -41,10 +42,10 @@ %endif # Use golang/gcc-go as bootstrap compiler -%ifarch %{golang_arches} -%global golang_bootstrap 1 -%else +%if %{with bootstrap} %global golang_bootstrap 0 +%else +%global golang_bootstrap 1 %endif # Controls what ever we fail on failed tests From dc8fe7c9cedbbf0e998dbcd072a0530ed52b456a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 13 Oct 2017 14:13:08 +0200 Subject: [PATCH 124/156] fix CVE-2017-15041 and CVE-2017-15042 --- CVE-2017-15041.patch | 127 ++++++++++++++++++++++++++++++++++++++ CVE-2017-15042.patch | 144 +++++++++++++++++++++++++++++++++++++++++++ golang.spec | 5 +- 3 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 CVE-2017-15041.patch create mode 100644 CVE-2017-15042.patch diff --git a/CVE-2017-15041.patch b/CVE-2017-15041.patch new file mode 100644 index 0000000..4c4747c --- /dev/null +++ b/CVE-2017-15041.patch @@ -0,0 +1,127 @@ +diff -up go/src/cmd/go/get.go.cve go/src/cmd/go/get.go +--- go/src/cmd/go/get.go.cve 2017-05-23 20:35:22.000000000 +0200 ++++ go/src/cmd/go/get.go 2017-10-10 10:25:24.485047705 +0200 +@@ -401,6 +401,11 @@ func downloadPackage(p *Package) error { + p.build.PkgRoot = filepath.Join(list[0], "pkg") + } + root := filepath.Join(p.build.SrcRoot, filepath.FromSlash(rootPath)) ++ ++ if err := checkNestedVCS(vcs, root, p.build.SrcRoot); err != nil { ++ return err ++ } ++ + // If we've considered this repository already, don't do it again. + if downloadRootCache[root] { + return nil +diff -up go/src/cmd/go/go_test.go.cve go/src/cmd/go/go_test.go +--- go/src/cmd/go/go_test.go.cve 2017-05-23 20:35:22.000000000 +0200 ++++ go/src/cmd/go/go_test.go 2017-10-10 10:25:24.485047705 +0200 +@@ -1235,6 +1235,25 @@ func TestGetGitDefaultBranch(t *testing. + tg.grepStdout(`\* another-branch`, "not on correct default branch") + } + ++func TestAccidentalGitCheckout(t *testing.T) { ++ testenv.MustHaveExternalNetwork(t) ++ if _, err := exec.LookPath("git"); err != nil { ++ t.Skip("skipping because git binary not found") ++ } ++ ++ tg := testgo(t) ++ defer tg.cleanup() ++ tg.parallel() ++ tg.tempDir("src") ++ tg.setenv("GOPATH", tg.path(".")) ++ ++ tg.runFail("get", "-u", "vcs-test.golang.org/go/test1-svn-git") ++ tg.grepStderr("src[\\\\/]vcs-test.* uses git, but parent .*src[\\\\/]vcs-test.* uses svn", "get did not fail for right reason") ++ ++ tg.runFail("get", "-u", "vcs-test.golang.org/go/test2-svn-git/test2main") ++ tg.grepStderr("src[\\\\/]vcs-test.* uses git, but parent .*src[\\\\/]vcs-test.* uses svn", "get did not fail for right reason") ++} ++ + func TestErrorMessageForSyntaxErrorInTestGoFileSaysFAIL(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() +diff -up go/src/cmd/go/vcs.go.cve go/src/cmd/go/vcs.go +--- go/src/cmd/go/vcs.go.cve 2017-05-23 20:35:22.000000000 +0200 ++++ go/src/cmd/go/vcs.go 2017-10-10 10:30:52.151621206 +0200 +@@ -479,11 +479,29 @@ func vcsFromDir(dir, srcRoot string) (vc + return nil, "", fmt.Errorf("directory %q is outside source root %q", dir, srcRoot) + } + ++ var vcsRet *vcsCmd ++ var rootRet string ++ + origDir := dir + for len(dir) > len(srcRoot) { + for _, vcs := range vcsList { + if fi, err := os.Stat(filepath.Join(dir, "."+vcs.cmd)); err == nil && fi.IsDir() { +- return vcs, filepath.ToSlash(dir[len(srcRoot)+1:]), nil ++ root := filepath.ToSlash(dir[len(srcRoot)+1:]) ++ // Record first VCS we find, but keep looking, ++ // to detect mistakes like one kind of VCS inside another. ++ if vcsRet == nil { ++ vcsRet = vcs ++ rootRet = root ++ continue ++ } ++ // Allow .git inside .git, which can arise due to submodules. ++ if vcsRet == vcs && vcs.cmd == "git" { ++ continue ++ } ++ // Otherwise, we have one VCS inside a different VCS. ++ return nil, "", fmt.Errorf("directory %q uses %s, but parent %q uses %s", ++ filepath.Join(srcRoot, rootRet), vcsRet.cmd, filepath.Join(srcRoot, root), vcs.cmd) ++ + } + } + +@@ -496,9 +514,48 @@ func vcsFromDir(dir, srcRoot string) (vc + dir = ndir + } + ++ if vcsRet != nil { ++ return vcsRet, rootRet, nil ++ } ++ + return nil, "", fmt.Errorf("directory %q is not using a known version control system", origDir) + } + ++// checkNestedVCS checks for an incorrectly-nested VCS-inside-VCS ++// situation for dir, checking parents up until srcRoot. ++func checkNestedVCS(vcs *vcsCmd, dir, srcRoot string) error { ++ if len(dir) <= len(srcRoot) || dir[len(srcRoot)] != filepath.Separator { ++ return fmt.Errorf("directory %q is outside source root %q", dir, srcRoot) ++ } ++ ++ otherDir := dir ++ for len(otherDir) > len(srcRoot) { ++ for _, otherVCS := range vcsList { ++ if _, err := os.Stat(filepath.Join(dir, "."+otherVCS.cmd)); err == nil { ++ // Allow expected vcs in original dir. ++ if otherDir == dir && otherVCS == vcs { ++ continue ++ } ++ // Allow .git inside .git, which can arise due to submodules. ++ if otherVCS == vcs && vcs.cmd == "git" { ++ continue ++ } ++ // Otherwise, we have one VCS inside a different VCS. ++ return fmt.Errorf("directory %q uses %s, but parent %q uses %s", dir, vcs.cmd, otherDir, otherVCS.cmd) ++ } ++ } ++ // Move to parent. ++ newDir := filepath.Dir(otherDir) ++ if len(newDir) >= len(otherDir) { ++ // Shouldn't happen, but just in case, stop. ++ break ++ } ++ otherDir = newDir ++ } ++ ++ return nil ++} ++ + // repoRoot represents a version control system, a repo, and a root of + // where to put it on disk. + type repoRoot struct { diff --git a/CVE-2017-15042.patch b/CVE-2017-15042.patch new file mode 100644 index 0000000..aca6049 --- /dev/null +++ b/CVE-2017-15042.patch @@ -0,0 +1,144 @@ +From 4be3fc33ef512532b916aa14258087e89eb47347 Mon Sep 17 00:00:00 2001 +From: Russ Cox +Date: Wed, 4 Oct 2017 13:24:49 -0400 +Subject: [PATCH] [release-branch.go1.8] net/smtp: fix PlainAuth to refuse to + send passwords to non-TLS servers + +PlainAuth originally refused to send passwords to non-TLS servers +and was documented as such. + +In 2013, issue #5184 was filed objecting to the TLS requirement, +despite the fact that it is spelled out clearly in RFC 4954. +The only possibly legitimate use case raised was using PLAIN auth +for connections to localhost, and the suggested fix was to let the +server decide: if it advertises that PLAIN auth is OK, believe it. +That approach was adopted in CL 8279043 and released in Go 1.1. + +Unfortunately, this is exactly wrong. The whole point of the TLS +requirement is to make sure not to send the password to the wrong +server or to a man-in-the-middle. Instead of implementing this rule, +CL 8279043 blindly trusts the server, so that if a man-in-the-middle +says "it's OK, you can send me your password," PlainAuth does. +And the documentation was not updated to reflect any of this. + +This CL restores the original TLS check, as required by RFC 4954 +and as promised in the documentation for PlainAuth. +It then carves out a documented exception for connections made +to localhost (defined as "localhost", "127.0.0.1", or "::1"). + +Cherry-pick of CL 68170. + +Change-Id: I1d3729bbd33aa2f11a03f4c000e6bb473164957b +Reviewed-on: https://go-review.googlesource.com/68023 +Run-TryBot: Russ Cox +Reviewed-by: Chris Broadfoot +--- + src/net/smtp/auth.go | 33 ++++++++++++++++++--------------- + src/net/smtp/smtp_test.go | 32 ++++++++++++++++++++++---------- + 2 files changed, 40 insertions(+), 25 deletions(-) + +diff --git a/src/net/smtp/auth.go b/src/net/smtp/auth.go +index 3f1339ebc56..fd1a472f930 100644 +--- a/src/net/smtp/auth.go ++++ b/src/net/smtp/auth.go +@@ -44,26 +44,29 @@ type plainAuth struct { + } + + // PlainAuth returns an Auth that implements the PLAIN authentication +-// mechanism as defined in RFC 4616. +-// The returned Auth uses the given username and password to authenticate +-// on TLS connections to host and act as identity. Usually identity will be +-// left blank to act as username. ++// mechanism as defined in RFC 4616. The returned Auth uses the given ++// username and password to authenticate to host and act as identity. ++// Usually identity should be the empty string, to act as username. ++// ++// PlainAuth will only send the credentials if the connection is using TLS ++// or is connected to localhost. Otherwise authentication will fail with an ++// error, without sending the credentials. + func PlainAuth(identity, username, password, host string) Auth { + return &plainAuth{identity, username, password, host} + } + ++func isLocalhost(name string) bool { ++ return name == "localhost" || name == "127.0.0.1" || name == "::1" ++} ++ + func (a *plainAuth) Start(server *ServerInfo) (string, []byte, error) { +- if !server.TLS { +- advertised := false +- for _, mechanism := range server.Auth { +- if mechanism == "PLAIN" { +- advertised = true +- break +- } +- } +- if !advertised { +- return "", nil, errors.New("unencrypted connection") +- } ++ // Must have TLS, or else localhost server. ++ // Note: If TLS is not true, then we can't trust ANYTHING in ServerInfo. ++ // In particular, it doesn't matter if the server advertises PLAIN auth. ++ // That might just be the attacker saying ++ // "it's ok, you can trust me with your password." ++ if !server.TLS && !isLocalhost(server.Name) { ++ return "", nil, errors.New("unencrypted connection") + } + if server.Name != a.host { + return "", nil, errors.New("wrong host name") +diff --git a/src/net/smtp/smtp_test.go b/src/net/smtp/smtp_test.go +index c48fae6d5ac..15eaca524be 100644 +--- a/src/net/smtp/smtp_test.go ++++ b/src/net/smtp/smtp_test.go +@@ -60,29 +60,41 @@ testLoop: + } + + func TestAuthPlain(t *testing.T) { +- auth := PlainAuth("foo", "bar", "baz", "servername") + + tests := []struct { +- server *ServerInfo +- err string ++ authName string ++ server *ServerInfo ++ err string + }{ + { +- server: &ServerInfo{Name: "servername", TLS: true}, ++ authName: "servername", ++ server: &ServerInfo{Name: "servername", TLS: true}, + }, + { +- // Okay; explicitly advertised by server. +- server: &ServerInfo{Name: "servername", Auth: []string{"PLAIN"}}, ++ // OK to use PlainAuth on localhost without TLS ++ authName: "localhost", ++ server: &ServerInfo{Name: "localhost", TLS: false}, + }, + { +- server: &ServerInfo{Name: "servername", Auth: []string{"CRAM-MD5"}}, +- err: "unencrypted connection", ++ // NOT OK on non-localhost, even if server says PLAIN is OK. ++ // (We don't know that the server is the real server.) ++ authName: "servername", ++ server: &ServerInfo{Name: "servername", Auth: []string{"PLAIN"}}, ++ err: "unencrypted connection", + }, + { +- server: &ServerInfo{Name: "attacker", TLS: true}, +- err: "wrong host name", ++ authName: "servername", ++ server: &ServerInfo{Name: "servername", Auth: []string{"CRAM-MD5"}}, ++ err: "unencrypted connection", ++ }, ++ { ++ authName: "servername", ++ server: &ServerInfo{Name: "attacker", TLS: true}, ++ err: "wrong host name", + }, + } + for i, tt := range tests { ++ auth := PlainAuth("foo", "bar", "baz", tt.authName) + _, _, err := auth.Start(tt.server) + got := "" + if err != nil { diff --git a/golang.spec b/golang.spec index 6b72c37..0e99aa8 100644 --- a/golang.spec +++ b/golang.spec @@ -48,7 +48,7 @@ Name: golang Version: 1.7.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -443,6 +443,9 @@ fi %endif %changelog +* Fri Oct 13 2017 Jakub Čajka - 1.7.4-2 +- fix CVE-2017-15041 and CVE-2017-15042 + * Thu Jun 15 2017 Jakub Čajka - 1.7.4-1 - Bump to 1.7.6 - Fix for CVE-2017-8932 From 55f301f00665c790af4905d515a116d06cb6dc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 13 Oct 2017 14:16:44 +0200 Subject: [PATCH 125/156] Use and apply the patches... --- golang.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/golang.spec b/golang.spec index 0e99aa8..9cd3988 100644 --- a/golang.spec +++ b/golang.spec @@ -88,6 +88,9 @@ Patch217: ppc64x-overflow-2.patch Patch218: tzdata-fix.patch +Patch219: CVE-2017-15041.patch +Patch220: CVE-2017-15042.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -217,6 +220,9 @@ Summary: Golang shared object libraries %patch218 -p1 +%patch219 -p1 +%patch220 -p1 + %build # print out system information uname -a From 315b776905100527242837123d2cbca0bb3ff323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Tue, 31 Oct 2017 16:04:15 +0100 Subject: [PATCH 126/156] Rebase to 1.9.2 execute correctly pie tests allow to ignore tests via bcond reduce size of golang package --- .gitignore | 1 + golang.spec | 26 ++++++++-- sources | 2 +- use-buildmode-pie-for-pie-testing.patch | 51 ++++++++++++++++++++ use-no-pie-where-needed.patch | 63 +++++++++++++++++++++++++ 5 files changed, 137 insertions(+), 6 deletions(-) create mode 100644 use-buildmode-pie-for-pie-testing.patch create mode 100644 use-no-pie-where-needed.patch diff --git a/.gitignore b/.gitignore index b8bc76e..0b3a44f 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ /go1.9beta2.src.tar.gz /go1.9.src.tar.gz /go1.9.1.src.tar.gz +/go1.9.2.src.tar.gz diff --git a/golang.spec b/golang.spec index bc26775..363fb31 100644 --- a/golang.spec +++ b/golang.spec @@ -1,4 +1,5 @@ %bcond_with bootstrap +%bcond_with ignore_tests # build ids are not currently generated: # https://code.google.com/p/go/issues/detail?id=5238 # @@ -49,10 +50,10 @@ %endif # Controls what ever we fail on failed tests -%ifarch %{ix86} x86_64 %{arm} aarch64 ppc64le -%global fail_on_tests 1 -%else +%if %{with ignore_tests} %global fail_on_tests 0 +%else +%global fail_on_tests 1 %endif # Build golang shared objects for stdlib @@ -95,10 +96,10 @@ %endif %global go_api 1.9 -%global go_version 1.9.1 +%global go_version 1.9.2 Name: golang -Version: 1.9.1 +Version: 1.9.2 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -141,6 +142,11 @@ Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch Patch220: s390x-ignore-L0syms.patch +# https://github.com/golang/go/commit/ca8c361d867d62bd46013c5abbaaad0b2ca6077f +Patch221: use-buildmode-pie-for-pie-testing.patch +# https://github.com/hyangah/go/commit/3502496d03bcd842fd7aac95ec0d7096d581cd26 +Patch222: use-no-pie-where-needed.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -274,6 +280,9 @@ Requires: %{name} = %{version}-%{release} %patch220 -p1 +%patch221 -p1 -b pie +%patch222 -p1 + cp %{SOURCE1} ./src/runtime/ %build @@ -471,6 +480,7 @@ fi %exclude %{goroot}/src/ %exclude %{goroot}/doc/ %exclude %{goroot}/misc/ +%exclude %{goroot}/test/ %{goroot}/* # ensure directory ownership, so they are cleaned up if empty @@ -508,6 +518,12 @@ fi %endif %changelog +* Thu Oct 26 2017 Jakub Čajka - 1.9.2-1 +- Rebase to 1.9.2 +- execute correctly pie tests +- allow to ignore tests via bcond +- reduce size of golang package + * Fri Oct 06 2017 Jakub Čajka - 1.9.1-1 - fix CVE-2017-15041 and CVE-2017-15042 diff --git a/sources b/sources index 4255227..757bcda 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.9.1.src.tar.gz) = 3c5d11089a54c61acd1a4fad9618ddb2058cc783a54564407ee50e37c864deaadfd5effeab623080c136a599096f448aae091ef41d0afca1abfcdb98adf4a793 +SHA512 (go1.9.2.src.tar.gz) = 1034098575c317eeaf648629690a4dea0c479a69c3b80d9917f6b96c8781ce79c0f29859f667dc4e07d47a44972aa09bd0163a458f897cf45f9d09eb03e4abb5 diff --git a/use-buildmode-pie-for-pie-testing.patch b/use-buildmode-pie-for-pie-testing.patch new file mode 100644 index 0000000..9f0db0e --- /dev/null +++ b/use-buildmode-pie-for-pie-testing.patch @@ -0,0 +1,51 @@ +diff -up go/src/cmd/dist/test.go.pie go/src/cmd/dist/test.go +--- go/src/cmd/dist/test.go.pie 2017-10-25 20:30:21.000000000 +0200 ++++ go/src/cmd/dist/test.go 2017-11-03 16:47:55.290829798 +0100 +@@ -852,6 +852,16 @@ func (t *tester) supportedBuildmode(mode + return true + } + return false ++ case "pie": ++ switch pair { ++ case "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-s390x", ++ "android-amd64", "android-arm", "android-arm64", "android-386": ++ return true ++ case "darwin-amd64": ++ return true ++ } ++ return false ++ + default: + log.Fatalf("internal error: unknown buildmode %s", mode) + return false +@@ -953,24 +963,16 @@ func (t *tester) cgoTest(dt *distTest) e + } + } + +- if pair != "freebsd-amd64" { // clang -pie fails to link misc/cgo/test +- cmd := t.dirCmd("misc/cgo/test", +- cc, "-xc", "-o", "/dev/null", "-pie", "-") ++ if t.supportedBuildmode("pie") { ++ cmd = t.addCmd(dt, "misc/cgo/test", "go", "test", "-buildmode=pie") + cmd.Env = env +- cmd.Stdin = strings.NewReader("int main() {}") +- if err := cmd.Run(); err != nil { +- fmt.Println("No support for -pie found, skip cgo PIE test.") +- } else { +- cmd = t.addCmd(dt, "misc/cgo/test", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`) +- cmd.Env = env + +- cmd = t.addCmd(dt, "misc/cgo/testtls", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`) +- cmd.Env = env ++ cmd = t.addCmd(dt, "misc/cgo/testtls", "go", "test", "-buildmode=pie") ++ cmd.Env = env + +- cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`) +- cmd.Env = env ++ cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-buildmode=pie") ++ cmd.Env = env + +- } + } + } + } diff --git a/use-no-pie-where-needed.patch b/use-no-pie-where-needed.patch new file mode 100644 index 0000000..e970498 --- /dev/null +++ b/use-no-pie-where-needed.patch @@ -0,0 +1,63 @@ +From 3502496d03bcd842fd7aac95ec0d7096d581cd26 Mon Sep 17 00:00:00 2001 +From: Lynn Boger +Date: Wed, 11 Oct 2017 16:02:59 -0400 +Subject: [PATCH] misc/cgo/testcarchive: use -no-pie where needed + +Starting in gcc 6, -pie is passed to the linker by default +on some platforms, including ppc64le. If the objects +being linked are not built for -pie then in some cases the +executable could be in error. To avoid that problem, -no-pie +should be used with gcc to override the default -pie option +and generate a correct executable that can be run without error. + +Fixes #22126 + +Change-Id: I4a052bba8b9b3bd6706f5d27ca9a7cebcb504c95 +Reviewed-on: https://go-review.googlesource.com/70072 +Run-TryBot: Lynn Boger +TryBot-Result: Gobot Gobot +Reviewed-by: Ian Lance Taylor +--- + misc/cgo/testcarchive/carchive_test.go | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/misc/cgo/testcarchive/carchive_test.go b/misc/cgo/testcarchive/carchive_test.go +index b5123154e79..ac637c06007 100644 +--- a/misc/cgo/testcarchive/carchive_test.go ++++ b/misc/cgo/testcarchive/carchive_test.go +@@ -6,6 +6,7 @@ package carchive_test + + import ( + "bufio" ++ "bytes" + "debug/elf" + "fmt" + "io/ioutil" +@@ -609,9 +610,26 @@ func TestCompileWithoutShared(t *testing.T) { + } + + exe := "./testnoshared" + exeSuffix +- ccArgs := append(cc, "-o", exe, "main5.c", "libgo2.a") ++ ++ // In some cases, -no-pie is needed here, but not accepted everywhere. First try ++ // if -no-pie is accepted. See #22126. ++ ccArgs := append(cc, "-o", exe, "-no-pie", "main5.c", "libgo2.a") + t.Log(ccArgs) + out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput() ++ ++ // If -no-pie unrecognized, try -nopie if this is possibly clang ++ if err != nil && bytes.Contains(out, []byte("unknown")) && !strings.Contains(cc[0], "gcc") { ++ ccArgs = append(cc, "-o", exe, "-nopie", "main5.c", "libgo2.a") ++ t.Log(ccArgs) ++ out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput() ++ } ++ ++ // Don't use either -no-pie or -nopie ++ if err != nil && bytes.Contains(out, []byte("unrecognized")) { ++ ccArgs := append(cc, "-o", exe, "main5.c", "libgo2.a") ++ t.Log(ccArgs) ++ out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput() ++ } + t.Logf("%s", out) + if err != nil { + t.Fatal(err) From b65272222af734bb2ecc725a40f5e2ed146806b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 23 Nov 2017 16:28:44 +0100 Subject: [PATCH 127/156] Temporalily ignore test failures on 32bit intel and aarch64 --- golang.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/golang.spec b/golang.spec index 363fb31..d40ba69 100644 --- a/golang.spec +++ b/golang.spec @@ -1,5 +1,11 @@ %bcond_with bootstrap +# temporalily ignore test failures +%ifarch %{ix86} aarch64 +%bcond_without ignore_tests +%else %bcond_with ignore_tests +%endif + # build ids are not currently generated: # https://code.google.com/p/go/issues/detail?id=5238 # From 4bc73c764a018dc6b5f0fb80f4b175358d90cc3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 6 Dec 2017 12:22:23 +0100 Subject: [PATCH 128/156] Add bundled provides --- golang.spec | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index d40ba69..1ae52f7 100644 --- a/golang.spec +++ b/golang.spec @@ -130,6 +130,29 @@ BuildRequires: net-tools BuildRequires: pcre-devel, glibc-static, perl-interpreter, procps-ng Provides: go = %{version}-%{release} + +# Bundled/Vendored provides +Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305)) +Provides: bundled(golang(golang.org/x/crypto/curve25519)) +Provides: bundled(golang(golang.org/x/crypto/poly1305)) +Provides: bundled(golang(golang.org/x/net/http2)) +Provides: bundled(golang(golang.org/x/net/http2/hpack)) +Provides: bundled(golang(golang.org/x/net/idna)) +Provides: bundled(golang(golang.org/x/net/lex)) +Provides: bundled(golang(golang.org/x/net/lex/httplex)) +Provides: bundled(golang(golang.org/x/net/lif)) +Provides: bundled(golang(golang.org/x/net/route)) +Provides: bundled(golang(golang.org/x/text/transform)) +Provides: bundled(golang(golang.org/x/text/unicode)) +Provides: bundled(golang(golang.org/x/text/unicode/norm)) +Provides: bundled(golang(golang.org/x/text/width)) +Provides: bundled(golang(golang.org/x/arch/arm)) +Provides: bundled(golang(golang.org/x/arch/arm/armasm)) +Provides: bundled(golang(golang.org/x/arch/ppc64)) +Provides: bundled(golang(golang.org/x/arch/ppc64/ppc64asm)) +Provides: bundled(golang(golang.org/x/arch/x86)) +Provides: bundled(golang(golang.org/x/arch/x86/x86asm)) + Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-src = %{version}-%{release} Requires: go-srpm-macros @@ -329,7 +352,7 @@ popd # build shared std lib %if %{shared} -GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared std +GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared -v -x std %endif %if %{race} From d37b3b5006518b65ba09728daa690caa39f0244f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 3 Jan 2018 13:22:17 +0100 Subject: [PATCH 129/156] Rebase to 1.10beta1 Drop verbose patch as most of it is now implemented by bootstrap tool and is easily toggled by passing -v flag to make.bash --- .gitignore | 1 + go1.5-zoneinfo_testing_only.patch | 79 +++++++++--- golang-1.10-pkgconfig-fix.patch | 155 ++++++++++++++++++++++++ golang-1.2-verbose-build.patch | 21 ---- golang.spec | 100 +++++++-------- s390x-ignore-L0syms.patch | 18 --- sources | 2 +- use-buildmode-pie-for-pie-testing.patch | 51 -------- use-no-pie-where-needed.patch | 63 ---------- 9 files changed, 273 insertions(+), 217 deletions(-) create mode 100644 golang-1.10-pkgconfig-fix.patch delete mode 100644 golang-1.2-verbose-build.patch delete mode 100644 s390x-ignore-L0syms.patch delete mode 100644 use-buildmode-pie-for-pie-testing.patch delete mode 100644 use-no-pie-where-needed.patch diff --git a/.gitignore b/.gitignore index 0b3a44f..89ba499 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ /go1.9.src.tar.gz /go1.9.1.src.tar.gz /go1.9.2.src.tar.gz +/go1.10beta1.src.tar.gz diff --git a/go1.5-zoneinfo_testing_only.patch b/go1.5-zoneinfo_testing_only.patch index 3e9cb5f..581cb94 100644 --- a/go1.5-zoneinfo_testing_only.patch +++ b/go1.5-zoneinfo_testing_only.patch @@ -1,21 +1,70 @@ -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{ +diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go +--- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go.time 2017-12-05 01:10:10.000000000 +0100 ++++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go 2017-12-05 14:55:10.574637475 +0100 +@@ -4,13 +4,15 @@ + + package time + ++import "runtime" ++ + func init() { + // force US/Pacific for time zone tests + ForceUSPacificForTesting() + } + + func initTestingZone() { +- z, err := loadLocation("America/Los_Angeles", zoneSources[len(zoneSources)-1:]) ++ z, err := loadLocation("America/Los_Angeles", zoneSources) + if err != nil { + panic("cannot load America/Los_Angeles for testing: " + err.Error()) + } +@@ -21,8 +23,9 @@ func initTestingZone() { + var OrigZoneSources = zoneSources + + func forceZipFileForTesting(zipOnly bool) { +- zoneSources = make([]string, len(OrigZoneSources)) ++ zoneSources = make([]string, len(OrigZoneSources)+1) + copy(zoneSources, OrigZoneSources) ++ zoneSources = append(zoneSources, runtime.GOROOT()+"/lib/time/zoneinfo.zip") + if zipOnly { + zoneSources = zoneSources[len(zoneSources)-1:] + } +diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go +--- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go.time 2017-12-05 01:10:10.000000000 +0100 ++++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go 2017-12-05 14:58:09.823109248 +0100 +@@ -8,6 +8,7 @@ import ( + "fmt" + "os" + "reflect" ++ "runtime" + "testing" + "time" + ) +@@ -128,7 +129,7 @@ func TestLoadLocationFromTZData(t *testi + t.Fatal(err) + } + +- tzinfo, err := time.LoadTzinfo(locationName, time.OrigZoneSources[len(time.OrigZoneSources)-1]) ++ tzinfo, err := time.LoadTzinfo(locationName, runtime.GOROOT()+"/lib/time/zoneinfo.zip") + if err != nil { + t.Fatal(err) + } +diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go +--- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go.time 2017-12-05 01:10:10.000000000 +0100 ++++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go 2017-12-05 14:55:10.574637475 +0100 +@@ -12,7 +12,6 @@ + package time + + import ( +- "runtime" + "syscall" + ) + +@@ -22,7 +21,6 @@ var zoneSources = []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" + func initLocal() { diff --git a/golang-1.10-pkgconfig-fix.patch b/golang-1.10-pkgconfig-fix.patch new file mode 100644 index 0000000..9236466 --- /dev/null +++ b/golang-1.10-pkgconfig-fix.patch @@ -0,0 +1,155 @@ +From b17b0c7d9b1d7bffd90a83fb887c66b421193eb8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jakub=20=C4=8Cajka?= +Date: Fri, 5 Jan 2018 13:38:55 +0100 +Subject: [PATCH] cmd/go/internal/work : improve pkgconfig support to work with + latest(1.4+) pkgconf + +Fixes #23373 + +Fix interfacing with latest(1.4+) pkgconf versions, as they have change the output format, by extending parsing function splitPkgConfigOutput to accommodate more possible fragment escaping formats. Function is based on pkgconfigs own implementation at https://github.com/pkgconf/pkgconf/blob/master/libpkgconf/argvsplit.c. Along with this change test case TestSplitPkgConfigOutput have been expanded. Thanks to ignatenko for help on test cases and insights in to the pkgconfig. + +Change-Id: I55301bb564b07128d5564ec1454dd247f84a95c3 +--- + src/cmd/go/internal/work/build_test.go | 15 ++++++- + src/cmd/go/internal/work/exec.go | 79 +++++++++++++++++++++++++--------- + 2 files changed, 72 insertions(+), 22 deletions(-) + +diff --git a/src/cmd/go/internal/work/build_test.go b/src/cmd/go/internal/work/build_test.go +index 3f5ba37c64..be9857ade7 100644 +--- a/src/cmd/go/internal/work/build_test.go ++++ b/src/cmd/go/internal/work/build_test.go +@@ -43,10 +43,23 @@ func TestSplitPkgConfigOutput(t *testing.T) { + {[]byte(`-r:foo -L/usr/white\ space/lib -lfoo\ bar -lbar\ baz`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}}, + {[]byte(`-lextra\ fun\ arg\\`), []string{`-lextra fun arg\`}}, + {[]byte(`broken flag\`), []string{"broken", "flag"}}, ++ {[]byte(`extra broken flag \`), []string{"extra", "broken", "flag"}}, + {[]byte("\textra whitespace\r\n"), []string{"extra", "whitespace"}}, + {[]byte(" \r\n "), nil}, ++ {[]byte(`"-r:foo" "-L/usr/white space/lib" "-lfoo bar" "-lbar baz"`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}}, ++ {[]byte(`"-lextra fun arg\\"`), []string{`-lextra fun arg\`}}, ++ {[]byte(`" \r\n "`), []string{` \r\n `}}, ++ {[]byte(`""`), nil}, ++ {[]byte(`-fPIC -I/test/include/foo -DQUOTED='"/test/share/doc"'`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=\"/test/share/doc\""}}, ++ {[]byte(`-fPIC -I/test/include/foo -DQUOTED="/test/share/doc"`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}}, ++ {[]byte(`-fPIC -I/test/include/foo -DQUOTED=\"/test/share/doc\"`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=\"/test/share/doc\""}}, ++ {[]byte(`-fPIC -I/test/include/foo -DQUOTED='/test/share/doc'`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}}, ++ {[]byte(`-Dhello=10 -Dworld=+32 -DDEFINED_FROM_PKG_CONFIG=hello\ world`), []string{"-Dhello=10", "-Dworld=+32", "-DDEFINED_FROM_PKG_CONFIG=hello world"}}, + } { +- got := splitPkgConfigOutput(test.in) ++ got, err := splitPkgConfigOutput(test.in) ++ if err != nil { ++ t.Errorf("splitPkgConfigOutput(%v) = %v; function returned error %v", test.in, got, err) ++ } + if !reflect.DeepEqual(got, test.want) { + t.Errorf("splitPkgConfigOutput(%v) = %v; want %v", test.in, got, test.want) + } +diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go +index 60e2a3aa48..c5a438aac9 100644 +--- a/src/cmd/go/internal/work/exec.go ++++ b/src/cmd/go/internal/work/exec.go +@@ -855,36 +855,67 @@ func (b *Builder) PkgconfigCmd() string { + } + + // splitPkgConfigOutput parses the pkg-config output into a slice of +-// flags. pkg-config always uses \ to escape special characters. +-func splitPkgConfigOutput(out []byte) []string { ++// flags. Implementing algorithm from pkgconf/libpkgconf/argvsplit.c ++func splitPkgConfigOutput(out []byte) ([]string, error) { + if len(out) == 0 { +- return nil ++ return nil, nil + } + var flags []string +- flag := make([]byte, len(out)) +- r, w := 0, 0 ++ flag := make([]byte, 0, len(out)) ++ r := 0 ++ escaped := false ++ var quote byte = 0 ++ + for r < len(out) { +- switch out[r] { +- case ' ', '\t', '\r', '\n': +- if w > 0 { +- flags = append(flags, string(flag[:w])) ++ if escaped { ++ if quote == '"' { ++ switch out[r] { ++ case '$', '`', '"', '\\': ++ default: ++ flag = append(flag, '\\') ++ } ++ flag = append(flag, out[r]) ++ } else { ++ flag = append(flag, out[r]) + } +- w = 0 +- case '\\': +- r++ +- fallthrough +- default: +- if r < len(out) { +- flag[w] = out[r] +- w++ ++ escaped = false ++ } else if quote != 0 { ++ if out[r] == quote { ++ quote = 0 ++ } else { ++ switch out[r] { ++ case '\\': ++ if quote == '\'' { ++ break ++ } ++ escaped = true ++ default: ++ flag = append(flag, out[r]) ++ } ++ } ++ } else if !(strings.IndexByte(" \t\n\v\f\r", out[r]) >= 0) { ++ switch out[r] { ++ case '\\': ++ escaped = true ++ case '\'', '"': ++ quote = out[r] ++ default: ++ flag = append(flag, out[r]) + } ++ } else if len(flag) != 0 { ++ flags = append(flags, string(flag)) ++ flag = flag[:0] + } + r++ + } +- if w > 0 { +- flags = append(flags, string(flag[:w])) ++ ++ if quote != 0 { ++ return flags, errors.New("unterminated quoted string in pkgconf output " + string(out)) ++ } else if len(flag) != 0 { ++ flags = append(flags, string(flag)) + } +- return flags ++ ++ return flags, nil + } + + // Calls pkg-config if needed and returns the cflags/ldflags needed to build the package. +@@ -899,7 +930,13 @@ func (b *Builder) getPkgConfigFlags(p *load.Package) (cflags, ldflags []string, + return + } + if len(out) > 0 { +- cflags = splitPkgConfigOutput(out) ++ cflags, err = splitPkgConfigOutput(out) ++ if err != nil { ++ b.showOutput(nil, p.Dir, b.PkgconfigCmd()+" --libs "+strings.Join(pkgs, " "), string(out)) ++ b.Print(err.Error() + "\n") ++ err = errPrintedOutput ++ return ++ } + } + out, err = b.runOut(p.Dir, p.ImportPath, nil, b.PkgconfigCmd(), "--libs", pkgs) + if err != nil { +-- +2.14.3 + diff --git a/golang-1.2-verbose-build.patch b/golang-1.2-verbose-build.patch deleted file mode 100644 index c9dbba2..0000000 --- a/golang-1.2-verbose-build.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up go/src/make.bash.verbose go/src/make.bash ---- go/src/make.bash.verbose 2017-07-11 12:00:09.513553508 +0200 -+++ go/src/make.bash 2017-07-11 12:01:25.288245720 +0200 -@@ -167,7 +167,7 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH - # 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 -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 - -@@ -175,7 +175,7 @@ echo "##### Building packages and comman - - old_bin_files=$(cd $GOROOT/bin && echo *) - --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 - - # Check that there are no new files in $GOROOT/bin other than go and gofmt - # and $GOOS_$GOARCH (a directory used when cross-compiling). diff --git a/golang.spec b/golang.spec index 1ae52f7..bb3fdee 100644 --- a/golang.spec +++ b/golang.spec @@ -101,12 +101,12 @@ %global gohostarch s390x %endif -%global go_api 1.9 -%global go_version 1.9.2 +%global go_api 1.10 +%global go_version 1.10beta1 Name: golang -Version: 1.9.2 -Release: 1%{?dist} +Version: 1.10 +Release: 0.beta1.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -131,37 +131,50 @@ BuildRequires: pcre-devel, glibc-static, perl-interpreter, procps-ng Provides: go = %{version}-%{release} -# Bundled/Vendored provides -Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305)) -Provides: bundled(golang(golang.org/x/crypto/curve25519)) -Provides: bundled(golang(golang.org/x/crypto/poly1305)) -Provides: bundled(golang(golang.org/x/net/http2)) -Provides: bundled(golang(golang.org/x/net/http2/hpack)) -Provides: bundled(golang(golang.org/x/net/idna)) -Provides: bundled(golang(golang.org/x/net/lex)) -Provides: bundled(golang(golang.org/x/net/lex/httplex)) -Provides: bundled(golang(golang.org/x/net/lif)) -Provides: bundled(golang(golang.org/x/net/route)) -Provides: bundled(golang(golang.org/x/text/transform)) -Provides: bundled(golang(golang.org/x/text/unicode)) -Provides: bundled(golang(golang.org/x/text/unicode/norm)) -Provides: bundled(golang(golang.org/x/text/width)) -Provides: bundled(golang(golang.org/x/arch/arm)) -Provides: bundled(golang(golang.org/x/arch/arm/armasm)) -Provides: bundled(golang(golang.org/x/arch/ppc64)) -Provides: bundled(golang(golang.org/x/arch/ppc64/ppc64asm)) -Provides: bundled(golang(golang.org/x/arch/x86)) -Provides: bundled(golang(golang.org/x/arch/x86/x86asm)) +# Bundled/Vendored provides generated by +# go list -f {{.ImportPath}} ./src/vendor/... | sed "s:_$PWD/src/vendor/::g;s:_:.:;s:.*:Provides\: bundled(golang(&)):" && go list -f {{.ImportPath}} ./src/cmd/vendor/... | sed "s:_$PWD/src/cmd/vendor/::g;s:_:.:;s:.*:Provides\: bundled(golang(&)):" +Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305)) +Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305/internal/chacha20)) +Provides: bundled(golang(golang.org/x/crypto/cryptobyte)) +Provides: bundled(golang(golang.org/x/crypto/cryptobyte/asn1)) +Provides: bundled(golang(golang.org/x/crypto/curve25519)) +Provides: bundled(golang(golang.org/x/crypto/poly1305)) +Provides: bundled(golang(golang.org/x/net/http2/hpack)) +Provides: bundled(golang(golang.org/x/net/idna)) +Provides: bundled(golang(golang.org/x/net/internal/nettest)) +Provides: bundled(golang(golang.org/x/net/lex/httplex)) +Provides: bundled(golang(golang.org/x/net/nettest)) +Provides: bundled(golang(golang.org/x/net/proxy)) +Provides: bundled(golang(golang.org/x/text/secure)) +Provides: bundled(golang(golang.org/x/text/secure/bidirule)) +Provides: bundled(golang(golang.org/x/text/transform)) +Provides: bundled(golang(golang.org/x/text/unicode)) +Provides: bundled(golang(golang.org/x/text/unicode/bidi)) +Provides: bundled(golang(golang.org/x/text/unicode/norm)) +Provides: bundled(golang(github.com/google/pprof)) +Provides: bundled(golang(github.com/google/pprof/driver)) +Provides: bundled(golang(github.com/google/pprof/internal/binutils)) +Provides: bundled(golang(github.com/google/pprof/internal/driver)) +Provides: bundled(golang(github.com/google/pprof/internal/elfexec)) +Provides: bundled(golang(github.com/google/pprof/internal/graph)) +Provides: bundled(golang(github.com/google/pprof/internal/measurement)) +Provides: bundled(golang(github.com/google/pprof/internal/plugin)) +Provides: bundled(golang(github.com/google/pprof/internal/proftest)) +Provides: bundled(golang(github.com/google/pprof/internal/report)) +Provides: bundled(golang(github.com/google/pprof/internal/symbolizer)) +Provides: bundled(golang(github.com/google/pprof/internal/symbolz)) +Provides: bundled(golang(github.com/google/pprof/profile)) +Provides: bundled(golang(github.com/google/pprof/third.party/svg)) +Provides: bundled(golang(github.com/ianlancetaylor/demangle)) +Provides: bundled(golang(golang.org/x/arch/arm/armasm)) +Provides: bundled(golang(golang.org/x/arch/arm64/arm64asm)) +Provides: bundled(golang(golang.org/x/arch/ppc64/ppc64asm)) +Provides: bundled(golang(golang.org/x/arch/x86/x86asm)) Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-src = %{version}-%{release} Requires: go-srpm-macros -Patch0: golang-1.2-verbose-build.patch - -# use the arch dependent path in the bootstrap -Patch212: golang-1.5-bootstrap-binary-path.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 @@ -169,12 +182,8 @@ Patch215: ./go1.5-zoneinfo_testing_only.patch # Proposed patch by mmunday https://golang.org/cl/35262 Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch -Patch220: s390x-ignore-L0syms.patch - -# https://github.com/golang/go/commit/ca8c361d867d62bd46013c5abbaaad0b2ca6077f -Patch221: use-buildmode-pie-for-pie-testing.patch -# https://github.com/hyangah/go/commit/3502496d03bcd842fd7aac95ec0d7096d581cd26 -Patch222: use-no-pie-where-needed.patch +# Proposed patch by jcajka https://golang.org/cl/86541 +Patch221: golang-1.10-pkgconfig-fix.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -297,20 +306,11 @@ Requires: %{name} = %{version}-%{release} %prep %setup -q -n go -# increase verbosity of build -%patch0 -p1 -b .verbose - -# use the arch dependent path in the bootstrap -%patch212 -p1 -b .bootstrap - %patch215 -p1 %patch219 -p1 -%patch220 -p1 - -%patch221 -p1 -b pie -%patch222 -p1 +%patch221 -p1 cp %{SOURCE1} ./src/runtime/ @@ -347,7 +347,7 @@ export GO_LDFLAGS="-linkmode internal" %if !%{cgo_enabled} export CGO_ENABLED=0 %endif -./make.bash --no-clean +./make.bash --no-clean -v popd # build shared std lib @@ -356,7 +356,7 @@ GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -buildmode=shared -v -x std %endif %if %{race} -GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race std +GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race -v -x std %endif %install @@ -547,6 +547,10 @@ fi %endif %changelog +* Mon Jan 08 2018 Jakub Čajka - 1.9.2-0.beta1.1 +- Rebase to 1.10beta1 +- Drop verbose patch as most of it is now implemented by bootstrap tool and is easily toggled by passing -v flag to make.bash + * Thu Oct 26 2017 Jakub Čajka - 1.9.2-1 - Rebase to 1.9.2 - execute correctly pie tests diff --git a/s390x-ignore-L0syms.patch b/s390x-ignore-L0syms.patch deleted file mode 100644 index a6c65e0..0000000 --- a/s390x-ignore-L0syms.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/cmd/link/internal/ld/ldelf.go b/src/cmd/link/internal/ld/ldelf.go -index d4f9fc4..87dabaa 100644 ---- a/src/cmd/link/internal/ld/ldelf.go -+++ b/src/cmd/link/internal/ld/ldelf.go -@@ -799,6 +799,13 @@ func ldelf(ctxt *Link, f *bio.Reader, pkg string, length int64, pn string) { - continue - } - -+ if sect.name == ".debug_str" && sym.name == "L0" && sym.type_ == 0 { -+ // introduced by https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=49fced1206db40c71208c201165d65f92c69cebe on s390x -+ // TODO investigate from where they are actually coming from, could be possible issue with elf parsing as seeing 0x1 in name is weird -+ // See issue https://github.com/golang/go/issues/20996 -+ continue -+ } -+ - if strings.HasPrefix(sym.name, ".LASF") { // gcc on s390x does this - continue - } diff --git a/sources b/sources index 757bcda..d7beae5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.9.2.src.tar.gz) = 1034098575c317eeaf648629690a4dea0c479a69c3b80d9917f6b96c8781ce79c0f29859f667dc4e07d47a44972aa09bd0163a458f897cf45f9d09eb03e4abb5 +SHA512 (go1.10beta1.src.tar.gz) = ad479336f2ad90ca3dfb782e96c954d3c876fac69664666310817e31b471b6591f983aa8ab8eb321be8354fb0de7f5a901c10a192a06333535ccaebc14184d9b diff --git a/use-buildmode-pie-for-pie-testing.patch b/use-buildmode-pie-for-pie-testing.patch deleted file mode 100644 index 9f0db0e..0000000 --- a/use-buildmode-pie-for-pie-testing.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff -up go/src/cmd/dist/test.go.pie go/src/cmd/dist/test.go ---- go/src/cmd/dist/test.go.pie 2017-10-25 20:30:21.000000000 +0200 -+++ go/src/cmd/dist/test.go 2017-11-03 16:47:55.290829798 +0100 -@@ -852,6 +852,16 @@ func (t *tester) supportedBuildmode(mode - return true - } - return false -+ case "pie": -+ switch pair { -+ case "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-s390x", -+ "android-amd64", "android-arm", "android-arm64", "android-386": -+ return true -+ case "darwin-amd64": -+ return true -+ } -+ return false -+ - default: - log.Fatalf("internal error: unknown buildmode %s", mode) - return false -@@ -953,24 +963,16 @@ func (t *tester) cgoTest(dt *distTest) e - } - } - -- if pair != "freebsd-amd64" { // clang -pie fails to link misc/cgo/test -- cmd := t.dirCmd("misc/cgo/test", -- cc, "-xc", "-o", "/dev/null", "-pie", "-") -+ if t.supportedBuildmode("pie") { -+ cmd = t.addCmd(dt, "misc/cgo/test", "go", "test", "-buildmode=pie") - cmd.Env = env -- cmd.Stdin = strings.NewReader("int main() {}") -- if err := cmd.Run(); err != nil { -- fmt.Println("No support for -pie found, skip cgo PIE test.") -- } else { -- cmd = t.addCmd(dt, "misc/cgo/test", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`) -- cmd.Env = env - -- cmd = t.addCmd(dt, "misc/cgo/testtls", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`) -- cmd.Env = env -+ cmd = t.addCmd(dt, "misc/cgo/testtls", "go", "test", "-buildmode=pie") -+ cmd.Env = env - -- cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`) -- cmd.Env = env -+ cmd = t.addCmd(dt, "misc/cgo/nocgo", "go", "test", "-buildmode=pie") -+ cmd.Env = env - -- } - } - } - } diff --git a/use-no-pie-where-needed.patch b/use-no-pie-where-needed.patch deleted file mode 100644 index e970498..0000000 --- a/use-no-pie-where-needed.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 3502496d03bcd842fd7aac95ec0d7096d581cd26 Mon Sep 17 00:00:00 2001 -From: Lynn Boger -Date: Wed, 11 Oct 2017 16:02:59 -0400 -Subject: [PATCH] misc/cgo/testcarchive: use -no-pie where needed - -Starting in gcc 6, -pie is passed to the linker by default -on some platforms, including ppc64le. If the objects -being linked are not built for -pie then in some cases the -executable could be in error. To avoid that problem, -no-pie -should be used with gcc to override the default -pie option -and generate a correct executable that can be run without error. - -Fixes #22126 - -Change-Id: I4a052bba8b9b3bd6706f5d27ca9a7cebcb504c95 -Reviewed-on: https://go-review.googlesource.com/70072 -Run-TryBot: Lynn Boger -TryBot-Result: Gobot Gobot -Reviewed-by: Ian Lance Taylor ---- - misc/cgo/testcarchive/carchive_test.go | 20 +++++++++++++++++++- - 1 file changed, 19 insertions(+), 1 deletion(-) - -diff --git a/misc/cgo/testcarchive/carchive_test.go b/misc/cgo/testcarchive/carchive_test.go -index b5123154e79..ac637c06007 100644 ---- a/misc/cgo/testcarchive/carchive_test.go -+++ b/misc/cgo/testcarchive/carchive_test.go -@@ -6,6 +6,7 @@ package carchive_test - - import ( - "bufio" -+ "bytes" - "debug/elf" - "fmt" - "io/ioutil" -@@ -609,9 +610,26 @@ func TestCompileWithoutShared(t *testing.T) { - } - - exe := "./testnoshared" + exeSuffix -- ccArgs := append(cc, "-o", exe, "main5.c", "libgo2.a") -+ -+ // In some cases, -no-pie is needed here, but not accepted everywhere. First try -+ // if -no-pie is accepted. See #22126. -+ ccArgs := append(cc, "-o", exe, "-no-pie", "main5.c", "libgo2.a") - t.Log(ccArgs) - out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput() -+ -+ // If -no-pie unrecognized, try -nopie if this is possibly clang -+ if err != nil && bytes.Contains(out, []byte("unknown")) && !strings.Contains(cc[0], "gcc") { -+ ccArgs = append(cc, "-o", exe, "-nopie", "main5.c", "libgo2.a") -+ t.Log(ccArgs) -+ out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput() -+ } -+ -+ // Don't use either -no-pie or -nopie -+ if err != nil && bytes.Contains(out, []byte("unrecognized")) { -+ ccArgs := append(cc, "-o", exe, "main5.c", "libgo2.a") -+ t.Log(ccArgs) -+ out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput() -+ } - t.Logf("%s", out) - if err != nil { - t.Fatal(err) From 77baa559ba498f05501cfbdbd754c7b8af06dee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 12 Jan 2018 12:47:23 +0100 Subject: [PATCH 130/156] Rebase to 1.10beta2 --- .gitignore | 1 + golang.spec | 9 ++++++--- sources | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 89ba499..e53fa09 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ /go1.9.1.src.tar.gz /go1.9.2.src.tar.gz /go1.10beta1.src.tar.gz +/go1.10beta2.src.tar.gz diff --git a/golang.spec b/golang.spec index bb3fdee..6719222 100644 --- a/golang.spec +++ b/golang.spec @@ -102,11 +102,11 @@ %endif %global go_api 1.10 -%global go_version 1.10beta1 +%global go_version 1.10beta2 Name: golang Version: 1.10 -Release: 0.beta1.1%{?dist} +Release: 0.beta2.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -547,7 +547,10 @@ fi %endif %changelog -* Mon Jan 08 2018 Jakub Čajka - 1.9.2-0.beta1.1 +* Fri Jan 12 2018 Jakub Čajka - 1.10-0.beta2.1 +- Rebase to 1.10beta2 + +* Mon Jan 08 2018 Jakub Čajka - 1.10-0.beta1.1 - Rebase to 1.10beta1 - Drop verbose patch as most of it is now implemented by bootstrap tool and is easily toggled by passing -v flag to make.bash diff --git a/sources b/sources index d7beae5..905dccd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.10beta1.src.tar.gz) = ad479336f2ad90ca3dfb782e96c954d3c876fac69664666310817e31b471b6591f983aa8ab8eb321be8354fb0de7f5a901c10a192a06333535ccaebc14184d9b +SHA512 (go1.10beta2.src.tar.gz) = 7719dd542e0d49cba89aedd356edb521268f8370876fe6aff780683931c7d0c4256d4a141f06b17337050a850fc26732913532bd71290329ab7cd5a0830a79ae From 9ca117e19c457f39daa5b393556e298f12d351ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 26 Jan 2018 10:36:57 +0100 Subject: [PATCH 131/156] Rebase to 1.9.3 --- .gitignore | 1 + golang.spec | 43 +++++++++++++++++++++++++++++++++++++++++-- sources | 2 +- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0b3a44f..7edd558 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ /go1.9.src.tar.gz /go1.9.1.src.tar.gz /go1.9.2.src.tar.gz +/go1.9.3.src.tar.gz diff --git a/golang.spec b/golang.spec index 363fb31..59acbf5 100644 --- a/golang.spec +++ b/golang.spec @@ -96,10 +96,10 @@ %endif %global go_api 1.9 -%global go_version 1.9.2 +%global go_version 1.9.3 Name: golang -Version: 1.9.2 +Version: 1.9.3 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -124,6 +124,42 @@ BuildRequires: net-tools BuildRequires: pcre-devel, glibc-static, perl-interpreter, procps-ng Provides: go = %{version}-%{release} + +# go list -f {{.ImportPath}} ./src/vendor/... | sed "s:_$PWD/src/vendor/::g;s:_:.:;s:.*:Provides\: bundled(golang(&)):" && go list -f {{.ImportPath}} ./src/cmd/vendor/... | sed "s:_$PWD/src/cmd/vendor/::g;s:_:.:;s:.*:Provides\: bundled(golang(&)):" +Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305)) +Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305/internal/chacha20)) +Provides: bundled(golang(golang.org/x/crypto/curve25519)) +Provides: bundled(golang(golang.org/x/crypto/poly1305)) +Provides: bundled(golang(golang.org/x/net/http2/hpack)) +Provides: bundled(golang(golang.org/x/net/idna)) +Provides: bundled(golang(golang.org/x/net/lex/httplex)) +Provides: bundled(golang(golang.org/x/net/nettest)) +Provides: bundled(golang(golang.org/x/net/proxy)) +Provides: bundled(golang(golang.org/x/text/secure)) +Provides: bundled(golang(golang.org/x/text/secure/bidirule)) +Provides: bundled(golang(golang.org/x/text/transform)) +Provides: bundled(golang(golang.org/x/text/unicode)) +Provides: bundled(golang(golang.org/x/text/unicode/bidi)) +Provides: bundled(golang(golang.org/x/text/unicode/norm)) +Provides: bundled(golang(github.com/google/pprof)) +Provides: bundled(golang(github.com/google/pprof/driver)) +Provides: bundled(golang(github.com/google/pprof/internal/binutils)) +Provides: bundled(golang(github.com/google/pprof/internal/driver)) +Provides: bundled(golang(github.com/google/pprof/internal/elfexec)) +Provides: bundled(golang(github.com/google/pprof/internal/graph)) +Provides: bundled(golang(github.com/google/pprof/internal/measurement)) +Provides: bundled(golang(github.com/google/pprof/internal/plugin)) +Provides: bundled(golang(github.com/google/pprof/internal/proftest)) +Provides: bundled(golang(github.com/google/pprof/internal/report)) +Provides: bundled(golang(github.com/google/pprof/internal/symbolizer)) +Provides: bundled(golang(github.com/google/pprof/internal/symbolz)) +Provides: bundled(golang(github.com/google/pprof/profile)) +Provides: bundled(golang(github.com/google/pprof/third.party/svg)) +Provides: bundled(golang(github.com/ianlancetaylor/demangle)) +Provides: bundled(golang(golang.org/x/arch/arm/armasm)) +Provides: bundled(golang(golang.org/x/arch/ppc64/ppc64asm)) +Provides: bundled(golang(golang.org/x/arch/x86/x86asm)) + Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-src = %{version}-%{release} Requires: go-srpm-macros @@ -518,6 +554,9 @@ fi %endif %changelog +* Fri Jan 26 2018 Jakub Čajka - 1.9.3-1 +- Rebase to 1.9.3 + * Thu Oct 26 2017 Jakub Čajka - 1.9.2-1 - Rebase to 1.9.2 - execute correctly pie tests diff --git a/sources b/sources index 757bcda..f19f9a1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.9.2.src.tar.gz) = 1034098575c317eeaf648629690a4dea0c479a69c3b80d9917f6b96c8781ce79c0f29859f667dc4e07d47a44972aa09bd0163a458f897cf45f9d09eb03e4abb5 +SHA512 (go1.9.3.src.tar.gz) = 31c564af58b78c648c9bece8fa2ed3334feb80316b07b16f6286319e26d317da90d1af0464c3a2f776a3da72d31b22b063dbc620b93114bf142a11e8a625e527 From 63e3cb4201c618bf4be45912252d99cf3941ae98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Sat, 27 Jan 2018 09:34:18 +0100 Subject: [PATCH 132/156] Rebase to 1.10rc1 --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e53fa09..8091eb9 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ /go1.9.2.src.tar.gz /go1.10beta1.src.tar.gz /go1.10beta2.src.tar.gz +/go1.10rc1.src.tar.gz diff --git a/golang.spec b/golang.spec index 6719222..999c23a 100644 --- a/golang.spec +++ b/golang.spec @@ -102,11 +102,11 @@ %endif %global go_api 1.10 -%global go_version 1.10beta2 +%global go_version 1.10rc1 Name: golang Version: 1.10 -Release: 0.beta2.1%{?dist} +Release: 0.rc1.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -547,6 +547,9 @@ fi %endif %changelog +* Fri Jan 26 2018 Jakub Čajka - 1.10-0.rc1.1 +- Rebase to 1.10rc1 + * Fri Jan 12 2018 Jakub Čajka - 1.10-0.beta2.1 - Rebase to 1.10beta2 diff --git a/sources b/sources index 905dccd..2fc6058 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.10beta2.src.tar.gz) = 7719dd542e0d49cba89aedd356edb521268f8370876fe6aff780683931c7d0c4256d4a141f06b17337050a850fc26732913532bd71290329ab7cd5a0830a79ae +SHA512 (go1.10rc1.src.tar.gz) = 097fae8c161338922bd1b5e6d8e990eaa47aaa034daab56a2d8edc7a1750bfcc16d80fb5a4b2a5a9b444d29cdc926d0cfaf258052e6b891abd634c37edcd0421 From 13bb238b09560fb75c34b0d5e0d28fdf2c1bedfc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 7 Feb 2018 13:48:58 +0000 Subject: [PATCH 133/156] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 999c23a..23ed049 100644 --- a/golang.spec +++ b/golang.spec @@ -106,7 +106,7 @@ Name: golang Version: 1.10 -Release: 0.rc1.1%{?dist} +Release: 0.rc1.1%{?dist}.1 Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -547,6 +547,9 @@ fi %endif %changelog +* Wed Feb 07 2018 Fedora Release Engineering - 1.10-0.rc1.1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Fri Jan 26 2018 Jakub Čajka - 1.10-0.rc1.1 - Rebase to 1.10rc1 From 5abf0c8166f62eb45111b6bb3474d171984ddad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 8 Feb 2018 15:04:08 +0100 Subject: [PATCH 134/156] Rebase to 1.9.4 Fix CVE-2018-6574 Resolves: BZ#1543561, BZ#1543562 --- .gitignore | 1 + golang.spec | 9 +++++++-- sources | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7edd558..cc45de7 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ /go1.9.1.src.tar.gz /go1.9.2.src.tar.gz /go1.9.3.src.tar.gz +/go1.9.4.src.tar.gz diff --git a/golang.spec b/golang.spec index 59acbf5..f086f33 100644 --- a/golang.spec +++ b/golang.spec @@ -96,10 +96,10 @@ %endif %global go_api 1.9 -%global go_version 1.9.3 +%global go_version 1.9.4 Name: golang -Version: 1.9.3 +Version: 1.9.4 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -554,6 +554,11 @@ fi %endif %changelog +* Thu Feb 08 2018 Jakub Čajka - 1.9.4-1 +- Rebase to 1.9.4 +- Fix CVE-2018-6574 +- Resolves: BZ#1543561, BZ#1543562 + * Fri Jan 26 2018 Jakub Čajka - 1.9.3-1 - Rebase to 1.9.3 diff --git a/sources b/sources index f19f9a1..06e4a51 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.9.3.src.tar.gz) = 31c564af58b78c648c9bece8fa2ed3334feb80316b07b16f6286319e26d317da90d1af0464c3a2f776a3da72d31b22b063dbc620b93114bf142a11e8a625e527 +SHA512 (go1.9.4.src.tar.gz) = 1a7c830e07507ff7b89025adfb5c713444d97301f8ad47ef2564722c1e28186e946350f07e22777fbdd6f2f589c334eb01dfd589e97cb8a86f73669547badb0b From 5f45ed12c2e39f247a0f70bdf5bd44f6211dfc94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 8 Feb 2018 14:50:08 +0100 Subject: [PATCH 135/156] Rebase to 1.10rc2 Fix CVE-2018-6574 Resolves: BZ#1543561, BZ#1543562 --- .gitignore | 1 + golang-1.10-pkgconfig-fix.patch | 138 ++++++++++++++++++-------------- golang.spec | 9 ++- sources | 2 +- 4 files changed, 89 insertions(+), 61 deletions(-) diff --git a/.gitignore b/.gitignore index 8091eb9..e73d6c9 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ /go1.10beta1.src.tar.gz /go1.10beta2.src.tar.gz /go1.10rc1.src.tar.gz +/go1.10rc2.src.tar.gz diff --git a/golang-1.10-pkgconfig-fix.patch b/golang-1.10-pkgconfig-fix.patch index 9236466..24f454a 100644 --- a/golang-1.10-pkgconfig-fix.patch +++ b/golang-1.10-pkgconfig-fix.patch @@ -1,4 +1,4 @@ -From b17b0c7d9b1d7bffd90a83fb887c66b421193eb8 Mon Sep 17 00:00:00 2001 +From 09581ca4826b6d67b1c3a3c8597038b28a37f52d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 5 Jan 2018 13:38:55 +0100 Subject: [PATCH] cmd/go/internal/work : improve pkgconfig support to work with @@ -10,50 +10,78 @@ Fix interfacing with latest(1.4+) pkgconf versions, as they have change the outp Change-Id: I55301bb564b07128d5564ec1454dd247f84a95c3 --- - src/cmd/go/internal/work/build_test.go | 15 ++++++- - src/cmd/go/internal/work/exec.go | 79 +++++++++++++++++++++++++--------- - 2 files changed, 72 insertions(+), 22 deletions(-) + src/cmd/go/internal/work/build_test.go | 44 +++++++++++++++++--- + src/cmd/go/internal/work/exec.go | 75 +++++++++++++++++++++++----------- + 2 files changed, 90 insertions(+), 29 deletions(-) diff --git a/src/cmd/go/internal/work/build_test.go b/src/cmd/go/internal/work/build_test.go -index 3f5ba37c64..be9857ade7 100644 +index 3f5ba37c64..c3c63a97a4 100644 --- a/src/cmd/go/internal/work/build_test.go +++ b/src/cmd/go/internal/work/build_test.go -@@ -43,10 +43,23 @@ func TestSplitPkgConfigOutput(t *testing.T) { - {[]byte(`-r:foo -L/usr/white\ space/lib -lfoo\ bar -lbar\ baz`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}}, - {[]byte(`-lextra\ fun\ arg\\`), []string{`-lextra fun arg\`}}, - {[]byte(`broken flag\`), []string{"broken", "flag"}}, -+ {[]byte(`extra broken flag \`), []string{"extra", "broken", "flag"}}, - {[]byte("\textra whitespace\r\n"), []string{"extra", "whitespace"}}, - {[]byte(" \r\n "), nil}, -+ {[]byte(`"-r:foo" "-L/usr/white space/lib" "-lfoo bar" "-lbar baz"`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}}, -+ {[]byte(`"-lextra fun arg\\"`), []string{`-lextra fun arg\`}}, -+ {[]byte(`" \r\n "`), []string{` \r\n `}}, -+ {[]byte(`""`), nil}, -+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED='"/test/share/doc"'`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=\"/test/share/doc\""}}, -+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED="/test/share/doc"`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}}, -+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED=\"/test/share/doc\"`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=\"/test/share/doc\""}}, -+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED='/test/share/doc'`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}}, -+ {[]byte(`-Dhello=10 -Dworld=+32 -DDEFINED_FROM_PKG_CONFIG=hello\ world`), []string{"-Dhello=10", "-Dworld=+32", "-DDEFINED_FROM_PKG_CONFIG=hello world"}}, +@@ -39,14 +39,46 @@ func TestSplitPkgConfigOutput(t *testing.T) { + for _, test := range []struct { + in []byte + want []string ++ pass bool + }{ +- {[]byte(`-r:foo -L/usr/white\ space/lib -lfoo\ bar -lbar\ baz`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}}, +- {[]byte(`-lextra\ fun\ arg\\`), []string{`-lextra fun arg\`}}, +- {[]byte(`broken flag\`), []string{"broken", "flag"}}, +- {[]byte("\textra whitespace\r\n"), []string{"extra", "whitespace"}}, +- {[]byte(" \r\n "), nil}, ++ {[]byte(`-r:foo -L/usr/white\ space/lib -lfoo\ bar -lbar\ baz`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}, true}, ++ {[]byte(`-lextra\ fun\ arg\\`), []string{`-lextra fun arg\`}, true}, ++ {[]byte(`broken flag\`), []string{"broken", "flag"}, true}, ++ {[]byte(`extra broken flag \`), []string{"extra", "broken", "flag"}, true}, ++ {[]byte(`\`), nil, true}, ++ {[]byte("\textra whitespace\r\n"), []string{"extra", "whitespace"}, true}, ++ {[]byte(" \r\n "), nil, true}, ++ {[]byte(`"-r:foo" "-L/usr/white space/lib" "-lfoo bar" "-lbar baz"`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}, true}, ++ {[]byte(`"-lextra fun arg\\"`), []string{`-lextra fun arg\`}, true}, ++ {[]byte(`" \r\n\ "`), []string{` \r\n\ `}, true}, ++ {[]byte(`""`), nil, true}, ++ {[]byte(``), nil, true}, ++ {[]byte(`"\\"`), []string{`\`}, true}, ++ {[]byte(`"\x"`), []string{`\x`}, true}, ++ {[]byte(`"\\x"`), []string{`\x`}, true}, ++ {[]byte(`'\\'`), []string{`\`}, true}, ++ {[]byte(`'\x'`), []string{`\x`}, true}, ++ {[]byte(`"\\x"`), []string{`\x`}, true}, ++ {[]byte(`-fPIC -I/test/include/foo -DQUOTED='"/test/share/doc"'`), []string{"-fPIC", "-I/test/include/foo", `-DQUOTED="/test/share/doc"`}, true}, ++ {[]byte(`-fPIC -I/test/include/foo -DQUOTED="/test/share/doc"`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}, true}, ++ {[]byte(`-fPIC -I/test/include/foo -DQUOTED=\"/test/share/doc\"`), []string{"-fPIC", "-I/test/include/foo", `-DQUOTED="/test/share/doc"`}, true}, ++ {[]byte(`-fPIC -I/test/include/foo -DQUOTED='/test/share/doc'`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}, true}, ++ {[]byte(`-DQUOTED='/te\st/share/d\oc'`), []string{`-DQUOTED=/te\st/share/d\oc`}, true}, ++ {[]byte(`-Dhello=10 -Dworld=+32 -DDEFINED_FROM_PKG_CONFIG=hello\ world`), []string{"-Dhello=10", "-Dworld=+32", "-DDEFINED_FROM_PKG_CONFIG=hello world"}, true}, ++ {[]byte(`" \r\n `), nil, false}, ++ {[]byte(`"-r:foo" "-L/usr/white space/lib "-lfoo bar" "-lbar baz"`), nil, false}, ++ {[]byte(`"-lextra fun arg\\`), nil, false}, } { - got := splitPkgConfigOutput(test.in) + got, err := splitPkgConfigOutput(test.in) + if err != nil { -+ t.Errorf("splitPkgConfigOutput(%v) = %v; function returned error %v", test.in, got, err) ++ if test.pass { ++ t.Errorf("splitPkgConfigOutput(%v) = %v; function returned error %v", test.in, got, err) ++ } ++ if got != nil { ++ t.Errorf("splitPkgConfigOutput failed with error %v and output has been non nil %v", err, got) ++ } ++ continue + } if !reflect.DeepEqual(got, test.want) { t.Errorf("splitPkgConfigOutput(%v) = %v; want %v", test.in, got, test.want) } diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go -index 60e2a3aa48..c5a438aac9 100644 +index a5ab75f6a8..8774be1385 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go -@@ -855,36 +855,67 @@ func (b *Builder) PkgconfigCmd() string { +@@ -900,36 +900,62 @@ func (b *Builder) PkgconfigCmd() string { } // splitPkgConfigOutput parses the pkg-config output into a slice of -// flags. pkg-config always uses \ to escape special characters. -func splitPkgConfigOutput(out []byte) []string { -+// flags. Implementing algorithm from pkgconf/libpkgconf/argvsplit.c ++// flags. This implements the algorithm from pkgconf/libpkgconf/argvsplit.c +func splitPkgConfigOutput(out []byte) ([]string, error) { if len(out) == 0 { - return nil @@ -62,26 +90,26 @@ index 60e2a3aa48..c5a438aac9 100644 var flags []string - flag := make([]byte, len(out)) - r, w := 0, 0 -+ flag := make([]byte, 0, len(out)) -+ r := 0 -+ escaped := false -+ var quote byte = 0 -+ - for r < len(out) { +- for r < len(out) { - switch out[r] { - case ' ', '\t', '\r', '\n': - if w > 0 { - flags = append(flags, string(flag[:w])) ++ flag := make([]byte, 0, len(out)) ++ escaped := false ++ quote := byte(0) ++ ++ for _, c := range out { + if escaped { -+ if quote == '"' { -+ switch out[r] { ++ if quote == '"' || quote == '\'' { ++ switch c { + case '$', '`', '"', '\\': + default: + flag = append(flag, '\\') + } -+ flag = append(flag, out[r]) ++ flag = append(flag, c) + } else { -+ flag = append(flag, out[r]) ++ flag = append(flag, c) } - w = 0 - case '\\': @@ -93,39 +121,36 @@ index 60e2a3aa48..c5a438aac9 100644 - w++ + escaped = false + } else if quote != 0 { -+ if out[r] == quote { ++ if c == quote { + quote = 0 + } else { -+ switch out[r] { ++ switch c { + case '\\': -+ if quote == '\'' { -+ break -+ } + escaped = true + default: -+ flag = append(flag, out[r]) ++ flag = append(flag, c) + } -+ } -+ } else if !(strings.IndexByte(" \t\n\v\f\r", out[r]) >= 0) { -+ switch out[r] { + } ++ } else if strings.IndexByte(" \t\n\v\f\r", c) < 0 { ++ switch c { + case '\\': + escaped = true + case '\'', '"': -+ quote = out[r] ++ quote = c + default: -+ flag = append(flag, out[r]) - } ++ flag = append(flag, c) ++ } + } else if len(flag) != 0 { + flags = append(flags, string(flag)) + flag = flag[:0] } - r++ +- r++ } - if w > 0 { - flags = append(flags, string(flag[:w])) + + if quote != 0 { -+ return flags, errors.New("unterminated quoted string in pkgconf output " + string(out)) ++ return nil, errors.New("unterminated quoted string in pkgconf output ") + } else if len(flag) != 0 { + flags = append(flags, string(flag)) } @@ -135,21 +160,18 @@ index 60e2a3aa48..c5a438aac9 100644 } // Calls pkg-config if needed and returns the cflags/ldflags needed to build the package. -@@ -899,7 +930,13 @@ func (b *Builder) getPkgConfigFlags(p *load.Package) (cflags, ldflags []string, - return +@@ -948,7 +974,10 @@ func (b *Builder) getPkgConfigFlags(p *load.Package) (cflags, ldflags []string, + return nil, nil, errPrintedOutput } if len(out) > 0 { - cflags = splitPkgConfigOutput(out) + cflags, err = splitPkgConfigOutput(out) + if err != nil { -+ b.showOutput(nil, p.Dir, b.PkgconfigCmd()+" --libs "+strings.Join(pkgs, " "), string(out)) -+ b.Print(err.Error() + "\n") -+ err = errPrintedOutput -+ return ++ return nil, nil, err + } - } - out, err = b.runOut(p.Dir, p.ImportPath, nil, b.PkgconfigCmd(), "--libs", pkgs) - if err != nil { + if err := checkCompilerFlags("CFLAGS", "pkg-config --cflags", cflags); err != nil { + return nil, nil, err + } -- 2.14.3 diff --git a/golang.spec b/golang.spec index 23ed049..b078d8b 100644 --- a/golang.spec +++ b/golang.spec @@ -102,11 +102,11 @@ %endif %global go_api 1.10 -%global go_version 1.10rc1 +%global go_version 1.10rc2 Name: golang Version: 1.10 -Release: 0.rc1.1%{?dist}.1 +Release: 0.rc2.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -547,6 +547,11 @@ fi %endif %changelog +* Thu Feb 08 2018 Jakub Čajka - 1.10-0.rc2.1 +- Rebase to 1.10rc2 +- Fix CVE-2018-6574 +- Resolves: BZ#1543561, BZ#1543562 + * Wed Feb 07 2018 Fedora Release Engineering - 1.10-0.rc1.1.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/sources b/sources index 2fc6058..5908f7c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.10rc1.src.tar.gz) = 097fae8c161338922bd1b5e6d8e990eaa47aaa034daab56a2d8edc7a1750bfcc16d80fb5a4b2a5a9b444d29cdc926d0cfaf258052e6b891abd634c37edcd0421 +SHA512 (go1.10rc2.src.tar.gz) = 7610ff51fa2f333d939b61c8b120684a7dd33cf370e76ec68e4eb5ee8bd85ec9b9517b609ae661a0a8a00263994ee898bb6ed9c3e16a8e8fe62def3e70b9071e From 639f9ab37fdf31e8432af64f52bfe5107fa488b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 21 Feb 2018 13:01:34 +0100 Subject: [PATCH 136/156] Rebase to 1.10 --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e73d6c9..03efc44 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ /go1.10beta2.src.tar.gz /go1.10rc1.src.tar.gz /go1.10rc2.src.tar.gz +/go1.10.src.tar.gz diff --git a/golang.spec b/golang.spec index b078d8b..797d893 100644 --- a/golang.spec +++ b/golang.spec @@ -102,11 +102,11 @@ %endif %global go_api 1.10 -%global go_version 1.10rc2 +%global go_version 1.10 Name: golang Version: 1.10 -Release: 0.rc2.1%{?dist} +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -547,6 +547,9 @@ fi %endif %changelog +* Wed Feb 21 2018 Jakub Čajka - 1.10-1 +- Rebase to 1.10 + * Thu Feb 08 2018 Jakub Čajka - 1.10-0.rc2.1 - Rebase to 1.10rc2 - Fix CVE-2018-6574 diff --git a/sources b/sources index 5908f7c..af2085f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.10rc2.src.tar.gz) = 7610ff51fa2f333d939b61c8b120684a7dd33cf370e76ec68e4eb5ee8bd85ec9b9517b609ae661a0a8a00263994ee898bb6ed9c3e16a8e8fe62def3e70b9071e +SHA512 (go1.10.src.tar.gz) = 59f089e1ffb2d3aba5ada329d4f0d1181c3c4f01fa64f19d0b753f8a989cb59cf290ad88d215cadc18ef99aba8518e44c9bc258c07eaffc834c55e4a37bd4651 From e8abe4385feca18c5ec8f372d96896002771f6de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 21 Feb 2018 13:01:34 +0100 Subject: [PATCH 137/156] Add dependency on scm tools so go get works out of box in minimal envs --- golang.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/golang.spec b/golang.spec index 797d893..d7f1c69 100644 --- a/golang.spec +++ b/golang.spec @@ -272,6 +272,7 @@ Requires(postun): %{_sbindir}/update-alternatives # This is an odd issue, still looking for a better fix. Requires: glibc Requires: gcc +Requires: git, subversion, mercurial %description bin %{summary} From 2389428bde52e6c7fd39b2e509bdc03823764f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Sat, 3 Mar 2018 11:26:41 +0100 Subject: [PATCH 138/156] Fix CVE-2018-7187 Resolves: BZ#1546386, BZ#1546388 --- CVE-2018-7187.patch | 124 ++++++++++++++++++++++++++++++++++++++++++++ golang.spec | 10 +++- 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 CVE-2018-7187.patch diff --git a/CVE-2018-7187.patch b/CVE-2018-7187.patch new file mode 100644 index 0000000..591ba32 --- /dev/null +++ b/CVE-2018-7187.patch @@ -0,0 +1,124 @@ +From c941e27e70c3e06e1011d2dd71d72a7a06a9bcbc Mon Sep 17 00:00:00 2001 +From: Ian Lance Taylor +Date: Thu, 15 Feb 2018 15:57:13 -0800 +Subject: [PATCH] cmd/go: restrict meta imports to valid schemes + +Before this change, when using -insecure, we permitted any meta import +repo root as long as it contained "://". When not using -insecure, we +restrict meta import repo roots to be valid URLs. People may depend on +that somehow, so permit meta import repo roots to be invalid URLs, but +require them to have valid schemes per RFC 3986. + +Fixes #23867 + +Change-Id: Iac666dfc75ac321bf8639dda5b0dba7c8840922d +Reviewed-on: https://go-review.googlesource.com/94603 +Reviewed-by: Brad Fitzpatrick +--- + src/cmd/go/internal/get/vcs.go | 34 +++++++++++++++++++++++++++-- + src/cmd/go/internal/get/vcs_test.go | 43 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 75 insertions(+), 2 deletions(-) + +diff --git a/src/cmd/go/internal/get/vcs.go b/src/cmd/go/internal/get/vcs.go +index ee6b16a1369..dced0ed8db5 100644 +--- a/src/cmd/go/internal/get/vcs.go ++++ b/src/cmd/go/internal/get/vcs.go +@@ -809,8 +809,8 @@ func repoRootForImportDynamic(importPath string, security web.SecurityMode) (*re + } + } + +- if !strings.Contains(mmi.RepoRoot, "://") { +- return nil, fmt.Errorf("%s: invalid repo root %q; no scheme", urlStr, mmi.RepoRoot) ++ if err := validateRepoRootScheme(mmi.RepoRoot); err != nil { ++ return nil, fmt.Errorf("%s: invalid repo root %q: %v", urlStr, mmi.RepoRoot, err) + } + rr := &repoRoot{ + vcs: vcsByCmd(mmi.VCS), +@@ -824,6 +824,36 @@ func repoRootForImportDynamic(importPath string, security web.SecurityMode) (*re + return rr, nil + } + ++// validateRepoRootScheme returns an error if repoRoot does not seem ++// to have a valid URL scheme. At this point we permit things that ++// aren't valid URLs, although later, if not using -insecure, we will ++// restrict repoRoots to be valid URLs. This is only because we've ++// historically permitted them, and people may depend on that. ++func validateRepoRootScheme(repoRoot string) error { ++ end := strings.Index(repoRoot, "://") ++ if end <= 0 { ++ return errors.New("no scheme") ++ } ++ ++ // RFC 3986 section 3.1. ++ for i := 0; i < end; i++ { ++ c := repoRoot[i] ++ switch { ++ case 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z': ++ // OK. ++ case '0' <= c && c <= '9' || c == '+' || c == '-' || c == '.': ++ // OK except at start. ++ if i == 0 { ++ return errors.New("invalid scheme") ++ } ++ default: ++ return errors.New("invalid scheme") ++ } ++ } ++ ++ return nil ++} ++ + var fetchGroup singleflight.Group + var ( + fetchCacheMu sync.Mutex +diff --git a/src/cmd/go/internal/get/vcs_test.go b/src/cmd/go/internal/get/vcs_test.go +index 2cb611fabd8..ece78b563ce 100644 +--- a/src/cmd/go/internal/get/vcs_test.go ++++ b/src/cmd/go/internal/get/vcs_test.go +@@ -416,3 +416,46 @@ func TestMatchGoImport(t *testing.T) { + } + } + } ++ ++func TestValidateRepoRootScheme(t *testing.T) { ++ tests := []struct { ++ root string ++ err string ++ }{ ++ { ++ root: "", ++ err: "no scheme", ++ }, ++ { ++ root: "http://", ++ err: "", ++ }, ++ { ++ root: "a://", ++ err: "", ++ }, ++ { ++ root: "a#://", ++ err: "invalid scheme", ++ }, ++ { ++ root: "-config://", ++ err: "invalid scheme", ++ }, ++ } ++ ++ for _, test := range tests { ++ err := validateRepoRootScheme(test.root) ++ if err == nil { ++ if test.err != "" { ++ t.Errorf("validateRepoRootScheme(%q) = nil, want %q", test.root, test.err) ++ } ++ } else if test.err == "" { ++ if err != nil { ++ t.Errorf("validateRepoRootScheme(%q) = %q, want nil", test.root, test.err) ++ } ++ } else if err.Error() != test.err { ++ t.Errorf("validateRepoRootScheme(%q) = %q, want %q", test.root, err, test.err) ++ } ++ } ++} diff --git a/golang.spec b/golang.spec index d7f1c69..6da4d5c 100644 --- a/golang.spec +++ b/golang.spec @@ -106,7 +106,7 @@ Name: golang Version: 1.10 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -185,6 +185,8 @@ Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch # Proposed patch by jcajka https://golang.org/cl/86541 Patch221: golang-1.10-pkgconfig-fix.patch +Patch222: CVE-2018-7187.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -313,6 +315,8 @@ Requires: %{name} = %{version}-%{release} %patch221 -p1 +%patch222 -p1 + cp %{SOURCE1} ./src/runtime/ %build @@ -548,6 +552,10 @@ fi %endif %changelog +* Sat Mar 03 2018 Jakub Čajka - 1.10-2 +- Fix CVE-2018-7187 +- Resolves: BZ#1546386, BZ#1546388 + * Wed Feb 21 2018 Jakub Čajka - 1.10-1 - Rebase to 1.10 From 6e78911a79e379e519188b43d3d5d01eca39b70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Sun, 4 Mar 2018 10:24:11 +0100 Subject: [PATCH 139/156] Fix CVE-2018-7187 Resolves: BZ#1546386, BZ#1546388 --- CVE-2018-7187.patch | 124 ++++++++++++++++++++++++++++++++++++++++++++ golang.spec | 10 +++- 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 CVE-2018-7187.patch diff --git a/CVE-2018-7187.patch b/CVE-2018-7187.patch new file mode 100644 index 0000000..591ba32 --- /dev/null +++ b/CVE-2018-7187.patch @@ -0,0 +1,124 @@ +From c941e27e70c3e06e1011d2dd71d72a7a06a9bcbc Mon Sep 17 00:00:00 2001 +From: Ian Lance Taylor +Date: Thu, 15 Feb 2018 15:57:13 -0800 +Subject: [PATCH] cmd/go: restrict meta imports to valid schemes + +Before this change, when using -insecure, we permitted any meta import +repo root as long as it contained "://". When not using -insecure, we +restrict meta import repo roots to be valid URLs. People may depend on +that somehow, so permit meta import repo roots to be invalid URLs, but +require them to have valid schemes per RFC 3986. + +Fixes #23867 + +Change-Id: Iac666dfc75ac321bf8639dda5b0dba7c8840922d +Reviewed-on: https://go-review.googlesource.com/94603 +Reviewed-by: Brad Fitzpatrick +--- + src/cmd/go/internal/get/vcs.go | 34 +++++++++++++++++++++++++++-- + src/cmd/go/internal/get/vcs_test.go | 43 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 75 insertions(+), 2 deletions(-) + +diff --git a/src/cmd/go/internal/get/vcs.go b/src/cmd/go/internal/get/vcs.go +index ee6b16a1369..dced0ed8db5 100644 +--- a/src/cmd/go/internal/get/vcs.go ++++ b/src/cmd/go/internal/get/vcs.go +@@ -809,8 +809,8 @@ func repoRootForImportDynamic(importPath string, security web.SecurityMode) (*re + } + } + +- if !strings.Contains(mmi.RepoRoot, "://") { +- return nil, fmt.Errorf("%s: invalid repo root %q; no scheme", urlStr, mmi.RepoRoot) ++ if err := validateRepoRootScheme(mmi.RepoRoot); err != nil { ++ return nil, fmt.Errorf("%s: invalid repo root %q: %v", urlStr, mmi.RepoRoot, err) + } + rr := &repoRoot{ + vcs: vcsByCmd(mmi.VCS), +@@ -824,6 +824,36 @@ func repoRootForImportDynamic(importPath string, security web.SecurityMode) (*re + return rr, nil + } + ++// validateRepoRootScheme returns an error if repoRoot does not seem ++// to have a valid URL scheme. At this point we permit things that ++// aren't valid URLs, although later, if not using -insecure, we will ++// restrict repoRoots to be valid URLs. This is only because we've ++// historically permitted them, and people may depend on that. ++func validateRepoRootScheme(repoRoot string) error { ++ end := strings.Index(repoRoot, "://") ++ if end <= 0 { ++ return errors.New("no scheme") ++ } ++ ++ // RFC 3986 section 3.1. ++ for i := 0; i < end; i++ { ++ c := repoRoot[i] ++ switch { ++ case 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z': ++ // OK. ++ case '0' <= c && c <= '9' || c == '+' || c == '-' || c == '.': ++ // OK except at start. ++ if i == 0 { ++ return errors.New("invalid scheme") ++ } ++ default: ++ return errors.New("invalid scheme") ++ } ++ } ++ ++ return nil ++} ++ + var fetchGroup singleflight.Group + var ( + fetchCacheMu sync.Mutex +diff --git a/src/cmd/go/internal/get/vcs_test.go b/src/cmd/go/internal/get/vcs_test.go +index 2cb611fabd8..ece78b563ce 100644 +--- a/src/cmd/go/internal/get/vcs_test.go ++++ b/src/cmd/go/internal/get/vcs_test.go +@@ -416,3 +416,46 @@ func TestMatchGoImport(t *testing.T) { + } + } + } ++ ++func TestValidateRepoRootScheme(t *testing.T) { ++ tests := []struct { ++ root string ++ err string ++ }{ ++ { ++ root: "", ++ err: "no scheme", ++ }, ++ { ++ root: "http://", ++ err: "", ++ }, ++ { ++ root: "a://", ++ err: "", ++ }, ++ { ++ root: "a#://", ++ err: "invalid scheme", ++ }, ++ { ++ root: "-config://", ++ err: "invalid scheme", ++ }, ++ } ++ ++ for _, test := range tests { ++ err := validateRepoRootScheme(test.root) ++ if err == nil { ++ if test.err != "" { ++ t.Errorf("validateRepoRootScheme(%q) = nil, want %q", test.root, test.err) ++ } ++ } else if test.err == "" { ++ if err != nil { ++ t.Errorf("validateRepoRootScheme(%q) = %q, want nil", test.root, test.err) ++ } ++ } else if err.Error() != test.err { ++ t.Errorf("validateRepoRootScheme(%q) = %q, want %q", test.root, err, test.err) ++ } ++ } ++} diff --git a/golang.spec b/golang.spec index f086f33..4e6be96 100644 --- a/golang.spec +++ b/golang.spec @@ -100,7 +100,7 @@ Name: golang Version: 1.9.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -183,6 +183,8 @@ Patch221: use-buildmode-pie-for-pie-testing.patch # https://github.com/hyangah/go/commit/3502496d03bcd842fd7aac95ec0d7096d581cd26 Patch222: use-no-pie-where-needed.patch +Patch223: CVE-2018-7187.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -319,6 +321,8 @@ Requires: %{name} = %{version}-%{release} %patch221 -p1 -b pie %patch222 -p1 +%patch223 -p1 + cp %{SOURCE1} ./src/runtime/ %build @@ -554,6 +558,10 @@ fi %endif %changelog +* Sat Mar 03 2018 Jakub Čajka - 1.9.4-2 +- Fix CVE-2018-7187 +- Resolves: BZ#1546386, BZ#1546388 + * Thu Feb 08 2018 Jakub Čajka - 1.9.4-1 - Rebase to 1.9.4 - Fix CVE-2018-6574 From a6109823f24a8a5155fe266bfcd43c94d4d93090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Tue, 3 Apr 2018 15:42:14 +0200 Subject: [PATCH 140/156] Rebase to 1.9.5 --- .gitignore | 1 + golang.spec | 13 ++++++------- sources | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index cc45de7..0218b4d 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ /go1.9.2.src.tar.gz /go1.9.3.src.tar.gz /go1.9.4.src.tar.gz +/go1.9.5.src.tar.gz diff --git a/golang.spec b/golang.spec index 4e6be96..f930b52 100644 --- a/golang.spec +++ b/golang.spec @@ -96,11 +96,11 @@ %endif %global go_api 1.9 -%global go_version 1.9.4 +%global go_version 1.9.5 Name: golang -Version: 1.9.4 -Release: 2%{?dist} +Version: 1.9.5 +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -183,8 +183,6 @@ Patch221: use-buildmode-pie-for-pie-testing.patch # https://github.com/hyangah/go/commit/3502496d03bcd842fd7aac95ec0d7096d581cd26 Patch222: use-no-pie-where-needed.patch -Patch223: CVE-2018-7187.patch - # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -321,8 +319,6 @@ Requires: %{name} = %{version}-%{release} %patch221 -p1 -b pie %patch222 -p1 -%patch223 -p1 - cp %{SOURCE1} ./src/runtime/ %build @@ -558,6 +554,9 @@ fi %endif %changelog +* Tue Apr 03 2018 Jakub Čajka - 1.9.5-1 +- Rebase to 1.9.5 + * Sat Mar 03 2018 Jakub Čajka - 1.9.4-2 - Fix CVE-2018-7187 - Resolves: BZ#1546386, BZ#1546388 diff --git a/sources b/sources index 06e4a51..9c6b46c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.9.4.src.tar.gz) = 1a7c830e07507ff7b89025adfb5c713444d97301f8ad47ef2564722c1e28186e946350f07e22777fbdd6f2f589c334eb01dfd589e97cb8a86f73669547badb0b +SHA512 (go1.9.5.src.tar.gz) = 5cde6a3c6e6040ddbcafa75dae551500d0bb15096a523ee29f788cbf3fa11d083d4e4a1b56a094ad2234f967c0d1be280ae00479d5f7c01174dc6da2a5a25924 From 66a92c4de7426b0fa8fc79f409395dd963ae6fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 4 Apr 2018 10:10:28 +0200 Subject: [PATCH 141/156] Rebase to 1.10.1 Resolves: BZ#1562270 --- .gitignore | 1 + CVE-2018-7187.patch | 124 -------------------------------------------- golang.spec | 14 ++--- sources | 2 +- 4 files changed, 9 insertions(+), 132 deletions(-) delete mode 100644 CVE-2018-7187.patch diff --git a/.gitignore b/.gitignore index 03efc44..4cbb603 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ /go1.10rc1.src.tar.gz /go1.10rc2.src.tar.gz /go1.10.src.tar.gz +/go1.10.1.src.tar.gz diff --git a/CVE-2018-7187.patch b/CVE-2018-7187.patch deleted file mode 100644 index 591ba32..0000000 --- a/CVE-2018-7187.patch +++ /dev/null @@ -1,124 +0,0 @@ -From c941e27e70c3e06e1011d2dd71d72a7a06a9bcbc Mon Sep 17 00:00:00 2001 -From: Ian Lance Taylor -Date: Thu, 15 Feb 2018 15:57:13 -0800 -Subject: [PATCH] cmd/go: restrict meta imports to valid schemes - -Before this change, when using -insecure, we permitted any meta import -repo root as long as it contained "://". When not using -insecure, we -restrict meta import repo roots to be valid URLs. People may depend on -that somehow, so permit meta import repo roots to be invalid URLs, but -require them to have valid schemes per RFC 3986. - -Fixes #23867 - -Change-Id: Iac666dfc75ac321bf8639dda5b0dba7c8840922d -Reviewed-on: https://go-review.googlesource.com/94603 -Reviewed-by: Brad Fitzpatrick ---- - src/cmd/go/internal/get/vcs.go | 34 +++++++++++++++++++++++++++-- - src/cmd/go/internal/get/vcs_test.go | 43 +++++++++++++++++++++++++++++++++++++ - 2 files changed, 75 insertions(+), 2 deletions(-) - -diff --git a/src/cmd/go/internal/get/vcs.go b/src/cmd/go/internal/get/vcs.go -index ee6b16a1369..dced0ed8db5 100644 ---- a/src/cmd/go/internal/get/vcs.go -+++ b/src/cmd/go/internal/get/vcs.go -@@ -809,8 +809,8 @@ func repoRootForImportDynamic(importPath string, security web.SecurityMode) (*re - } - } - -- if !strings.Contains(mmi.RepoRoot, "://") { -- return nil, fmt.Errorf("%s: invalid repo root %q; no scheme", urlStr, mmi.RepoRoot) -+ if err := validateRepoRootScheme(mmi.RepoRoot); err != nil { -+ return nil, fmt.Errorf("%s: invalid repo root %q: %v", urlStr, mmi.RepoRoot, err) - } - rr := &repoRoot{ - vcs: vcsByCmd(mmi.VCS), -@@ -824,6 +824,36 @@ func repoRootForImportDynamic(importPath string, security web.SecurityMode) (*re - return rr, nil - } - -+// validateRepoRootScheme returns an error if repoRoot does not seem -+// to have a valid URL scheme. At this point we permit things that -+// aren't valid URLs, although later, if not using -insecure, we will -+// restrict repoRoots to be valid URLs. This is only because we've -+// historically permitted them, and people may depend on that. -+func validateRepoRootScheme(repoRoot string) error { -+ end := strings.Index(repoRoot, "://") -+ if end <= 0 { -+ return errors.New("no scheme") -+ } -+ -+ // RFC 3986 section 3.1. -+ for i := 0; i < end; i++ { -+ c := repoRoot[i] -+ switch { -+ case 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z': -+ // OK. -+ case '0' <= c && c <= '9' || c == '+' || c == '-' || c == '.': -+ // OK except at start. -+ if i == 0 { -+ return errors.New("invalid scheme") -+ } -+ default: -+ return errors.New("invalid scheme") -+ } -+ } -+ -+ return nil -+} -+ - var fetchGroup singleflight.Group - var ( - fetchCacheMu sync.Mutex -diff --git a/src/cmd/go/internal/get/vcs_test.go b/src/cmd/go/internal/get/vcs_test.go -index 2cb611fabd8..ece78b563ce 100644 ---- a/src/cmd/go/internal/get/vcs_test.go -+++ b/src/cmd/go/internal/get/vcs_test.go -@@ -416,3 +416,46 @@ func TestMatchGoImport(t *testing.T) { - } - } - } -+ -+func TestValidateRepoRootScheme(t *testing.T) { -+ tests := []struct { -+ root string -+ err string -+ }{ -+ { -+ root: "", -+ err: "no scheme", -+ }, -+ { -+ root: "http://", -+ err: "", -+ }, -+ { -+ root: "a://", -+ err: "", -+ }, -+ { -+ root: "a#://", -+ err: "invalid scheme", -+ }, -+ { -+ root: "-config://", -+ err: "invalid scheme", -+ }, -+ } -+ -+ for _, test := range tests { -+ err := validateRepoRootScheme(test.root) -+ if err == nil { -+ if test.err != "" { -+ t.Errorf("validateRepoRootScheme(%q) = nil, want %q", test.root, test.err) -+ } -+ } else if test.err == "" { -+ if err != nil { -+ t.Errorf("validateRepoRootScheme(%q) = %q, want nil", test.root, test.err) -+ } -+ } else if err.Error() != test.err { -+ t.Errorf("validateRepoRootScheme(%q) = %q, want %q", test.root, err, test.err) -+ } -+ } -+} diff --git a/golang.spec b/golang.spec index 6da4d5c..c97f8aa 100644 --- a/golang.spec +++ b/golang.spec @@ -102,11 +102,11 @@ %endif %global go_api 1.10 -%global go_version 1.10 +%global go_version 1.10.1 Name: golang -Version: 1.10 -Release: 2%{?dist} +Version: 1.10.1 +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -185,8 +185,6 @@ Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch # Proposed patch by jcajka https://golang.org/cl/86541 Patch221: golang-1.10-pkgconfig-fix.patch -Patch222: CVE-2018-7187.patch - # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -315,8 +313,6 @@ Requires: %{name} = %{version}-%{release} %patch221 -p1 -%patch222 -p1 - cp %{SOURCE1} ./src/runtime/ %build @@ -552,6 +548,10 @@ fi %endif %changelog +* Wed Apr 04 2018 Jakub Čajka - 1.10.1-1 +- Rebase to 1.10.1 +- Resolves: BZ#1562270 + * Sat Mar 03 2018 Jakub Čajka - 1.10-2 - Fix CVE-2018-7187 - Resolves: BZ#1546386, BZ#1546388 diff --git a/sources b/sources index af2085f..ade4700 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.10.src.tar.gz) = 59f089e1ffb2d3aba5ada329d4f0d1181c3c4f01fa64f19d0b753f8a989cb59cf290ad88d215cadc18ef99aba8518e44c9bc258c07eaffc834c55e4a37bd4651 +SHA512 (go1.10.1.src.tar.gz) = 13f6b0643a4f92eeca04444b9fa10de38fc3427daea9aa3227cf9a5738ffee1a3f2e355ba5faf711b8506f7de118bdcd3b9064b65407a22613523e29ffd73415 From 6caa43c1063f4eac8b7ce61fdd451f1b10621376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 3 May 2018 11:11:48 +0200 Subject: [PATCH 142/156] Rebase to 1.10.2 Patch clean up --- .gitignore | 1 + ...ndled-tzdata-at-runtime-except-for-t.patch | 38 ++++++--- ...expose-IfInfomsg.X__ifi_pad-on-s390x.patch | 13 ++- ...work-improve-pkgconfig-support-to-wo.patch | 10 +-- 31bit-OID-asn1.patch | 83 ------------------- golang-1.5-bootstrap-binary-path.patch | 61 -------------- golang.spec | 27 +++--- sources | 2 +- 8 files changed, 55 insertions(+), 180 deletions(-) rename go1.5-zoneinfo_testing_only.patch => 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch (54%) rename s390x-expose-IfInfomsg-X__ifi_pad.patch => 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch (69%) rename golang-1.10-pkgconfig-fix.patch => 0003-cmd-go-internal-work-improve-pkgconfig-support-to-wo.patch (96%) delete mode 100644 31bit-OID-asn1.patch delete mode 100644 golang-1.5-bootstrap-binary-path.patch diff --git a/.gitignore b/.gitignore index 4cbb603..c3bee51 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,4 @@ /go1.10rc2.src.tar.gz /go1.10.src.tar.gz /go1.10.1.src.tar.gz +/go1.10.2.src.tar.gz diff --git a/go1.5-zoneinfo_testing_only.patch b/0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch similarity index 54% rename from go1.5-zoneinfo_testing_only.patch rename to 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch index 581cb94..422ca2b 100644 --- a/go1.5-zoneinfo_testing_only.patch +++ b/0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch @@ -1,6 +1,19 @@ -diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go ---- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go.time 2017-12-05 01:10:10.000000000 +0100 -+++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go 2017-12-05 14:55:10.574637475 +0100 +From edce31a2904846ae74e3c011f2cf5fddc963459e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jakub=20=C4=8Cajka?= +Date: Thu, 22 Mar 2018 12:07:32 +0100 +Subject: [PATCH 1/3] Don't use the bundled tzdata at runtime, except for the + internal test suite + +--- + src/time/internal_test.go | 7 +++++-- + src/time/zoneinfo_test.go | 3 ++- + src/time/zoneinfo_unix.go | 2 -- + 3 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/src/time/internal_test.go b/src/time/internal_test.go +index 76d5524124..e81ace5f64 100644 +--- a/src/time/internal_test.go ++++ b/src/time/internal_test.go @@ -4,13 +4,15 @@ package time @@ -29,9 +42,10 @@ diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go.t if zipOnly { zoneSources = zoneSources[len(zoneSources)-1:] } -diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go ---- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go.time 2017-12-05 01:10:10.000000000 +0100 -+++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go 2017-12-05 14:58:09.823109248 +0100 +diff --git a/src/time/zoneinfo_test.go b/src/time/zoneinfo_test.go +index 7a55d4f618..6063ca1195 100644 +--- a/src/time/zoneinfo_test.go ++++ b/src/time/zoneinfo_test.go @@ -8,6 +8,7 @@ import ( "fmt" "os" @@ -40,7 +54,7 @@ diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go.t "testing" "time" ) -@@ -128,7 +129,7 @@ func TestLoadLocationFromTZData(t *testi +@@ -128,7 +129,7 @@ func TestLoadLocationFromTZData(t *testing.T) { t.Fatal(err) } @@ -49,9 +63,10 @@ diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go.t if err != nil { t.Fatal(err) } -diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go ---- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go.time 2017-12-05 01:10:10.000000000 +0100 -+++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go 2017-12-05 14:55:10.574637475 +0100 +diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go +index 88313aa0ed..d9596115ef 100644 +--- a/src/time/zoneinfo_unix.go ++++ b/src/time/zoneinfo_unix.go @@ -12,7 +12,6 @@ package time @@ -68,3 +83,6 @@ diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go.t } func initLocal() { +-- +2.14.3 + diff --git a/s390x-expose-IfInfomsg-X__ifi_pad.patch b/0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch similarity index 69% rename from s390x-expose-IfInfomsg-X__ifi_pad.patch rename to 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch index ec53077..072440d 100644 --- a/s390x-expose-IfInfomsg-X__ifi_pad.patch +++ b/0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch @@ -1,7 +1,7 @@ -From 84b8c9ceaa5257f7ff4ab059ff208246ecdfe9d9 Mon Sep 17 00:00:00 2001 +From 817407fc2d6a861e65086388766f58082d38bc0b Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Tue, 17 Jan 2017 11:33:38 -0500 -Subject: [PATCH] syscall: expose IfInfomsg.X__ifi_pad on s390x +Subject: [PATCH 2/3] syscall: expose IfInfomsg.X__ifi_pad on s390x Exposing this field on s390x improves compatibility with the other linux architectures, all of which already expose it. @@ -10,12 +10,14 @@ Fixes #18628 and updates #18632. Change-Id: I08e8e1eb705f898cd8822f8bee0d61ce11d514b5 --- + src/syscall/ztypes_linux_s390x.go | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/syscall/ztypes_linux_s390x.go b/src/syscall/ztypes_linux_s390x.go -index 63c4a83..b589425 100644 +index 63c4a83b19..b5894255df 100644 --- a/src/syscall/ztypes_linux_s390x.go +++ b/src/syscall/ztypes_linux_s390x.go -@@ -449,12 +449,12 @@ +@@ -449,12 +449,12 @@ type RtAttr struct { } type IfInfomsg struct { @@ -34,3 +36,6 @@ index 63c4a83..b589425 100644 } type IfAddrmsg struct { +-- +2.14.3 + diff --git a/golang-1.10-pkgconfig-fix.patch b/0003-cmd-go-internal-work-improve-pkgconfig-support-to-wo.patch similarity index 96% rename from golang-1.10-pkgconfig-fix.patch rename to 0003-cmd-go-internal-work-improve-pkgconfig-support-to-wo.patch index 24f454a..933244b 100644 --- a/golang-1.10-pkgconfig-fix.patch +++ b/0003-cmd-go-internal-work-improve-pkgconfig-support-to-wo.patch @@ -1,8 +1,8 @@ -From 09581ca4826b6d67b1c3a3c8597038b28a37f52d Mon Sep 17 00:00:00 2001 +From 18385565374c36eda8306c57715332d5ae6eb9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 5 Jan 2018 13:38:55 +0100 -Subject: [PATCH] cmd/go/internal/work : improve pkgconfig support to work with - latest(1.4+) pkgconf +Subject: [PATCH 3/3] cmd/go/internal/work : improve pkgconfig support to work + with latest(1.4+) pkgconf Fixes #23373 @@ -72,7 +72,7 @@ index 3f5ba37c64..c3c63a97a4 100644 t.Errorf("splitPkgConfigOutput(%v) = %v; want %v", test.in, got, test.want) } diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go -index a5ab75f6a8..8774be1385 100644 +index a50c996041..5596638e48 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -900,36 +900,62 @@ func (b *Builder) PkgconfigCmd() string { @@ -160,7 +160,7 @@ index a5ab75f6a8..8774be1385 100644 } // Calls pkg-config if needed and returns the cflags/ldflags needed to build the package. -@@ -948,7 +974,10 @@ func (b *Builder) getPkgConfigFlags(p *load.Package) (cflags, ldflags []string, +@@ -961,7 +987,10 @@ func (b *Builder) getPkgConfigFlags(p *load.Package) (cflags, ldflags []string, return nil, nil, errPrintedOutput } if len(out) > 0 { diff --git a/31bit-OID-asn1.patch b/31bit-OID-asn1.patch deleted file mode 100644 index 4d01b3d..0000000 --- a/31bit-OID-asn1.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 94aba76639cf4d5e30975d846bb0368db8202269 Mon Sep 17 00:00:00 2001 -From: Monis Khan -Date: Wed, 12 Apr 2017 16:00:58 -0400 -Subject: [PATCH] encoding/asn1: support 31 bit identifiers with OID - -The current implementation uses a max of 28 bits when decoding an -ObjectIdentifier. This change makes it so that an int64 is used to -accumulate up to 35 bits. If the resulting data would not overflow -an int32, it is used as an int. Thus up to 31 bits may be used to -represent each subidentifier of an ObjectIdentifier. - -Fixes #19933 - -Change-Id: I95d74b64b24cdb1339ff13421055bce61c80243c -Reviewed-on: https://go-review.googlesource.com/40436 -Reviewed-by: Adam Langley -Run-TryBot: Adam Langley ---- - src/encoding/asn1/asn1.go | 15 ++++++++++++--- - src/encoding/asn1/asn1_test.go | 3 +++ - 2 files changed, 15 insertions(+), 3 deletions(-) - -diff --git a/src/encoding/asn1/asn1.go b/src/encoding/asn1/asn1.go -index c2c0ee420ac..65f018d0148 100644 ---- a/src/encoding/asn1/asn1.go -+++ b/src/encoding/asn1/asn1.go -@@ -22,6 +22,7 @@ package asn1 - import ( - "errors" - "fmt" -+ "math" - "math/big" - "reflect" - "strconv" -@@ -293,16 +294,24 @@ type Flag bool - // given byte slice. It returns the value and the new offset. - func parseBase128Int(bytes []byte, initOffset int) (ret, offset int, err error) { - offset = initOffset -+ var ret64 int64 - for shifted := 0; offset < len(bytes); shifted++ { -- if shifted == 4 { -+ // 5 * 7 bits per byte == 35 bits of data -+ // Thus the representation is either non-minimal or too large for an int32 -+ if shifted == 5 { - err = StructuralError{"base 128 integer too large"} - return - } -- ret <<= 7 -+ ret64 <<= 7 - b := bytes[offset] -- ret |= int(b & 0x7f) -+ ret64 |= int64(b & 0x7f) - offset++ - if b&0x80 == 0 { -+ ret = int(ret64) -+ // Ensure that the returned value fits in an int on all platforms -+ if ret64 > math.MaxInt32 { -+ err = StructuralError{"base 128 integer too large"} -+ } - return - } - } -diff --git a/src/encoding/asn1/asn1_test.go b/src/encoding/asn1/asn1_test.go -index 9976656df89..2dd799f2362 100644 ---- a/src/encoding/asn1/asn1_test.go -+++ b/src/encoding/asn1/asn1_test.go -@@ -7,6 +7,7 @@ package asn1 - import ( - "bytes" - "fmt" -+ "math" - "math/big" - "reflect" - "strings" -@@ -386,6 +387,8 @@ var tagAndLengthData = []tagAndLengthTest{ - {[]byte{0xa0, 0x81, 0x7f}, false, tagAndLength{}}, - // Tag numbers which would overflow int32 are rejected. (The value below is 2^31.) - {[]byte{0x1f, 0x88, 0x80, 0x80, 0x80, 0x00, 0x00}, false, tagAndLength{}}, -+ // Tag numbers that fit in an int32 are valid. (The value below is 2^31 - 1.) -+ {[]byte{0x1f, 0x87, 0xFF, 0xFF, 0xFF, 0x7F, 0x00}, true, tagAndLength{tag: math.MaxInt32}}, - // Long tag number form may not be used for tags that fit in short form. - {[]byte{0x1f, 0x1e, 0x00}, false, tagAndLength{}}, - } diff --git a/golang-1.5-bootstrap-binary-path.patch b/golang-1.5-bootstrap-binary-path.patch deleted file mode 100644 index af7d069..0000000 --- a/golang-1.5-bootstrap-binary-path.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go ---- go/src/cmd/dist/buildtool.go.bootstrap 2017-07-11 12:05:00.041373419 +0200 -+++ go/src/cmd/dist/buildtool.go 2017-07-11 12:07:27.141775914 +0200 -@@ -153,18 +153,26 @@ func bootstrapBuildTools() { - defer os.Setenv("GOBIN", os.Getenv("GOBIN")) - os.Setenv("GOBIN", "") - -+ hostos := os.Getenv("GOHOSTOS") -+ hostarch := os.Getenv("GOHOSTARCH") -+ - os.Setenv("GOOS", "") - os.Setenv("GOHOSTOS", "") - os.Setenv("GOARCH", "") - 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. Use -gcflags=-l to disable inlining to - // workaround bugs in Go 1.4's compiler. See discussion thread: - // https://groups.google.com/d/msg/golang-dev/Ss7mCKsvk8w/Gsq7VYI0AwAJ - // Use the math_big_pure_go build tag to disable the assembly in math/big - // which may contain unsupported instructions. - cmd := []string{ -- pathf("%s/bin/go", goroot_bootstrap), -+ bingopath, - "install", - "-gcflags=-l", - "-tags=math_big_pure_go", -diff -up go/src/make.bash.bootstrap go/src/make.bash ---- go/src/make.bash.bootstrap 2017-07-11 12:05:00.036373439 +0200 -+++ go/src/make.bash 2017-07-11 12:05:00.041373419 +0200 -@@ -120,8 +120,15 @@ 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 - exit 1 - fi -@@ -130,8 +137,6 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; - echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 - exit 1 - 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 c97f8aa..54ed39b 100644 --- a/golang.spec +++ b/golang.spec @@ -102,10 +102,10 @@ %endif %global go_api 1.10 -%global go_version 1.10.1 +%global go_version 1.10.2 Name: golang -Version: 1.10.1 +Version: 1.10.2 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -175,15 +175,9 @@ Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-src = %{version}-%{release} Requires: go-srpm-macros -# 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 - -# Proposed patch by mmunday https://golang.org/cl/35262 -Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch - -# Proposed patch by jcajka https://golang.org/cl/86541 -Patch221: golang-1.10-pkgconfig-fix.patch +Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch +Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch +Patch3: 0003-cmd-go-internal-work-improve-pkgconfig-support-to-wo.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -307,11 +301,9 @@ Requires: %{name} = %{version}-%{release} %prep %setup -q -n go -%patch215 -p1 - -%patch219 -p1 - -%patch221 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 cp %{SOURCE1} ./src/runtime/ @@ -548,6 +540,9 @@ fi %endif %changelog +* Wed May 02 2018 Jakub Čajka - 1.10.2-1 +- Rebase to 1.10.2 + * Wed Apr 04 2018 Jakub Čajka - 1.10.1-1 - Rebase to 1.10.1 - Resolves: BZ#1562270 diff --git a/sources b/sources index ade4700..ac95b0f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.10.1.src.tar.gz) = 13f6b0643a4f92eeca04444b9fa10de38fc3427daea9aa3227cf9a5738ffee1a3f2e355ba5faf711b8506f7de118bdcd3b9064b65407a22613523e29ffd73415 +SHA512 (go1.10.2.src.tar.gz) = 754e60bce1ea3479ebb57bbbb625e3d7875a151e7a6d7a1067478a9e45bde5423f47123d084832bb838acf7675a9d05057b76c1d773e43cae0fb4e7a52acf4a9 From 371df34265a3aa06bd6c328fcf38bb83f92a9eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 3 May 2018 15:17:35 +0200 Subject: [PATCH 143/156] Rebase to 1.9.6 --- .gitignore | 1 + ...1-Make-build-little-bit-more-verbose.patch | 23 +++- ...=> 0002-Don-t-use-the-bundled-tzdata.patch | 14 +- ...expose-IfInfomsg.X__ifi_pad-on-s390x.patch | 13 +- ...h => 0004-Ignore-L0-A-during-linking.patch | 14 +- ...s-github.com-golang-go-commit-ca8c36.patch | 24 +++- ...testcarchive-use-no-pie-where-needed.patch | 11 +- 31bit-OID-asn1.patch | 83 ------------ CVE-2018-7187.patch | 124 ------------------ golang-1.5-bootstrap-binary-path.patch | 61 --------- golang.spec | 51 +++---- sources | 2 +- 12 files changed, 98 insertions(+), 323 deletions(-) rename golang-1.2-verbose-build.patch => 0001-Make-build-little-bit-more-verbose.patch (58%) rename go1.5-zoneinfo_testing_only.patch => 0002-Don-t-use-the-bundled-tzdata.patch (65%) rename s390x-expose-IfInfomsg-X__ifi_pad.patch => 0003-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch (69%) rename s390x-ignore-L0syms.patch => 0004-Ignore-L0-A-during-linking.patch (69%) rename use-buildmode-pie-for-pie-testing.patch => 0005-Backport-of-https-github.com-golang-go-commit-ca8c36.patch (68%) rename use-no-pie-where-needed.patch => 0006-misc-cgo-testcarchive-use-no-pie-where-needed.patch (89%) delete mode 100644 31bit-OID-asn1.patch delete mode 100644 CVE-2018-7187.patch delete mode 100644 golang-1.5-bootstrap-binary-path.patch diff --git a/.gitignore b/.gitignore index 0218b4d..85c8935 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ /go1.9.3.src.tar.gz /go1.9.4.src.tar.gz /go1.9.5.src.tar.gz +/go1.9.6.src.tar.gz diff --git a/golang-1.2-verbose-build.patch b/0001-Make-build-little-bit-more-verbose.patch similarity index 58% rename from golang-1.2-verbose-build.patch rename to 0001-Make-build-little-bit-more-verbose.patch index c9dbba2..b6e0343 100644 --- a/golang-1.2-verbose-build.patch +++ b/0001-Make-build-little-bit-more-verbose.patch @@ -1,7 +1,17 @@ -diff -up go/src/make.bash.verbose go/src/make.bash ---- go/src/make.bash.verbose 2017-07-11 12:00:09.513553508 +0200 -+++ go/src/make.bash 2017-07-11 12:01:25.288245720 +0200 -@@ -167,7 +167,7 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH +From 2f52dca801a86a729fb69dc9123d111a9e995895 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jakub=20=C4=8Cajka?= +Date: Thu, 22 Mar 2018 12:39:16 +0100 +Subject: [PATCH 1/6] Make build little bit more verbose + +--- + src/make.bash | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/make.bash b/src/make.bash +index 71e75318f2..14c4424392 100755 +--- a/src/make.bash ++++ b/src/make.bash +@@ -167,7 +167,7 @@ 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 \ @@ -10,7 +20,7 @@ diff -up go/src/make.bash.verbose go/src/make.bash echo fi -@@ -175,7 +175,7 @@ echo "##### Building packages and comman +@@ -175,7 +175,7 @@ echo "##### Building packages and commands for $GOOS/$GOARCH." old_bin_files=$(cd $GOROOT/bin && echo *) @@ -19,3 +29,6 @@ diff -up go/src/make.bash.verbose go/src/make.bash # Check that there are no new files in $GOROOT/bin other than go and gofmt # and $GOOS_$GOARCH (a directory used when cross-compiling). +-- +2.14.3 + diff --git a/go1.5-zoneinfo_testing_only.patch b/0002-Don-t-use-the-bundled-tzdata.patch similarity index 65% rename from go1.5-zoneinfo_testing_only.patch rename to 0002-Don-t-use-the-bundled-tzdata.patch index 3e9cb5f..7a01b48 100644 --- a/go1.5-zoneinfo_testing_only.patch +++ b/0002-Don-t-use-the-bundled-tzdata.patch @@ -1,5 +1,14 @@ +From 63c8189910c1cc2a45a7fb21fbc5c516ce01f46c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jakub=20=C4=8Cajka?= +Date: Thu, 22 Mar 2018 12:41:12 +0100 +Subject: [PATCH 2/6] Don't use the bundled tzdata + +--- + src/time/zoneinfo_unix.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go -index ed9502d..c2569e7 100644 +index bbf263a16f..ec14bc0f7b 100644 --- a/src/time/zoneinfo_unix.go +++ b/src/time/zoneinfo_unix.go @@ -32,14 +32,14 @@ var zoneDirs = []string{ @@ -19,3 +28,6 @@ index ed9502d..c2569e7 100644 if zipOnly { for i := 0; i < len(zoneDirs)-1; i++ { zoneDirs[i] = "/XXXNOEXIST" +-- +2.14.3 + diff --git a/s390x-expose-IfInfomsg-X__ifi_pad.patch b/0003-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch similarity index 69% rename from s390x-expose-IfInfomsg-X__ifi_pad.patch rename to 0003-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch index ec53077..eabd27a 100644 --- a/s390x-expose-IfInfomsg-X__ifi_pad.patch +++ b/0003-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch @@ -1,7 +1,7 @@ -From 84b8c9ceaa5257f7ff4ab059ff208246ecdfe9d9 Mon Sep 17 00:00:00 2001 +From d53a3784bbeab6ac7405c88e56528024061d2ef2 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Tue, 17 Jan 2017 11:33:38 -0500 -Subject: [PATCH] syscall: expose IfInfomsg.X__ifi_pad on s390x +Subject: [PATCH 3/6] syscall: expose IfInfomsg.X__ifi_pad on s390x Exposing this field on s390x improves compatibility with the other linux architectures, all of which already expose it. @@ -10,12 +10,14 @@ Fixes #18628 and updates #18632. Change-Id: I08e8e1eb705f898cd8822f8bee0d61ce11d514b5 --- + src/syscall/ztypes_linux_s390x.go | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/syscall/ztypes_linux_s390x.go b/src/syscall/ztypes_linux_s390x.go -index 63c4a83..b589425 100644 +index 63c4a83b19..b5894255df 100644 --- a/src/syscall/ztypes_linux_s390x.go +++ b/src/syscall/ztypes_linux_s390x.go -@@ -449,12 +449,12 @@ +@@ -449,12 +449,12 @@ type RtAttr struct { } type IfInfomsg struct { @@ -34,3 +36,6 @@ index 63c4a83..b589425 100644 } type IfAddrmsg struct { +-- +2.14.3 + diff --git a/s390x-ignore-L0syms.patch b/0004-Ignore-L0-A-during-linking.patch similarity index 69% rename from s390x-ignore-L0syms.patch rename to 0004-Ignore-L0-A-during-linking.patch index a6c65e0..4a88532 100644 --- a/s390x-ignore-L0syms.patch +++ b/0004-Ignore-L0-A-during-linking.patch @@ -1,5 +1,14 @@ +From a170a330e0598ad67240a4080a2ab185491884f5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jakub=20=C4=8Cajka?= +Date: Thu, 22 Mar 2018 12:42:33 +0100 +Subject: [PATCH 4/6] Ignore L0^A during linking + +--- + src/cmd/link/internal/ld/ldelf.go | 7 +++++++ + 1 file changed, 7 insertions(+) + diff --git a/src/cmd/link/internal/ld/ldelf.go b/src/cmd/link/internal/ld/ldelf.go -index d4f9fc4..87dabaa 100644 +index d4f9fc44d7..9b02bf5d36 100644 --- a/src/cmd/link/internal/ld/ldelf.go +++ b/src/cmd/link/internal/ld/ldelf.go @@ -799,6 +799,13 @@ func ldelf(ctxt *Link, f *bio.Reader, pkg string, length int64, pn string) { @@ -16,3 +25,6 @@ index d4f9fc4..87dabaa 100644 if strings.HasPrefix(sym.name, ".LASF") { // gcc on s390x does this continue } +-- +2.14.3 + diff --git a/use-buildmode-pie-for-pie-testing.patch b/0005-Backport-of-https-github.com-golang-go-commit-ca8c36.patch similarity index 68% rename from use-buildmode-pie-for-pie-testing.patch rename to 0005-Backport-of-https-github.com-golang-go-commit-ca8c36.patch index 9f0db0e..c9a68c7 100644 --- a/use-buildmode-pie-for-pie-testing.patch +++ b/0005-Backport-of-https-github.com-golang-go-commit-ca8c36.patch @@ -1,7 +1,18 @@ -diff -up go/src/cmd/dist/test.go.pie go/src/cmd/dist/test.go ---- go/src/cmd/dist/test.go.pie 2017-10-25 20:30:21.000000000 +0200 -+++ go/src/cmd/dist/test.go 2017-11-03 16:47:55.290829798 +0100 -@@ -852,6 +852,16 @@ func (t *tester) supportedBuildmode(mode +From 6d91532e4da10746ced62f714783017f682f83e1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jakub=20=C4=8Cajka?= +Date: Thu, 22 Mar 2018 12:44:25 +0100 +Subject: [PATCH 5/6] Backport of + https://github.com/golang/go/commit/ca8c361d867d62bd46013c5abbaaad0b2ca6077f + +--- + src/cmd/dist/test.go | 30 ++++++++++++++++-------------- + 1 file changed, 16 insertions(+), 14 deletions(-) + +diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go +index 73432d31ea..ed7151ab66 100644 +--- a/src/cmd/dist/test.go ++++ b/src/cmd/dist/test.go +@@ -852,6 +852,16 @@ func (t *tester) supportedBuildmode(mode string) bool { return true } return false @@ -18,7 +29,7 @@ diff -up go/src/cmd/dist/test.go.pie go/src/cmd/dist/test.go default: log.Fatalf("internal error: unknown buildmode %s", mode) return false -@@ -953,24 +963,16 @@ func (t *tester) cgoTest(dt *distTest) e +@@ -953,24 +963,16 @@ func (t *tester) cgoTest(dt *distTest) error { } } @@ -49,3 +60,6 @@ diff -up go/src/cmd/dist/test.go.pie go/src/cmd/dist/test.go } } } +-- +2.14.3 + diff --git a/use-no-pie-where-needed.patch b/0006-misc-cgo-testcarchive-use-no-pie-where-needed.patch similarity index 89% rename from use-no-pie-where-needed.patch rename to 0006-misc-cgo-testcarchive-use-no-pie-where-needed.patch index e970498..0a65eaf 100644 --- a/use-no-pie-where-needed.patch +++ b/0006-misc-cgo-testcarchive-use-no-pie-where-needed.patch @@ -1,7 +1,7 @@ -From 3502496d03bcd842fd7aac95ec0d7096d581cd26 Mon Sep 17 00:00:00 2001 +From 0c99703e993fe8a68bdf311b51bfe7b03b9eced0 Mon Sep 17 00:00:00 2001 From: Lynn Boger Date: Wed, 11 Oct 2017 16:02:59 -0400 -Subject: [PATCH] misc/cgo/testcarchive: use -no-pie where needed +Subject: [PATCH 6/6] misc/cgo/testcarchive: use -no-pie where needed Starting in gcc 6, -pie is passed to the linker by default on some platforms, including ppc64le. If the objects @@ -22,7 +22,7 @@ Reviewed-by: Ian Lance Taylor 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/misc/cgo/testcarchive/carchive_test.go b/misc/cgo/testcarchive/carchive_test.go -index b5123154e79..ac637c06007 100644 +index 74897c7f6f..958d9d739e 100644 --- a/misc/cgo/testcarchive/carchive_test.go +++ b/misc/cgo/testcarchive/carchive_test.go @@ -6,6 +6,7 @@ package carchive_test @@ -33,7 +33,7 @@ index b5123154e79..ac637c06007 100644 "debug/elf" "fmt" "io/ioutil" -@@ -609,9 +610,26 @@ func TestCompileWithoutShared(t *testing.T) { +@@ -605,9 +606,26 @@ func TestCompileWithoutShared(t *testing.T) { } exe := "./testnoshared" + exeSuffix @@ -61,3 +61,6 @@ index b5123154e79..ac637c06007 100644 t.Logf("%s", out) if err != nil { t.Fatal(err) +-- +2.14.3 + diff --git a/31bit-OID-asn1.patch b/31bit-OID-asn1.patch deleted file mode 100644 index 4d01b3d..0000000 --- a/31bit-OID-asn1.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 94aba76639cf4d5e30975d846bb0368db8202269 Mon Sep 17 00:00:00 2001 -From: Monis Khan -Date: Wed, 12 Apr 2017 16:00:58 -0400 -Subject: [PATCH] encoding/asn1: support 31 bit identifiers with OID - -The current implementation uses a max of 28 bits when decoding an -ObjectIdentifier. This change makes it so that an int64 is used to -accumulate up to 35 bits. If the resulting data would not overflow -an int32, it is used as an int. Thus up to 31 bits may be used to -represent each subidentifier of an ObjectIdentifier. - -Fixes #19933 - -Change-Id: I95d74b64b24cdb1339ff13421055bce61c80243c -Reviewed-on: https://go-review.googlesource.com/40436 -Reviewed-by: Adam Langley -Run-TryBot: Adam Langley ---- - src/encoding/asn1/asn1.go | 15 ++++++++++++--- - src/encoding/asn1/asn1_test.go | 3 +++ - 2 files changed, 15 insertions(+), 3 deletions(-) - -diff --git a/src/encoding/asn1/asn1.go b/src/encoding/asn1/asn1.go -index c2c0ee420ac..65f018d0148 100644 ---- a/src/encoding/asn1/asn1.go -+++ b/src/encoding/asn1/asn1.go -@@ -22,6 +22,7 @@ package asn1 - import ( - "errors" - "fmt" -+ "math" - "math/big" - "reflect" - "strconv" -@@ -293,16 +294,24 @@ type Flag bool - // given byte slice. It returns the value and the new offset. - func parseBase128Int(bytes []byte, initOffset int) (ret, offset int, err error) { - offset = initOffset -+ var ret64 int64 - for shifted := 0; offset < len(bytes); shifted++ { -- if shifted == 4 { -+ // 5 * 7 bits per byte == 35 bits of data -+ // Thus the representation is either non-minimal or too large for an int32 -+ if shifted == 5 { - err = StructuralError{"base 128 integer too large"} - return - } -- ret <<= 7 -+ ret64 <<= 7 - b := bytes[offset] -- ret |= int(b & 0x7f) -+ ret64 |= int64(b & 0x7f) - offset++ - if b&0x80 == 0 { -+ ret = int(ret64) -+ // Ensure that the returned value fits in an int on all platforms -+ if ret64 > math.MaxInt32 { -+ err = StructuralError{"base 128 integer too large"} -+ } - return - } - } -diff --git a/src/encoding/asn1/asn1_test.go b/src/encoding/asn1/asn1_test.go -index 9976656df89..2dd799f2362 100644 ---- a/src/encoding/asn1/asn1_test.go -+++ b/src/encoding/asn1/asn1_test.go -@@ -7,6 +7,7 @@ package asn1 - import ( - "bytes" - "fmt" -+ "math" - "math/big" - "reflect" - "strings" -@@ -386,6 +387,8 @@ var tagAndLengthData = []tagAndLengthTest{ - {[]byte{0xa0, 0x81, 0x7f}, false, tagAndLength{}}, - // Tag numbers which would overflow int32 are rejected. (The value below is 2^31.) - {[]byte{0x1f, 0x88, 0x80, 0x80, 0x80, 0x00, 0x00}, false, tagAndLength{}}, -+ // Tag numbers that fit in an int32 are valid. (The value below is 2^31 - 1.) -+ {[]byte{0x1f, 0x87, 0xFF, 0xFF, 0xFF, 0x7F, 0x00}, true, tagAndLength{tag: math.MaxInt32}}, - // Long tag number form may not be used for tags that fit in short form. - {[]byte{0x1f, 0x1e, 0x00}, false, tagAndLength{}}, - } diff --git a/CVE-2018-7187.patch b/CVE-2018-7187.patch deleted file mode 100644 index 591ba32..0000000 --- a/CVE-2018-7187.patch +++ /dev/null @@ -1,124 +0,0 @@ -From c941e27e70c3e06e1011d2dd71d72a7a06a9bcbc Mon Sep 17 00:00:00 2001 -From: Ian Lance Taylor -Date: Thu, 15 Feb 2018 15:57:13 -0800 -Subject: [PATCH] cmd/go: restrict meta imports to valid schemes - -Before this change, when using -insecure, we permitted any meta import -repo root as long as it contained "://". When not using -insecure, we -restrict meta import repo roots to be valid URLs. People may depend on -that somehow, so permit meta import repo roots to be invalid URLs, but -require them to have valid schemes per RFC 3986. - -Fixes #23867 - -Change-Id: Iac666dfc75ac321bf8639dda5b0dba7c8840922d -Reviewed-on: https://go-review.googlesource.com/94603 -Reviewed-by: Brad Fitzpatrick ---- - src/cmd/go/internal/get/vcs.go | 34 +++++++++++++++++++++++++++-- - src/cmd/go/internal/get/vcs_test.go | 43 +++++++++++++++++++++++++++++++++++++ - 2 files changed, 75 insertions(+), 2 deletions(-) - -diff --git a/src/cmd/go/internal/get/vcs.go b/src/cmd/go/internal/get/vcs.go -index ee6b16a1369..dced0ed8db5 100644 ---- a/src/cmd/go/internal/get/vcs.go -+++ b/src/cmd/go/internal/get/vcs.go -@@ -809,8 +809,8 @@ func repoRootForImportDynamic(importPath string, security web.SecurityMode) (*re - } - } - -- if !strings.Contains(mmi.RepoRoot, "://") { -- return nil, fmt.Errorf("%s: invalid repo root %q; no scheme", urlStr, mmi.RepoRoot) -+ if err := validateRepoRootScheme(mmi.RepoRoot); err != nil { -+ return nil, fmt.Errorf("%s: invalid repo root %q: %v", urlStr, mmi.RepoRoot, err) - } - rr := &repoRoot{ - vcs: vcsByCmd(mmi.VCS), -@@ -824,6 +824,36 @@ func repoRootForImportDynamic(importPath string, security web.SecurityMode) (*re - return rr, nil - } - -+// validateRepoRootScheme returns an error if repoRoot does not seem -+// to have a valid URL scheme. At this point we permit things that -+// aren't valid URLs, although later, if not using -insecure, we will -+// restrict repoRoots to be valid URLs. This is only because we've -+// historically permitted them, and people may depend on that. -+func validateRepoRootScheme(repoRoot string) error { -+ end := strings.Index(repoRoot, "://") -+ if end <= 0 { -+ return errors.New("no scheme") -+ } -+ -+ // RFC 3986 section 3.1. -+ for i := 0; i < end; i++ { -+ c := repoRoot[i] -+ switch { -+ case 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z': -+ // OK. -+ case '0' <= c && c <= '9' || c == '+' || c == '-' || c == '.': -+ // OK except at start. -+ if i == 0 { -+ return errors.New("invalid scheme") -+ } -+ default: -+ return errors.New("invalid scheme") -+ } -+ } -+ -+ return nil -+} -+ - var fetchGroup singleflight.Group - var ( - fetchCacheMu sync.Mutex -diff --git a/src/cmd/go/internal/get/vcs_test.go b/src/cmd/go/internal/get/vcs_test.go -index 2cb611fabd8..ece78b563ce 100644 ---- a/src/cmd/go/internal/get/vcs_test.go -+++ b/src/cmd/go/internal/get/vcs_test.go -@@ -416,3 +416,46 @@ func TestMatchGoImport(t *testing.T) { - } - } - } -+ -+func TestValidateRepoRootScheme(t *testing.T) { -+ tests := []struct { -+ root string -+ err string -+ }{ -+ { -+ root: "", -+ err: "no scheme", -+ }, -+ { -+ root: "http://", -+ err: "", -+ }, -+ { -+ root: "a://", -+ err: "", -+ }, -+ { -+ root: "a#://", -+ err: "invalid scheme", -+ }, -+ { -+ root: "-config://", -+ err: "invalid scheme", -+ }, -+ } -+ -+ for _, test := range tests { -+ err := validateRepoRootScheme(test.root) -+ if err == nil { -+ if test.err != "" { -+ t.Errorf("validateRepoRootScheme(%q) = nil, want %q", test.root, test.err) -+ } -+ } else if test.err == "" { -+ if err != nil { -+ t.Errorf("validateRepoRootScheme(%q) = %q, want nil", test.root, test.err) -+ } -+ } else if err.Error() != test.err { -+ t.Errorf("validateRepoRootScheme(%q) = %q, want %q", test.root, err, test.err) -+ } -+ } -+} diff --git a/golang-1.5-bootstrap-binary-path.patch b/golang-1.5-bootstrap-binary-path.patch deleted file mode 100644 index af7d069..0000000 --- a/golang-1.5-bootstrap-binary-path.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff -up go/src/cmd/dist/buildtool.go.bootstrap go/src/cmd/dist/buildtool.go ---- go/src/cmd/dist/buildtool.go.bootstrap 2017-07-11 12:05:00.041373419 +0200 -+++ go/src/cmd/dist/buildtool.go 2017-07-11 12:07:27.141775914 +0200 -@@ -153,18 +153,26 @@ func bootstrapBuildTools() { - defer os.Setenv("GOBIN", os.Getenv("GOBIN")) - os.Setenv("GOBIN", "") - -+ hostos := os.Getenv("GOHOSTOS") -+ hostarch := os.Getenv("GOHOSTARCH") -+ - os.Setenv("GOOS", "") - os.Setenv("GOHOSTOS", "") - os.Setenv("GOARCH", "") - 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. Use -gcflags=-l to disable inlining to - // workaround bugs in Go 1.4's compiler. See discussion thread: - // https://groups.google.com/d/msg/golang-dev/Ss7mCKsvk8w/Gsq7VYI0AwAJ - // Use the math_big_pure_go build tag to disable the assembly in math/big - // which may contain unsupported instructions. - cmd := []string{ -- pathf("%s/bin/go", goroot_bootstrap), -+ bingopath, - "install", - "-gcflags=-l", - "-tags=math_big_pure_go", -diff -up go/src/make.bash.bootstrap go/src/make.bash ---- go/src/make.bash.bootstrap 2017-07-11 12:05:00.036373439 +0200 -+++ go/src/make.bash 2017-07-11 12:05:00.041373419 +0200 -@@ -120,8 +120,15 @@ 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 - exit 1 - fi -@@ -130,8 +137,6 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; - echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 - exit 1 - 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 f930b52..0e04a7c 100644 --- a/golang.spec +++ b/golang.spec @@ -96,10 +96,10 @@ %endif %global go_api 1.9 -%global go_version 1.9.5 +%global go_version 1.9.6 Name: golang -Version: 1.9.5 +Version: 1.9.6 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -164,24 +164,12 @@ Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-src = %{version}-%{release} Requires: go-srpm-macros -Patch0: golang-1.2-verbose-build.patch - -# use the arch dependent path in the bootstrap -Patch212: golang-1.5-bootstrap-binary-path.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 - -# Proposed patch by mmunday https://golang.org/cl/35262 -Patch219: s390x-expose-IfInfomsg-X__ifi_pad.patch - -Patch220: s390x-ignore-L0syms.patch - -# https://github.com/golang/go/commit/ca8c361d867d62bd46013c5abbaaad0b2ca6077f -Patch221: use-buildmode-pie-for-pie-testing.patch -# https://github.com/hyangah/go/commit/3502496d03bcd842fd7aac95ec0d7096d581cd26 -Patch222: use-no-pie-where-needed.patch +Patch1: 0001-Make-build-little-bit-more-verbose.patch +Patch2: 0002-Don-t-use-the-bundled-tzdata.patch +Patch3: 0003-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch +Patch4: 0004-Ignore-L0-A-during-linking.patch +Patch5: 0005-Backport-of-https-github.com-golang-go-commit-ca8c36.patch +Patch6: 0006-misc-cgo-testcarchive-use-no-pie-where-needed.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -304,20 +292,12 @@ Requires: %{name} = %{version}-%{release} %prep %setup -q -n go -# increase verbosity of build -%patch0 -p1 -b .verbose - -# use the arch dependent path in the bootstrap -%patch212 -p1 -b .bootstrap - -%patch215 -p1 - -%patch219 -p1 - -%patch220 -p1 - -%patch221 -p1 -b pie -%patch222 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 cp %{SOURCE1} ./src/runtime/ @@ -554,6 +534,9 @@ fi %endif %changelog +* Thu May 03 2018 Jakub Čajka - 1.9.6-1 +- Rebase to 1.9.6 + * Tue Apr 03 2018 Jakub Čajka - 1.9.5-1 - Rebase to 1.9.5 diff --git a/sources b/sources index 9c6b46c..af65b4f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.9.5.src.tar.gz) = 5cde6a3c6e6040ddbcafa75dae551500d0bb15096a523ee29f788cbf3fa11d083d4e4a1b56a094ad2234f967c0d1be280ae00479d5f7c01174dc6da2a5a25924 +SHA512 (go1.9.6.src.tar.gz) = f7863a4fe586414c91465a6a82a47097b2593384688a7c68ad3e9981559047b4faf2c134104ad09a64125576dac557809884d9f125d91108dd51746620a368a2 From c333e76e869a626eb5936d311dc4ba4c29a10e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 11 Jun 2018 09:04:52 +0200 Subject: [PATCH 144/156] Rebase to 1.10.3 --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c3bee51..5eb6010 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ /go1.10.src.tar.gz /go1.10.1.src.tar.gz /go1.10.2.src.tar.gz +/go1.10.3.src.tar.gz diff --git a/golang.spec b/golang.spec index 54ed39b..a697b93 100644 --- a/golang.spec +++ b/golang.spec @@ -102,10 +102,10 @@ %endif %global go_api 1.10 -%global go_version 1.10.2 +%global go_version 1.10.3 Name: golang -Version: 1.10.2 +Version: 1.10.3 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -540,6 +540,9 @@ fi %endif %changelog +* Fri Jun 08 2018 Jakub Čajka - 1.10.3-1 +- Rebase to 1.10.3 + * Wed May 02 2018 Jakub Čajka - 1.10.2-1 - Rebase to 1.10.2 diff --git a/sources b/sources index ac95b0f..d66a8a7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.10.2.src.tar.gz) = 754e60bce1ea3479ebb57bbbb625e3d7875a151e7a6d7a1067478a9e45bde5423f47123d084832bb838acf7675a9d05057b76c1d773e43cae0fb4e7a52acf4a9 +SHA512 (go1.10.3.src.tar.gz) = fd2bd5fcb5c6d0a5336c4b1d2cacb368edbb01359297a83bdedc53f6018642598232f00633fc60fde879050f5f26a810c828d46b5d6626cbcc0702d93ad33fbb From 8547fbcae7ffb31ffe4762b6b8b6ef15b779b4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 11 Jun 2018 13:44:48 +0200 Subject: [PATCH 145/156] Rebase to 1.9.7 --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 85c8935..30946e0 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ /go1.9.4.src.tar.gz /go1.9.5.src.tar.gz /go1.9.6.src.tar.gz +/go1.9.7.src.tar.gz diff --git a/golang.spec b/golang.spec index 0e04a7c..cb7adbd 100644 --- a/golang.spec +++ b/golang.spec @@ -96,10 +96,10 @@ %endif %global go_api 1.9 -%global go_version 1.9.6 +%global go_version 1.9.7 Name: golang -Version: 1.9.6 +Version: 1.9.7 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -534,6 +534,9 @@ fi %endif %changelog +* Mon Jun 11 2018 Jakub Čajka - 1.9.7-1 +- Rebase to 1.9.7 + * Thu May 03 2018 Jakub Čajka - 1.9.6-1 - Rebase to 1.9.6 diff --git a/sources b/sources index af65b4f..8f90cda 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.9.6.src.tar.gz) = f7863a4fe586414c91465a6a82a47097b2593384688a7c68ad3e9981559047b4faf2c134104ad09a64125576dac557809884d9f125d91108dd51746620a368a2 +SHA512 (go1.9.7.src.tar.gz) = 1ed3375870223a73c9cf94839bfd8894b92f44f9a3ba3b2bec1e9cd8d2212519344c8afcb87a516d6ad3e1ccdc74d9dba225a222bdc5e60f6d73cb474d5f7664 From 19d1adeab44ae2434ee16767bb8199fd6caaf9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 4 Jul 2018 14:05:44 +0200 Subject: [PATCH 146/156] Rebase to go1.11beta1 --- .gitignore | 1 + ....Parse-to-properly-initialize-test-e.patch | 51 +++++ ...work-improve-pkgconfig-support-to-wo.patch | 177 ------------------ golang.spec | 31 +-- sources | 2 +- 5 files changed, 73 insertions(+), 189 deletions(-) create mode 100644 0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch delete mode 100644 0003-cmd-go-internal-work-improve-pkgconfig-support-to-wo.patch diff --git a/.gitignore b/.gitignore index 5eb6010..bdbb9b1 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,4 @@ /go1.10.1.src.tar.gz /go1.10.2.src.tar.gz /go1.10.3.src.tar.gz +/go1.11beta1.src.tar.gz diff --git a/0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch b/0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch new file mode 100644 index 0000000..f0add07 --- /dev/null +++ b/0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch @@ -0,0 +1,51 @@ +From b55fe6a3702922f35b8d440f32fd5a54ee92f5f8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jakub=20=C4=8Cajka?= +Date: Mon, 25 Jun 2018 12:31:53 +0200 +Subject: [PATCH] cmd/go: call flag.Parse to properly initialize test + environment variables + +Executing tests in cmd/go/internal/modfetch/gitrepo/fetch_test.go in enviroment +witout outside connectivity in to the internet results in tests failure: + +2018/06/25 12:48:26 git clone --mirror https://vcs-test.golang.org/git/gitrepo1 /tmp/gitrepo-test-221822392/gitrepo2 in : exit status 128: + Cloning into bare repository '/tmp/gitrepo-test-221822392/gitrepo2'... + fatal: unable to access 'https://vcs-test.golang.org/git/gitrepo1/': Could not resolve host: vcs-test.golang.org +FAIL cmd/go/internal/modfetch/gitrepo 0.144s + +Call flag.Parse in TestMain to properly initialize test environment variables + +Fixes #26007 + +Change-Id: I059e27db69c0ca0e01db724035a25d6fefb094b5 +Reviewed-on: https://go-review.googlesource.com/120735 +Run-TryBot: Ian Lance Taylor +Reviewed-by: Brad Fitzpatrick +--- + src/cmd/go/internal/modfetch/gitrepo/fetch_test.go | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/cmd/go/internal/modfetch/gitrepo/fetch_test.go b/src/cmd/go/internal/modfetch/gitrepo/fetch_test.go +index ca932808e8..622249e67d 100644 +--- a/src/cmd/go/internal/modfetch/gitrepo/fetch_test.go ++++ b/src/cmd/go/internal/modfetch/gitrepo/fetch_test.go +@@ -7,6 +7,7 @@ package gitrepo + import ( + "archive/zip" + "bytes" ++ "flag" + "fmt" + "internal/testenv" + "io/ioutil" +@@ -23,6 +24,9 @@ import ( + ) + + func TestMain(m *testing.M) { ++ // needed for initializing the test environment variables as testing.Short ++ // and HasExternalNetwork ++ flag.Parse() + os.Exit(testMain(m)) + } + +-- +2.14.4 + diff --git a/0003-cmd-go-internal-work-improve-pkgconfig-support-to-wo.patch b/0003-cmd-go-internal-work-improve-pkgconfig-support-to-wo.patch deleted file mode 100644 index 933244b..0000000 --- a/0003-cmd-go-internal-work-improve-pkgconfig-support-to-wo.patch +++ /dev/null @@ -1,177 +0,0 @@ -From 18385565374c36eda8306c57715332d5ae6eb9a6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jakub=20=C4=8Cajka?= -Date: Fri, 5 Jan 2018 13:38:55 +0100 -Subject: [PATCH 3/3] cmd/go/internal/work : improve pkgconfig support to work - with latest(1.4+) pkgconf - -Fixes #23373 - -Fix interfacing with latest(1.4+) pkgconf versions, as they have change the output format, by extending parsing function splitPkgConfigOutput to accommodate more possible fragment escaping formats. Function is based on pkgconfigs own implementation at https://github.com/pkgconf/pkgconf/blob/master/libpkgconf/argvsplit.c. Along with this change test case TestSplitPkgConfigOutput have been expanded. Thanks to ignatenko for help on test cases and insights in to the pkgconfig. - -Change-Id: I55301bb564b07128d5564ec1454dd247f84a95c3 ---- - src/cmd/go/internal/work/build_test.go | 44 +++++++++++++++++--- - src/cmd/go/internal/work/exec.go | 75 +++++++++++++++++++++++----------- - 2 files changed, 90 insertions(+), 29 deletions(-) - -diff --git a/src/cmd/go/internal/work/build_test.go b/src/cmd/go/internal/work/build_test.go -index 3f5ba37c64..c3c63a97a4 100644 ---- a/src/cmd/go/internal/work/build_test.go -+++ b/src/cmd/go/internal/work/build_test.go -@@ -39,14 +39,46 @@ func TestSplitPkgConfigOutput(t *testing.T) { - for _, test := range []struct { - in []byte - want []string -+ pass bool - }{ -- {[]byte(`-r:foo -L/usr/white\ space/lib -lfoo\ bar -lbar\ baz`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}}, -- {[]byte(`-lextra\ fun\ arg\\`), []string{`-lextra fun arg\`}}, -- {[]byte(`broken flag\`), []string{"broken", "flag"}}, -- {[]byte("\textra whitespace\r\n"), []string{"extra", "whitespace"}}, -- {[]byte(" \r\n "), nil}, -+ {[]byte(`-r:foo -L/usr/white\ space/lib -lfoo\ bar -lbar\ baz`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}, true}, -+ {[]byte(`-lextra\ fun\ arg\\`), []string{`-lextra fun arg\`}, true}, -+ {[]byte(`broken flag\`), []string{"broken", "flag"}, true}, -+ {[]byte(`extra broken flag \`), []string{"extra", "broken", "flag"}, true}, -+ {[]byte(`\`), nil, true}, -+ {[]byte("\textra whitespace\r\n"), []string{"extra", "whitespace"}, true}, -+ {[]byte(" \r\n "), nil, true}, -+ {[]byte(`"-r:foo" "-L/usr/white space/lib" "-lfoo bar" "-lbar baz"`), []string{"-r:foo", "-L/usr/white space/lib", "-lfoo bar", "-lbar baz"}, true}, -+ {[]byte(`"-lextra fun arg\\"`), []string{`-lextra fun arg\`}, true}, -+ {[]byte(`" \r\n\ "`), []string{` \r\n\ `}, true}, -+ {[]byte(`""`), nil, true}, -+ {[]byte(``), nil, true}, -+ {[]byte(`"\\"`), []string{`\`}, true}, -+ {[]byte(`"\x"`), []string{`\x`}, true}, -+ {[]byte(`"\\x"`), []string{`\x`}, true}, -+ {[]byte(`'\\'`), []string{`\`}, true}, -+ {[]byte(`'\x'`), []string{`\x`}, true}, -+ {[]byte(`"\\x"`), []string{`\x`}, true}, -+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED='"/test/share/doc"'`), []string{"-fPIC", "-I/test/include/foo", `-DQUOTED="/test/share/doc"`}, true}, -+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED="/test/share/doc"`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}, true}, -+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED=\"/test/share/doc\"`), []string{"-fPIC", "-I/test/include/foo", `-DQUOTED="/test/share/doc"`}, true}, -+ {[]byte(`-fPIC -I/test/include/foo -DQUOTED='/test/share/doc'`), []string{"-fPIC", "-I/test/include/foo", "-DQUOTED=/test/share/doc"}, true}, -+ {[]byte(`-DQUOTED='/te\st/share/d\oc'`), []string{`-DQUOTED=/te\st/share/d\oc`}, true}, -+ {[]byte(`-Dhello=10 -Dworld=+32 -DDEFINED_FROM_PKG_CONFIG=hello\ world`), []string{"-Dhello=10", "-Dworld=+32", "-DDEFINED_FROM_PKG_CONFIG=hello world"}, true}, -+ {[]byte(`" \r\n `), nil, false}, -+ {[]byte(`"-r:foo" "-L/usr/white space/lib "-lfoo bar" "-lbar baz"`), nil, false}, -+ {[]byte(`"-lextra fun arg\\`), nil, false}, - } { -- got := splitPkgConfigOutput(test.in) -+ got, err := splitPkgConfigOutput(test.in) -+ if err != nil { -+ if test.pass { -+ t.Errorf("splitPkgConfigOutput(%v) = %v; function returned error %v", test.in, got, err) -+ } -+ if got != nil { -+ t.Errorf("splitPkgConfigOutput failed with error %v and output has been non nil %v", err, got) -+ } -+ continue -+ } - if !reflect.DeepEqual(got, test.want) { - t.Errorf("splitPkgConfigOutput(%v) = %v; want %v", test.in, got, test.want) - } -diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go -index a50c996041..5596638e48 100644 ---- a/src/cmd/go/internal/work/exec.go -+++ b/src/cmd/go/internal/work/exec.go -@@ -900,36 +900,62 @@ func (b *Builder) PkgconfigCmd() string { - } - - // splitPkgConfigOutput parses the pkg-config output into a slice of --// flags. pkg-config always uses \ to escape special characters. --func splitPkgConfigOutput(out []byte) []string { -+// flags. This implements the algorithm from pkgconf/libpkgconf/argvsplit.c -+func splitPkgConfigOutput(out []byte) ([]string, error) { - if len(out) == 0 { -- return nil -+ return nil, nil - } - var flags []string -- flag := make([]byte, len(out)) -- r, w := 0, 0 -- for r < len(out) { -- switch out[r] { -- case ' ', '\t', '\r', '\n': -- if w > 0 { -- flags = append(flags, string(flag[:w])) -+ flag := make([]byte, 0, len(out)) -+ escaped := false -+ quote := byte(0) -+ -+ for _, c := range out { -+ if escaped { -+ if quote == '"' || quote == '\'' { -+ switch c { -+ case '$', '`', '"', '\\': -+ default: -+ flag = append(flag, '\\') -+ } -+ flag = append(flag, c) -+ } else { -+ flag = append(flag, c) - } -- w = 0 -- case '\\': -- r++ -- fallthrough -- default: -- if r < len(out) { -- flag[w] = out[r] -- w++ -+ escaped = false -+ } else if quote != 0 { -+ if c == quote { -+ quote = 0 -+ } else { -+ switch c { -+ case '\\': -+ escaped = true -+ default: -+ flag = append(flag, c) -+ } - } -+ } else if strings.IndexByte(" \t\n\v\f\r", c) < 0 { -+ switch c { -+ case '\\': -+ escaped = true -+ case '\'', '"': -+ quote = c -+ default: -+ flag = append(flag, c) -+ } -+ } else if len(flag) != 0 { -+ flags = append(flags, string(flag)) -+ flag = flag[:0] - } -- r++ - } -- if w > 0 { -- flags = append(flags, string(flag[:w])) -+ -+ if quote != 0 { -+ return nil, errors.New("unterminated quoted string in pkgconf output ") -+ } else if len(flag) != 0 { -+ flags = append(flags, string(flag)) - } -- return flags -+ -+ return flags, nil - } - - // Calls pkg-config if needed and returns the cflags/ldflags needed to build the package. -@@ -961,7 +987,10 @@ func (b *Builder) getPkgConfigFlags(p *load.Package) (cflags, ldflags []string, - return nil, nil, errPrintedOutput - } - if len(out) > 0 { -- cflags = splitPkgConfigOutput(out) -+ cflags, err = splitPkgConfigOutput(out) -+ if err != nil { -+ return nil, nil, err -+ } - if err := checkCompilerFlags("CFLAGS", "pkg-config --cflags", cflags); err != nil { - return nil, nil, err - } --- -2.14.3 - diff --git a/golang.spec b/golang.spec index a697b93..811e77f 100644 --- a/golang.spec +++ b/golang.spec @@ -1,6 +1,6 @@ %bcond_with bootstrap # temporalily ignore test failures -%ifarch %{ix86} aarch64 +%ifarch %{ix86} aarch64 x86_64 %{arm} %bcond_without ignore_tests %else %bcond_with ignore_tests @@ -101,12 +101,12 @@ %global gohostarch s390x %endif -%global go_api 1.10 -%global go_version 1.10.3 +%global go_api 1.11 +%global go_version 1.11beta1 Name: golang -Version: 1.10.3 -Release: 1%{?dist} +Version: 1.11 +Release: 0.beta1.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -134,24 +134,24 @@ Provides: go = %{version}-%{release} # Bundled/Vendored provides generated by # go list -f {{.ImportPath}} ./src/vendor/... | sed "s:_$PWD/src/vendor/::g;s:_:.:;s:.*:Provides\: bundled(golang(&)):" && go list -f {{.ImportPath}} ./src/cmd/vendor/... | sed "s:_$PWD/src/cmd/vendor/::g;s:_:.:;s:.*:Provides\: bundled(golang(&)):" Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305)) -Provides: bundled(golang(golang.org/x/crypto/chacha20poly1305/internal/chacha20)) Provides: bundled(golang(golang.org/x/crypto/cryptobyte)) Provides: bundled(golang(golang.org/x/crypto/cryptobyte/asn1)) Provides: bundled(golang(golang.org/x/crypto/curve25519)) +Provides: bundled(golang(golang.org/x/crypto/internal/chacha20)) Provides: bundled(golang(golang.org/x/crypto/poly1305)) +Provides: bundled(golang(golang.org/x/net/dns/dnsmessage)) +Provides: bundled(golang(golang.org/x/net/http/httpguts)) +Provides: bundled(golang(golang.org/x/net/http/httpproxy)) Provides: bundled(golang(golang.org/x/net/http2/hpack)) Provides: bundled(golang(golang.org/x/net/idna)) Provides: bundled(golang(golang.org/x/net/internal/nettest)) -Provides: bundled(golang(golang.org/x/net/lex/httplex)) Provides: bundled(golang(golang.org/x/net/nettest)) -Provides: bundled(golang(golang.org/x/net/proxy)) Provides: bundled(golang(golang.org/x/text/secure)) Provides: bundled(golang(golang.org/x/text/secure/bidirule)) Provides: bundled(golang(golang.org/x/text/transform)) Provides: bundled(golang(golang.org/x/text/unicode)) Provides: bundled(golang(golang.org/x/text/unicode/bidi)) Provides: bundled(golang(golang.org/x/text/unicode/norm)) -Provides: bundled(golang(github.com/google/pprof)) Provides: bundled(golang(github.com/google/pprof/driver)) Provides: bundled(golang(github.com/google/pprof/internal/binutils)) Provides: bundled(golang(github.com/google/pprof/internal/driver)) @@ -164,12 +164,18 @@ Provides: bundled(golang(github.com/google/pprof/internal/report)) Provides: bundled(golang(github.com/google/pprof/internal/symbolizer)) Provides: bundled(golang(github.com/google/pprof/internal/symbolz)) Provides: bundled(golang(github.com/google/pprof/profile)) -Provides: bundled(golang(github.com/google/pprof/third.party/svg)) +Provides: bundled(golang(github.com/google/pprof/third.party/d3)) +Provides: bundled(golang(github.com/google/pprof/third.party/d3flamegraph)) +Provides: bundled(golang(github.com/google/pprof/third.party/svgpan)) Provides: bundled(golang(github.com/ianlancetaylor/demangle)) Provides: bundled(golang(golang.org/x/arch/arm/armasm)) Provides: bundled(golang(golang.org/x/arch/arm64/arm64asm)) Provides: bundled(golang(golang.org/x/arch/ppc64/ppc64asm)) Provides: bundled(golang(golang.org/x/arch/x86/x86asm)) +Provides: bundled(golang(golang.org/x/crypto/ssh/terminal)) +Provides: bundled(golang(golang.org/x/sys/unix)) +Provides: bundled(golang(golang.org/x/sys/windows)) +Provides: bundled(golang(golang.org/x/sys/windows/registry)) Requires: %{name}-bin = %{version}-%{release} Requires: %{name}-src = %{version}-%{release} @@ -177,7 +183,7 @@ Requires: go-srpm-macros Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch -Patch3: 0003-cmd-go-internal-work-improve-pkgconfig-support-to-wo.patch +Patch3: 0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -540,6 +546,9 @@ fi %endif %changelog +* Wed Jul 04 2018 Jakub Čajka - 1.11-0.beta1.1 +* Rebase to 1.11beta1 + * Fri Jun 08 2018 Jakub Čajka - 1.10.3-1 - Rebase to 1.10.3 diff --git a/sources b/sources index d66a8a7..8bb3599 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.10.3.src.tar.gz) = fd2bd5fcb5c6d0a5336c4b1d2cacb368edbb01359297a83bdedc53f6018642598232f00633fc60fde879050f5f26a810c828d46b5d6626cbcc0702d93ad33fbb +SHA512 (go1.11beta1.src.tar.gz) = a7369cbb05429f0c2ac0aca27ec67a4fe931f4a496ecd77cb901cbb14f8db5f925736b2d7b1af24e0ad0860aa50334911444c4bef5b92c23d73918a3128a71f3 From 72a9f2e92168af21433c7d1f7e7ffd1f4918baff Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 13 Jul 2018 03:12:06 +0000 Subject: [PATCH 147/156] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- golang.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/golang.spec b/golang.spec index 811e77f..7568ab6 100644 --- a/golang.spec +++ b/golang.spec @@ -106,7 +106,7 @@ Name: golang Version: 1.11 -Release: 0.beta1.1%{?dist} +Release: 0.beta1.1%{?dist}.1 Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -546,6 +546,9 @@ fi %endif %changelog +* Fri Jul 13 2018 Fedora Release Engineering - 1.11-0.beta1.1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Wed Jul 04 2018 Jakub Čajka - 1.11-0.beta1.1 * Rebase to 1.11beta1 From 75f7f03cb68778053776cd99185805da8145d643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 18 Jul 2018 14:00:15 +0200 Subject: [PATCH 148/156] Turn off DWARF compression by default as it is not supported by rpm/debuginfo --- ...warf-by-derfault-as-rpm-debuginfo-is.patch | 26 +++++++++++++++++++ golang.spec | 8 +++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch diff --git a/0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch b/0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch new file mode 100644 index 0000000..da9131a --- /dev/null +++ b/0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch @@ -0,0 +1,26 @@ +From 6d0f113b34e323234eeb279984af83ba98e61c10 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jakub=20=C4=8Cajka?= +Date: Wed, 18 Jul 2018 09:42:28 +0200 +Subject: [PATCH 3/3] Don't compress dwarf by derfault as rpm/debuginfo is not + yet ready for it. + +--- + src/cmd/link/internal/ld/main.go | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cmd/link/internal/ld/main.go b/src/cmd/link/internal/ld/main.go +index 23462f1154..565da989dd 100644 +--- a/src/cmd/link/internal/ld/main.go ++++ b/src/cmd/link/internal/ld/main.go +@@ -123,7 +123,7 @@ func Main(arch *sys.Arch, theArch Arch) { + flag.BoolVar(&ctxt.linkShared, "linkshared", false, "link against installed Go shared libraries") + flag.Var(&ctxt.LinkMode, "linkmode", "set link `mode`") + flag.Var(&ctxt.BuildMode, "buildmode", "set build `mode`") +- flag.BoolVar(&ctxt.compressDWARF, "compressdwarf", true, "compress DWARF if possible") ++ flag.BoolVar(&ctxt.compressDWARF, "compressdwarf", false, "compress DWARF if possible") + objabi.Flagfn1("B", "add an ELF NT_GNU_BUILD_ID `note` when using ELF", addbuildinfo) + objabi.Flagfn1("L", "add specified `directory` to library path", func(a string) { Lflag(ctxt, a) }) + objabi.AddVersionFlag() // -V +-- +2.14.4 + diff --git a/golang.spec b/golang.spec index 7568ab6..303ef8b 100644 --- a/golang.spec +++ b/golang.spec @@ -106,7 +106,7 @@ Name: golang Version: 1.11 -Release: 0.beta1.1%{?dist}.1 +Release: 0.beta1.2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -184,6 +184,7 @@ Requires: go-srpm-macros Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch Patch3: 0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch +Patch4: 0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -310,6 +311,7 @@ Requires: %{name} = %{version}-%{release} %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 cp %{SOURCE1} ./src/runtime/ @@ -546,6 +548,10 @@ fi %endif %changelog +* Wed Jul 18 2018 Jakub Čajka - 1.11-0.beta1.2 +- Turn off DWARF compression by default as it is not supported by rpm/debuginfo +- Related: BZ#1602096 + * Fri Jul 13 2018 Fedora Release Engineering - 1.11-0.beta1.1.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 62f2ae0511be0fff1c8f8b941aee2def28f8d662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 20 Jul 2018 10:14:54 +0200 Subject: [PATCH 149/156] Rebase to 1.11beta2 --- .gitignore | 1 + ....Parse-to-properly-initialize-test-e.patch | 51 ------------------- golang.spec | 11 ++-- sources | 2 +- 4 files changed, 8 insertions(+), 57 deletions(-) delete mode 100644 0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch diff --git a/.gitignore b/.gitignore index bdbb9b1..6efcfaf 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,4 @@ /go1.10.2.src.tar.gz /go1.10.3.src.tar.gz /go1.11beta1.src.tar.gz +/go1.11beta2.src.tar.gz diff --git a/0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch b/0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch deleted file mode 100644 index f0add07..0000000 --- a/0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch +++ /dev/null @@ -1,51 +0,0 @@ -From b55fe6a3702922f35b8d440f32fd5a54ee92f5f8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jakub=20=C4=8Cajka?= -Date: Mon, 25 Jun 2018 12:31:53 +0200 -Subject: [PATCH] cmd/go: call flag.Parse to properly initialize test - environment variables - -Executing tests in cmd/go/internal/modfetch/gitrepo/fetch_test.go in enviroment -witout outside connectivity in to the internet results in tests failure: - -2018/06/25 12:48:26 git clone --mirror https://vcs-test.golang.org/git/gitrepo1 /tmp/gitrepo-test-221822392/gitrepo2 in : exit status 128: - Cloning into bare repository '/tmp/gitrepo-test-221822392/gitrepo2'... - fatal: unable to access 'https://vcs-test.golang.org/git/gitrepo1/': Could not resolve host: vcs-test.golang.org -FAIL cmd/go/internal/modfetch/gitrepo 0.144s - -Call flag.Parse in TestMain to properly initialize test environment variables - -Fixes #26007 - -Change-Id: I059e27db69c0ca0e01db724035a25d6fefb094b5 -Reviewed-on: https://go-review.googlesource.com/120735 -Run-TryBot: Ian Lance Taylor -Reviewed-by: Brad Fitzpatrick ---- - src/cmd/go/internal/modfetch/gitrepo/fetch_test.go | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/cmd/go/internal/modfetch/gitrepo/fetch_test.go b/src/cmd/go/internal/modfetch/gitrepo/fetch_test.go -index ca932808e8..622249e67d 100644 ---- a/src/cmd/go/internal/modfetch/gitrepo/fetch_test.go -+++ b/src/cmd/go/internal/modfetch/gitrepo/fetch_test.go -@@ -7,6 +7,7 @@ package gitrepo - import ( - "archive/zip" - "bytes" -+ "flag" - "fmt" - "internal/testenv" - "io/ioutil" -@@ -23,6 +24,9 @@ import ( - ) - - func TestMain(m *testing.M) { -+ // needed for initializing the test environment variables as testing.Short -+ // and HasExternalNetwork -+ flag.Parse() - os.Exit(testMain(m)) - } - --- -2.14.4 - diff --git a/golang.spec b/golang.spec index 303ef8b..99b7f00 100644 --- a/golang.spec +++ b/golang.spec @@ -102,11 +102,11 @@ %endif %global go_api 1.11 -%global go_version 1.11beta1 +%global go_version 1.11beta2 Name: golang Version: 1.11 -Release: 0.beta1.2%{?dist} +Release: 0.beta2.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -183,8 +183,7 @@ Requires: go-srpm-macros Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch -Patch3: 0001-cmd-go-call-flag.Parse-to-properly-initialize-test-e.patch -Patch4: 0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch +Patch3: 0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -311,7 +310,6 @@ Requires: %{name} = %{version}-%{release} %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 cp %{SOURCE1} ./src/runtime/ @@ -548,6 +546,9 @@ fi %endif %changelog +* Fri Jul 20 2018 Jakub Čajka - 1.11-0.beta2.1 +- Rebase to 1.11beta2 + * Wed Jul 18 2018 Jakub Čajka - 1.11-0.beta1.2 - Turn off DWARF compression by default as it is not supported by rpm/debuginfo - Related: BZ#1602096 diff --git a/sources b/sources index 8bb3599..2666473 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.11beta1.src.tar.gz) = a7369cbb05429f0c2ac0aca27ec67a4fe931f4a496ecd77cb901cbb14f8db5f925736b2d7b1af24e0ad0860aa50334911444c4bef5b92c23d73918a3128a71f3 +SHA512 (go1.11beta2.src.tar.gz) = 0b88364f15c1b41c19c2dca3e69e4bb848d8534540f80b50e9cca00889398f464647530a972ec763b925e2d850ee4e88f08abda3ec01384462ff423e281e24aa From 4043bb182de77bb1a846e801461e5a6e645c736f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Fri, 27 Jul 2018 14:56:43 +0200 Subject: [PATCH 150/156] Turn on back DWARF compression by default Use less memory on 32bit targets during build --- ...stricter-inlining-threshold-in-large.patch | 1310 +++++++++++++++++ ...warf-by-derfault-as-rpm-debuginfo-is.patch | 26 - golang.spec | 10 +- 3 files changed, 1318 insertions(+), 28 deletions(-) create mode 100644 0001-cmd-compile-set-stricter-inlining-threshold-in-large.patch delete mode 100644 0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch diff --git a/0001-cmd-compile-set-stricter-inlining-threshold-in-large.patch b/0001-cmd-compile-set-stricter-inlining-threshold-in-large.patch new file mode 100644 index 0000000..aaf9eb6 --- /dev/null +++ b/0001-cmd-compile-set-stricter-inlining-threshold-in-large.patch @@ -0,0 +1,1310 @@ +From 5fc70b6fac0664f3f9d2c2948ba78db420ba70c5 Mon Sep 17 00:00:00 2001 +From: Keith Randall +Date: Mon, 23 Jul 2018 13:09:48 -0700 +Subject: [PATCH] cmd/compile: set stricter inlining threshold in large + functions + +If we're compiling a large function, be more picky about how big +the function we're inlining is. If the function is >5000 nodes, +we lower the inlining threshold from a cost of 80 to 20. + +Turns out reflect.Value's cost is exactly 80. That's the function +at issue in #26546. + +20 was chosen as a proxy for "inlined body is smaller than the call would be". +Simple functions still get inlined, like this one at cost 7: + +func ifaceIndir(t *rtype) bool { + return t.kind&kindDirectIface == 0 +} + +5000 nodes was chosen as the big function size. Here are all the +5000+ node (~~1000+ lines) functions in the stdlib: + +5187 cmd/internal/obj/arm (*ctxt5).asmout +6879 cmd/internal/obj/s390x (*ctxtz).asmout +6567 cmd/internal/obj/ppc64 (*ctxt9).asmout +9643 cmd/internal/obj/arm64 (*ctxt7).asmout +5042 cmd/internal/obj/x86 (*AsmBuf).doasm +8768 cmd/compile/internal/ssa rewriteBlockAMD64 +8878 cmd/compile/internal/ssa rewriteBlockARM +8344 cmd/compile/internal/ssa rewriteValueARM64_OpARM64OR_20 +7916 cmd/compile/internal/ssa rewriteValueARM64_OpARM64OR_30 +5427 cmd/compile/internal/ssa rewriteBlockARM64 +5126 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_50 +6152 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_60 +6412 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_70 +6486 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_80 +6534 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_90 +6534 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_100 +6534 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_110 +6675 cmd/compile/internal/gc typecheck1 +5433 cmd/compile/internal/gc walkexpr +14070 cmd/vendor/golang.org/x/arch/arm64/arm64asm decodeArg + +There are a lot more smaller (~1000 node) functions in the stdlib. +The function in #26546 has 12477 nodes. + +At some point it might be nice to have a better heuristic for "inlined +body is smaller than the call", a non-cliff way to scale down the cost +as the function gets bigger, doing cheaper inlined calls first, etc. +All that can wait for another release. I'd like to do this CL for +1.11. + +Fixes #26546 +Update #17566 + +Change-Id: Idda13020e46ec2b28d79a17217f44b189f8139ac +Reviewed-on: https://go-review.googlesource.com/125516 +Run-TryBot: Keith Randall +TryBot-Result: Gobot Gobot +Reviewed-by: David Chase +--- + src/cmd/compile/internal/gc/inl.go | 72 ++- + test/inline_big.go | 1029 ++++++++++++++++++++++++++++++++++++ + 2 files changed, 1082 insertions(+), 19 deletions(-) + create mode 100644 test/inline_big.go + +diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go +index cb3ddaf2a5..feb3c8556a 100644 +--- a/src/cmd/compile/internal/gc/inl.go ++++ b/src/cmd/compile/internal/gc/inl.go +@@ -41,6 +41,9 @@ const ( + inlineExtraCallCost = inlineMaxBudget // default is do not inline, -l=4 enables by using 1 instead. + inlineExtraPanicCost = 1 // do not penalize inlining panics. + inlineExtraThrowCost = inlineMaxBudget // with current (2018-05/1.11) code, inlining runtime.throw does not help. ++ ++ inlineBigFunctionNodes = 5000 // Functions with this many nodes are considered "big". ++ inlineBigFunctionMaxCost = 20 // Max cost of inlinee when inlining into a "big" function. + ) + + // Get the function's package. For ordinary functions it's on the ->sym, but for imported methods +@@ -459,12 +462,38 @@ func inlcopy(n *Node) *Node { + return m + } + ++func countNodes(n *Node) int { ++ if n == nil { ++ return 0 ++ } ++ cnt := 1 ++ cnt += countNodes(n.Left) ++ cnt += countNodes(n.Right) ++ for _, n1 := range n.Ninit.Slice() { ++ cnt += countNodes(n1) ++ } ++ for _, n1 := range n.Nbody.Slice() { ++ cnt += countNodes(n1) ++ } ++ for _, n1 := range n.List.Slice() { ++ cnt += countNodes(n1) ++ } ++ for _, n1 := range n.Rlist.Slice() { ++ cnt += countNodes(n1) ++ } ++ return cnt ++} ++ + // Inlcalls/nodelist/node walks fn's statements and expressions and substitutes any + // calls made to inlineable functions. This is the external entry point. + func inlcalls(fn *Node) { + savefn := Curfn + Curfn = fn +- fn = inlnode(fn) ++ maxCost := int32(inlineMaxBudget) ++ if countNodes(fn) >= inlineBigFunctionNodes { ++ maxCost = inlineBigFunctionMaxCost ++ } ++ fn = inlnode(fn, maxCost) + if fn != Curfn { + Fatalf("inlnode replaced curfn") + } +@@ -505,10 +534,10 @@ func inlconv2list(n *Node) []*Node { + return s + } + +-func inlnodelist(l Nodes) { ++func inlnodelist(l Nodes, maxCost int32) { + s := l.Slice() + for i := range s { +- s[i] = inlnode(s[i]) ++ s[i] = inlnode(s[i], maxCost) + } + } + +@@ -525,7 +554,7 @@ func inlnodelist(l Nodes) { + // shorter and less complicated. + // The result of inlnode MUST be assigned back to n, e.g. + // n.Left = inlnode(n.Left) +-func inlnode(n *Node) *Node { ++func inlnode(n *Node, maxCost int32) *Node { + if n == nil { + return n + } +@@ -547,19 +576,19 @@ func inlnode(n *Node) *Node { + + lno := setlineno(n) + +- inlnodelist(n.Ninit) ++ inlnodelist(n.Ninit, maxCost) + for _, n1 := range n.Ninit.Slice() { + if n1.Op == OINLCALL { + inlconv2stmt(n1) + } + } + +- n.Left = inlnode(n.Left) ++ n.Left = inlnode(n.Left, maxCost) + if n.Left != nil && n.Left.Op == OINLCALL { + n.Left = inlconv2expr(n.Left) + } + +- n.Right = inlnode(n.Right) ++ n.Right = inlnode(n.Right, maxCost) + if n.Right != nil && n.Right.Op == OINLCALL { + if n.Op == OFOR || n.Op == OFORUNTIL { + inlconv2stmt(n.Right) +@@ -568,7 +597,7 @@ func inlnode(n *Node) *Node { + } + } + +- inlnodelist(n.List) ++ inlnodelist(n.List, maxCost) + switch n.Op { + case OBLOCK: + for _, n2 := range n.List.Slice() { +@@ -595,7 +624,7 @@ func inlnode(n *Node) *Node { + } + } + +- inlnodelist(n.Rlist) ++ inlnodelist(n.Rlist, maxCost) + if n.Op == OAS2FUNC && n.Rlist.First().Op == OINLCALL { + n.Rlist.Set(inlconv2list(n.Rlist.First())) + n.Op = OAS2 +@@ -614,7 +643,7 @@ func inlnode(n *Node) *Node { + } + } + +- inlnodelist(n.Nbody) ++ inlnodelist(n.Nbody, maxCost) + for _, n := range n.Nbody.Slice() { + if n.Op == OINLCALL { + inlconv2stmt(n) +@@ -637,12 +666,12 @@ func inlnode(n *Node) *Node { + fmt.Printf("%v:call to func %+v\n", n.Line(), n.Left) + } + if n.Left.Func != nil && n.Left.Func.Inl != nil && !isIntrinsicCall(n) { // normal case +- n = mkinlcall(n, n.Left) ++ n = mkinlcall(n, n.Left, maxCost) + } else if n.Left.isMethodExpression() && asNode(n.Left.Sym.Def) != nil { +- n = mkinlcall(n, asNode(n.Left.Sym.Def)) ++ n = mkinlcall(n, asNode(n.Left.Sym.Def), maxCost) + } else if n.Left.Op == OCLOSURE { + if f := inlinableClosure(n.Left); f != nil { +- n = mkinlcall(n, f) ++ n = mkinlcall(n, f, maxCost) + } + } else if n.Left.Op == ONAME && n.Left.Name != nil && n.Left.Name.Defn != nil { + if d := n.Left.Name.Defn; d.Op == OAS && d.Right.Op == OCLOSURE { +@@ -668,7 +697,7 @@ func inlnode(n *Node) *Node { + } + break + } +- n = mkinlcall(n, f) ++ n = mkinlcall(n, f, maxCost) + } + } + } +@@ -687,7 +716,7 @@ func inlnode(n *Node) *Node { + Fatalf("no function definition for [%p] %+v\n", n.Left.Type, n.Left.Type) + } + +- n = mkinlcall(n, asNode(n.Left.Type.FuncType().Nname)) ++ n = mkinlcall(n, asNode(n.Left.Type.FuncType().Nname), maxCost) + } + + lineno = lno +@@ -788,7 +817,7 @@ func (v *reassignVisitor) visitList(l Nodes) *Node { + + // The result of mkinlcall MUST be assigned back to n, e.g. + // n.Left = mkinlcall(n.Left, fn, isddd) +-func mkinlcall(n *Node, fn *Node) *Node { ++func mkinlcall(n *Node, fn *Node, maxCost int32) *Node { + save_safemode := safemode + + // imported functions may refer to unsafe as long as the +@@ -798,7 +827,7 @@ func mkinlcall(n *Node, fn *Node) *Node { + if pkg != localpkg && pkg != nil { + safemode = false + } +- n = mkinlcall1(n, fn) ++ n = mkinlcall1(n, fn, maxCost) + safemode = save_safemode + return n + } +@@ -824,11 +853,16 @@ var inlgen int + // parameters. + // The result of mkinlcall1 MUST be assigned back to n, e.g. + // n.Left = mkinlcall1(n.Left, fn, isddd) +-func mkinlcall1(n, fn *Node) *Node { ++func mkinlcall1(n, fn *Node, maxCost int32) *Node { + if fn.Func.Inl == nil { + // No inlinable body. + return n + } ++ if fn.Func.Inl.Cost > maxCost { ++ // The inlined function body is too big. Typically we use this check to restrict ++ // inlining into very big functions. See issue 26546 and 17566. ++ return n ++ } + + if fn == Curfn || fn.Name.Defn == Curfn { + // Can't recursively inline a function into itself. +@@ -1094,7 +1128,7 @@ func mkinlcall1(n, fn *Node) *Node { + // instead we emit the things that the body needs + // and each use must redo the inlining. + // luckily these are small. +- inlnodelist(call.Nbody) ++ inlnodelist(call.Nbody, maxCost) + for _, n := range call.Nbody.Slice() { + if n.Op == OINLCALL { + inlconv2stmt(n) +diff --git a/test/inline_big.go b/test/inline_big.go +new file mode 100644 +index 0000000000..c4af15b4e1 +--- /dev/null ++++ b/test/inline_big.go +@@ -0,0 +1,1029 @@ ++// errorcheck -0 -m=2 ++ ++// Copyright 2018 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. ++ ++// Test that we restrict inlining into very large functions. ++// See issue #26546. ++ ++package foo ++ ++func small(a []int) int { // ERROR "can inline small as:.*" "small a does not escape" ++ // Cost 16 body (need cost < 20). ++ // See cmd/compile/internal/gc/inl.go:inlineBigFunction* ++ return a[0] + a[1] + a[2] + a[3] ++} ++func medium(a []int) int { // ERROR "can inline medium as:.*" "medium a does not escape" ++ // Cost 32 body (need cost > 20 and cost < 80). ++ // See cmd/compile/internal/gc/inl.go:inlineBigFunction* ++ return a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[7] ++} ++ ++func f(a []int) int { // ERROR "cannot inline f:.*" "f a does not escape" ++ // Add lots of nodes to f's body. We need >5000. ++ // See cmd/compile/internal/gc/inl.go:inlineBigFunction* ++ a[0] = 0 ++ a[1] = 0 ++ a[2] = 0 ++ a[3] = 0 ++ a[4] = 0 ++ a[5] = 0 ++ a[6] = 0 ++ a[7] = 0 ++ a[8] = 0 ++ a[9] = 0 ++ a[10] = 0 ++ a[11] = 0 ++ a[12] = 0 ++ a[13] = 0 ++ a[14] = 0 ++ a[15] = 0 ++ a[16] = 0 ++ a[17] = 0 ++ a[18] = 0 ++ a[19] = 0 ++ a[20] = 0 ++ a[21] = 0 ++ a[22] = 0 ++ a[23] = 0 ++ a[24] = 0 ++ a[25] = 0 ++ a[26] = 0 ++ a[27] = 0 ++ a[28] = 0 ++ a[29] = 0 ++ a[30] = 0 ++ a[31] = 0 ++ a[32] = 0 ++ a[33] = 0 ++ a[34] = 0 ++ a[35] = 0 ++ a[36] = 0 ++ a[37] = 0 ++ a[38] = 0 ++ a[39] = 0 ++ a[40] = 0 ++ a[41] = 0 ++ a[42] = 0 ++ a[43] = 0 ++ a[44] = 0 ++ a[45] = 0 ++ a[46] = 0 ++ a[47] = 0 ++ a[48] = 0 ++ a[49] = 0 ++ a[50] = 0 ++ a[51] = 0 ++ a[52] = 0 ++ a[53] = 0 ++ a[54] = 0 ++ a[55] = 0 ++ a[56] = 0 ++ a[57] = 0 ++ a[58] = 0 ++ a[59] = 0 ++ a[60] = 0 ++ a[61] = 0 ++ a[62] = 0 ++ a[63] = 0 ++ a[64] = 0 ++ a[65] = 0 ++ a[66] = 0 ++ a[67] = 0 ++ a[68] = 0 ++ a[69] = 0 ++ a[70] = 0 ++ a[71] = 0 ++ a[72] = 0 ++ a[73] = 0 ++ a[74] = 0 ++ a[75] = 0 ++ a[76] = 0 ++ a[77] = 0 ++ a[78] = 0 ++ a[79] = 0 ++ a[80] = 0 ++ a[81] = 0 ++ a[82] = 0 ++ a[83] = 0 ++ a[84] = 0 ++ a[85] = 0 ++ a[86] = 0 ++ a[87] = 0 ++ a[88] = 0 ++ a[89] = 0 ++ a[90] = 0 ++ a[91] = 0 ++ a[92] = 0 ++ a[93] = 0 ++ a[94] = 0 ++ a[95] = 0 ++ a[96] = 0 ++ a[97] = 0 ++ a[98] = 0 ++ a[99] = 0 ++ a[100] = 0 ++ a[101] = 0 ++ a[102] = 0 ++ a[103] = 0 ++ a[104] = 0 ++ a[105] = 0 ++ a[106] = 0 ++ a[107] = 0 ++ a[108] = 0 ++ a[109] = 0 ++ a[110] = 0 ++ a[111] = 0 ++ a[112] = 0 ++ a[113] = 0 ++ a[114] = 0 ++ a[115] = 0 ++ a[116] = 0 ++ a[117] = 0 ++ a[118] = 0 ++ a[119] = 0 ++ a[120] = 0 ++ a[121] = 0 ++ a[122] = 0 ++ a[123] = 0 ++ a[124] = 0 ++ a[125] = 0 ++ a[126] = 0 ++ a[127] = 0 ++ a[128] = 0 ++ a[129] = 0 ++ a[130] = 0 ++ a[131] = 0 ++ a[132] = 0 ++ a[133] = 0 ++ a[134] = 0 ++ a[135] = 0 ++ a[136] = 0 ++ a[137] = 0 ++ a[138] = 0 ++ a[139] = 0 ++ a[140] = 0 ++ a[141] = 0 ++ a[142] = 0 ++ a[143] = 0 ++ a[144] = 0 ++ a[145] = 0 ++ a[146] = 0 ++ a[147] = 0 ++ a[148] = 0 ++ a[149] = 0 ++ a[150] = 0 ++ a[151] = 0 ++ a[152] = 0 ++ a[153] = 0 ++ a[154] = 0 ++ a[155] = 0 ++ a[156] = 0 ++ a[157] = 0 ++ a[158] = 0 ++ a[159] = 0 ++ a[160] = 0 ++ a[161] = 0 ++ a[162] = 0 ++ a[163] = 0 ++ a[164] = 0 ++ a[165] = 0 ++ a[166] = 0 ++ a[167] = 0 ++ a[168] = 0 ++ a[169] = 0 ++ a[170] = 0 ++ a[171] = 0 ++ a[172] = 0 ++ a[173] = 0 ++ a[174] = 0 ++ a[175] = 0 ++ a[176] = 0 ++ a[177] = 0 ++ a[178] = 0 ++ a[179] = 0 ++ a[180] = 0 ++ a[181] = 0 ++ a[182] = 0 ++ a[183] = 0 ++ a[184] = 0 ++ a[185] = 0 ++ a[186] = 0 ++ a[187] = 0 ++ a[188] = 0 ++ a[189] = 0 ++ a[190] = 0 ++ a[191] = 0 ++ a[192] = 0 ++ a[193] = 0 ++ a[194] = 0 ++ a[195] = 0 ++ a[196] = 0 ++ a[197] = 0 ++ a[198] = 0 ++ a[199] = 0 ++ a[200] = 0 ++ a[201] = 0 ++ a[202] = 0 ++ a[203] = 0 ++ a[204] = 0 ++ a[205] = 0 ++ a[206] = 0 ++ a[207] = 0 ++ a[208] = 0 ++ a[209] = 0 ++ a[210] = 0 ++ a[211] = 0 ++ a[212] = 0 ++ a[213] = 0 ++ a[214] = 0 ++ a[215] = 0 ++ a[216] = 0 ++ a[217] = 0 ++ a[218] = 0 ++ a[219] = 0 ++ a[220] = 0 ++ a[221] = 0 ++ a[222] = 0 ++ a[223] = 0 ++ a[224] = 0 ++ a[225] = 0 ++ a[226] = 0 ++ a[227] = 0 ++ a[228] = 0 ++ a[229] = 0 ++ a[230] = 0 ++ a[231] = 0 ++ a[232] = 0 ++ a[233] = 0 ++ a[234] = 0 ++ a[235] = 0 ++ a[236] = 0 ++ a[237] = 0 ++ a[238] = 0 ++ a[239] = 0 ++ a[240] = 0 ++ a[241] = 0 ++ a[242] = 0 ++ a[243] = 0 ++ a[244] = 0 ++ a[245] = 0 ++ a[246] = 0 ++ a[247] = 0 ++ a[248] = 0 ++ a[249] = 0 ++ a[250] = 0 ++ a[251] = 0 ++ a[252] = 0 ++ a[253] = 0 ++ a[254] = 0 ++ a[255] = 0 ++ a[256] = 0 ++ a[257] = 0 ++ a[258] = 0 ++ a[259] = 0 ++ a[260] = 0 ++ a[261] = 0 ++ a[262] = 0 ++ a[263] = 0 ++ a[264] = 0 ++ a[265] = 0 ++ a[266] = 0 ++ a[267] = 0 ++ a[268] = 0 ++ a[269] = 0 ++ a[270] = 0 ++ a[271] = 0 ++ a[272] = 0 ++ a[273] = 0 ++ a[274] = 0 ++ a[275] = 0 ++ a[276] = 0 ++ a[277] = 0 ++ a[278] = 0 ++ a[279] = 0 ++ a[280] = 0 ++ a[281] = 0 ++ a[282] = 0 ++ a[283] = 0 ++ a[284] = 0 ++ a[285] = 0 ++ a[286] = 0 ++ a[287] = 0 ++ a[288] = 0 ++ a[289] = 0 ++ a[290] = 0 ++ a[291] = 0 ++ a[292] = 0 ++ a[293] = 0 ++ a[294] = 0 ++ a[295] = 0 ++ a[296] = 0 ++ a[297] = 0 ++ a[298] = 0 ++ a[299] = 0 ++ a[300] = 0 ++ a[301] = 0 ++ a[302] = 0 ++ a[303] = 0 ++ a[304] = 0 ++ a[305] = 0 ++ a[306] = 0 ++ a[307] = 0 ++ a[308] = 0 ++ a[309] = 0 ++ a[310] = 0 ++ a[311] = 0 ++ a[312] = 0 ++ a[313] = 0 ++ a[314] = 0 ++ a[315] = 0 ++ a[316] = 0 ++ a[317] = 0 ++ a[318] = 0 ++ a[319] = 0 ++ a[320] = 0 ++ a[321] = 0 ++ a[322] = 0 ++ a[323] = 0 ++ a[324] = 0 ++ a[325] = 0 ++ a[326] = 0 ++ a[327] = 0 ++ a[328] = 0 ++ a[329] = 0 ++ a[330] = 0 ++ a[331] = 0 ++ a[332] = 0 ++ a[333] = 0 ++ a[334] = 0 ++ a[335] = 0 ++ a[336] = 0 ++ a[337] = 0 ++ a[338] = 0 ++ a[339] = 0 ++ a[340] = 0 ++ a[341] = 0 ++ a[342] = 0 ++ a[343] = 0 ++ a[344] = 0 ++ a[345] = 0 ++ a[346] = 0 ++ a[347] = 0 ++ a[348] = 0 ++ a[349] = 0 ++ a[350] = 0 ++ a[351] = 0 ++ a[352] = 0 ++ a[353] = 0 ++ a[354] = 0 ++ a[355] = 0 ++ a[356] = 0 ++ a[357] = 0 ++ a[358] = 0 ++ a[359] = 0 ++ a[360] = 0 ++ a[361] = 0 ++ a[362] = 0 ++ a[363] = 0 ++ a[364] = 0 ++ a[365] = 0 ++ a[366] = 0 ++ a[367] = 0 ++ a[368] = 0 ++ a[369] = 0 ++ a[370] = 0 ++ a[371] = 0 ++ a[372] = 0 ++ a[373] = 0 ++ a[374] = 0 ++ a[375] = 0 ++ a[376] = 0 ++ a[377] = 0 ++ a[378] = 0 ++ a[379] = 0 ++ a[380] = 0 ++ a[381] = 0 ++ a[382] = 0 ++ a[383] = 0 ++ a[384] = 0 ++ a[385] = 0 ++ a[386] = 0 ++ a[387] = 0 ++ a[388] = 0 ++ a[389] = 0 ++ a[390] = 0 ++ a[391] = 0 ++ a[392] = 0 ++ a[393] = 0 ++ a[394] = 0 ++ a[395] = 0 ++ a[396] = 0 ++ a[397] = 0 ++ a[398] = 0 ++ a[399] = 0 ++ a[400] = 0 ++ a[401] = 0 ++ a[402] = 0 ++ a[403] = 0 ++ a[404] = 0 ++ a[405] = 0 ++ a[406] = 0 ++ a[407] = 0 ++ a[408] = 0 ++ a[409] = 0 ++ a[410] = 0 ++ a[411] = 0 ++ a[412] = 0 ++ a[413] = 0 ++ a[414] = 0 ++ a[415] = 0 ++ a[416] = 0 ++ a[417] = 0 ++ a[418] = 0 ++ a[419] = 0 ++ a[420] = 0 ++ a[421] = 0 ++ a[422] = 0 ++ a[423] = 0 ++ a[424] = 0 ++ a[425] = 0 ++ a[426] = 0 ++ a[427] = 0 ++ a[428] = 0 ++ a[429] = 0 ++ a[430] = 0 ++ a[431] = 0 ++ a[432] = 0 ++ a[433] = 0 ++ a[434] = 0 ++ a[435] = 0 ++ a[436] = 0 ++ a[437] = 0 ++ a[438] = 0 ++ a[439] = 0 ++ a[440] = 0 ++ a[441] = 0 ++ a[442] = 0 ++ a[443] = 0 ++ a[444] = 0 ++ a[445] = 0 ++ a[446] = 0 ++ a[447] = 0 ++ a[448] = 0 ++ a[449] = 0 ++ a[450] = 0 ++ a[451] = 0 ++ a[452] = 0 ++ a[453] = 0 ++ a[454] = 0 ++ a[455] = 0 ++ a[456] = 0 ++ a[457] = 0 ++ a[458] = 0 ++ a[459] = 0 ++ a[460] = 0 ++ a[461] = 0 ++ a[462] = 0 ++ a[463] = 0 ++ a[464] = 0 ++ a[465] = 0 ++ a[466] = 0 ++ a[467] = 0 ++ a[468] = 0 ++ a[469] = 0 ++ a[470] = 0 ++ a[471] = 0 ++ a[472] = 0 ++ a[473] = 0 ++ a[474] = 0 ++ a[475] = 0 ++ a[476] = 0 ++ a[477] = 0 ++ a[478] = 0 ++ a[479] = 0 ++ a[480] = 0 ++ a[481] = 0 ++ a[482] = 0 ++ a[483] = 0 ++ a[484] = 0 ++ a[485] = 0 ++ a[486] = 0 ++ a[487] = 0 ++ a[488] = 0 ++ a[489] = 0 ++ a[490] = 0 ++ a[491] = 0 ++ a[492] = 0 ++ a[493] = 0 ++ a[494] = 0 ++ a[495] = 0 ++ a[496] = 0 ++ a[497] = 0 ++ a[498] = 0 ++ a[499] = 0 ++ a[500] = 0 ++ a[501] = 0 ++ a[502] = 0 ++ a[503] = 0 ++ a[504] = 0 ++ a[505] = 0 ++ a[506] = 0 ++ a[507] = 0 ++ a[508] = 0 ++ a[509] = 0 ++ a[510] = 0 ++ a[511] = 0 ++ a[512] = 0 ++ a[513] = 0 ++ a[514] = 0 ++ a[515] = 0 ++ a[516] = 0 ++ a[517] = 0 ++ a[518] = 0 ++ a[519] = 0 ++ a[520] = 0 ++ a[521] = 0 ++ a[522] = 0 ++ a[523] = 0 ++ a[524] = 0 ++ a[525] = 0 ++ a[526] = 0 ++ a[527] = 0 ++ a[528] = 0 ++ a[529] = 0 ++ a[530] = 0 ++ a[531] = 0 ++ a[532] = 0 ++ a[533] = 0 ++ a[534] = 0 ++ a[535] = 0 ++ a[536] = 0 ++ a[537] = 0 ++ a[538] = 0 ++ a[539] = 0 ++ a[540] = 0 ++ a[541] = 0 ++ a[542] = 0 ++ a[543] = 0 ++ a[544] = 0 ++ a[545] = 0 ++ a[546] = 0 ++ a[547] = 0 ++ a[548] = 0 ++ a[549] = 0 ++ a[550] = 0 ++ a[551] = 0 ++ a[552] = 0 ++ a[553] = 0 ++ a[554] = 0 ++ a[555] = 0 ++ a[556] = 0 ++ a[557] = 0 ++ a[558] = 0 ++ a[559] = 0 ++ a[560] = 0 ++ a[561] = 0 ++ a[562] = 0 ++ a[563] = 0 ++ a[564] = 0 ++ a[565] = 0 ++ a[566] = 0 ++ a[567] = 0 ++ a[568] = 0 ++ a[569] = 0 ++ a[570] = 0 ++ a[571] = 0 ++ a[572] = 0 ++ a[573] = 0 ++ a[574] = 0 ++ a[575] = 0 ++ a[576] = 0 ++ a[577] = 0 ++ a[578] = 0 ++ a[579] = 0 ++ a[580] = 0 ++ a[581] = 0 ++ a[582] = 0 ++ a[583] = 0 ++ a[584] = 0 ++ a[585] = 0 ++ a[586] = 0 ++ a[587] = 0 ++ a[588] = 0 ++ a[589] = 0 ++ a[590] = 0 ++ a[591] = 0 ++ a[592] = 0 ++ a[593] = 0 ++ a[594] = 0 ++ a[595] = 0 ++ a[596] = 0 ++ a[597] = 0 ++ a[598] = 0 ++ a[599] = 0 ++ a[600] = 0 ++ a[601] = 0 ++ a[602] = 0 ++ a[603] = 0 ++ a[604] = 0 ++ a[605] = 0 ++ a[606] = 0 ++ a[607] = 0 ++ a[608] = 0 ++ a[609] = 0 ++ a[610] = 0 ++ a[611] = 0 ++ a[612] = 0 ++ a[613] = 0 ++ a[614] = 0 ++ a[615] = 0 ++ a[616] = 0 ++ a[617] = 0 ++ a[618] = 0 ++ a[619] = 0 ++ a[620] = 0 ++ a[621] = 0 ++ a[622] = 0 ++ a[623] = 0 ++ a[624] = 0 ++ a[625] = 0 ++ a[626] = 0 ++ a[627] = 0 ++ a[628] = 0 ++ a[629] = 0 ++ a[630] = 0 ++ a[631] = 0 ++ a[632] = 0 ++ a[633] = 0 ++ a[634] = 0 ++ a[635] = 0 ++ a[636] = 0 ++ a[637] = 0 ++ a[638] = 0 ++ a[639] = 0 ++ a[640] = 0 ++ a[641] = 0 ++ a[642] = 0 ++ a[643] = 0 ++ a[644] = 0 ++ a[645] = 0 ++ a[646] = 0 ++ a[647] = 0 ++ a[648] = 0 ++ a[649] = 0 ++ a[650] = 0 ++ a[651] = 0 ++ a[652] = 0 ++ a[653] = 0 ++ a[654] = 0 ++ a[655] = 0 ++ a[656] = 0 ++ a[657] = 0 ++ a[658] = 0 ++ a[659] = 0 ++ a[660] = 0 ++ a[661] = 0 ++ a[662] = 0 ++ a[663] = 0 ++ a[664] = 0 ++ a[665] = 0 ++ a[666] = 0 ++ a[667] = 0 ++ a[668] = 0 ++ a[669] = 0 ++ a[670] = 0 ++ a[671] = 0 ++ a[672] = 0 ++ a[673] = 0 ++ a[674] = 0 ++ a[675] = 0 ++ a[676] = 0 ++ a[677] = 0 ++ a[678] = 0 ++ a[679] = 0 ++ a[680] = 0 ++ a[681] = 0 ++ a[682] = 0 ++ a[683] = 0 ++ a[684] = 0 ++ a[685] = 0 ++ a[686] = 0 ++ a[687] = 0 ++ a[688] = 0 ++ a[689] = 0 ++ a[690] = 0 ++ a[691] = 0 ++ a[692] = 0 ++ a[693] = 0 ++ a[694] = 0 ++ a[695] = 0 ++ a[696] = 0 ++ a[697] = 0 ++ a[698] = 0 ++ a[699] = 0 ++ a[700] = 0 ++ a[701] = 0 ++ a[702] = 0 ++ a[703] = 0 ++ a[704] = 0 ++ a[705] = 0 ++ a[706] = 0 ++ a[707] = 0 ++ a[708] = 0 ++ a[709] = 0 ++ a[710] = 0 ++ a[711] = 0 ++ a[712] = 0 ++ a[713] = 0 ++ a[714] = 0 ++ a[715] = 0 ++ a[716] = 0 ++ a[717] = 0 ++ a[718] = 0 ++ a[719] = 0 ++ a[720] = 0 ++ a[721] = 0 ++ a[722] = 0 ++ a[723] = 0 ++ a[724] = 0 ++ a[725] = 0 ++ a[726] = 0 ++ a[727] = 0 ++ a[728] = 0 ++ a[729] = 0 ++ a[730] = 0 ++ a[731] = 0 ++ a[732] = 0 ++ a[733] = 0 ++ a[734] = 0 ++ a[735] = 0 ++ a[736] = 0 ++ a[737] = 0 ++ a[738] = 0 ++ a[739] = 0 ++ a[740] = 0 ++ a[741] = 0 ++ a[742] = 0 ++ a[743] = 0 ++ a[744] = 0 ++ a[745] = 0 ++ a[746] = 0 ++ a[747] = 0 ++ a[748] = 0 ++ a[749] = 0 ++ a[750] = 0 ++ a[751] = 0 ++ a[752] = 0 ++ a[753] = 0 ++ a[754] = 0 ++ a[755] = 0 ++ a[756] = 0 ++ a[757] = 0 ++ a[758] = 0 ++ a[759] = 0 ++ a[760] = 0 ++ a[761] = 0 ++ a[762] = 0 ++ a[763] = 0 ++ a[764] = 0 ++ a[765] = 0 ++ a[766] = 0 ++ a[767] = 0 ++ a[768] = 0 ++ a[769] = 0 ++ a[770] = 0 ++ a[771] = 0 ++ a[772] = 0 ++ a[773] = 0 ++ a[774] = 0 ++ a[775] = 0 ++ a[776] = 0 ++ a[777] = 0 ++ a[778] = 0 ++ a[779] = 0 ++ a[780] = 0 ++ a[781] = 0 ++ a[782] = 0 ++ a[783] = 0 ++ a[784] = 0 ++ a[785] = 0 ++ a[786] = 0 ++ a[787] = 0 ++ a[788] = 0 ++ a[789] = 0 ++ a[790] = 0 ++ a[791] = 0 ++ a[792] = 0 ++ a[793] = 0 ++ a[794] = 0 ++ a[795] = 0 ++ a[796] = 0 ++ a[797] = 0 ++ a[798] = 0 ++ a[799] = 0 ++ a[800] = 0 ++ a[801] = 0 ++ a[802] = 0 ++ a[803] = 0 ++ a[804] = 0 ++ a[805] = 0 ++ a[806] = 0 ++ a[807] = 0 ++ a[808] = 0 ++ a[809] = 0 ++ a[810] = 0 ++ a[811] = 0 ++ a[812] = 0 ++ a[813] = 0 ++ a[814] = 0 ++ a[815] = 0 ++ a[816] = 0 ++ a[817] = 0 ++ a[818] = 0 ++ a[819] = 0 ++ a[820] = 0 ++ a[821] = 0 ++ a[822] = 0 ++ a[823] = 0 ++ a[824] = 0 ++ a[825] = 0 ++ a[826] = 0 ++ a[827] = 0 ++ a[828] = 0 ++ a[829] = 0 ++ a[830] = 0 ++ a[831] = 0 ++ a[832] = 0 ++ a[833] = 0 ++ a[834] = 0 ++ a[835] = 0 ++ a[836] = 0 ++ a[837] = 0 ++ a[838] = 0 ++ a[839] = 0 ++ a[840] = 0 ++ a[841] = 0 ++ a[842] = 0 ++ a[843] = 0 ++ a[844] = 0 ++ a[845] = 0 ++ a[846] = 0 ++ a[847] = 0 ++ a[848] = 0 ++ a[849] = 0 ++ a[850] = 0 ++ a[851] = 0 ++ a[852] = 0 ++ a[853] = 0 ++ a[854] = 0 ++ a[855] = 0 ++ a[856] = 0 ++ a[857] = 0 ++ a[858] = 0 ++ a[859] = 0 ++ a[860] = 0 ++ a[861] = 0 ++ a[862] = 0 ++ a[863] = 0 ++ a[864] = 0 ++ a[865] = 0 ++ a[866] = 0 ++ a[867] = 0 ++ a[868] = 0 ++ a[869] = 0 ++ a[870] = 0 ++ a[871] = 0 ++ a[872] = 0 ++ a[873] = 0 ++ a[874] = 0 ++ a[875] = 0 ++ a[876] = 0 ++ a[877] = 0 ++ a[878] = 0 ++ a[879] = 0 ++ a[880] = 0 ++ a[881] = 0 ++ a[882] = 0 ++ a[883] = 0 ++ a[884] = 0 ++ a[885] = 0 ++ a[886] = 0 ++ a[887] = 0 ++ a[888] = 0 ++ a[889] = 0 ++ a[890] = 0 ++ a[891] = 0 ++ a[892] = 0 ++ a[893] = 0 ++ a[894] = 0 ++ a[895] = 0 ++ a[896] = 0 ++ a[897] = 0 ++ a[898] = 0 ++ a[899] = 0 ++ a[900] = 0 ++ a[901] = 0 ++ a[902] = 0 ++ a[903] = 0 ++ a[904] = 0 ++ a[905] = 0 ++ a[906] = 0 ++ a[907] = 0 ++ a[908] = 0 ++ a[909] = 0 ++ a[910] = 0 ++ a[911] = 0 ++ a[912] = 0 ++ a[913] = 0 ++ a[914] = 0 ++ a[915] = 0 ++ a[916] = 0 ++ a[917] = 0 ++ a[918] = 0 ++ a[919] = 0 ++ a[920] = 0 ++ a[921] = 0 ++ a[922] = 0 ++ a[923] = 0 ++ a[924] = 0 ++ a[925] = 0 ++ a[926] = 0 ++ a[927] = 0 ++ a[928] = 0 ++ a[929] = 0 ++ a[930] = 0 ++ a[931] = 0 ++ a[932] = 0 ++ a[933] = 0 ++ a[934] = 0 ++ a[935] = 0 ++ a[936] = 0 ++ a[937] = 0 ++ a[938] = 0 ++ a[939] = 0 ++ a[940] = 0 ++ a[941] = 0 ++ a[942] = 0 ++ a[943] = 0 ++ a[944] = 0 ++ a[945] = 0 ++ a[946] = 0 ++ a[947] = 0 ++ a[948] = 0 ++ a[949] = 0 ++ a[950] = 0 ++ a[951] = 0 ++ a[952] = 0 ++ a[953] = 0 ++ a[954] = 0 ++ a[955] = 0 ++ a[956] = 0 ++ a[957] = 0 ++ a[958] = 0 ++ a[959] = 0 ++ a[960] = 0 ++ a[961] = 0 ++ a[962] = 0 ++ a[963] = 0 ++ a[964] = 0 ++ a[965] = 0 ++ a[966] = 0 ++ a[967] = 0 ++ a[968] = 0 ++ a[969] = 0 ++ a[970] = 0 ++ a[971] = 0 ++ a[972] = 0 ++ a[973] = 0 ++ a[974] = 0 ++ a[975] = 0 ++ a[976] = 0 ++ a[977] = 0 ++ a[978] = 0 ++ a[979] = 0 ++ a[980] = 0 ++ a[981] = 0 ++ a[982] = 0 ++ a[983] = 0 ++ a[984] = 0 ++ a[985] = 0 ++ a[986] = 0 ++ a[987] = 0 ++ a[988] = 0 ++ a[989] = 0 ++ a[990] = 0 ++ a[991] = 0 ++ a[992] = 0 ++ a[993] = 0 ++ a[994] = 0 ++ a[995] = 0 ++ a[996] = 0 ++ a[997] = 0 ++ a[998] = 0 ++ a[999] = 0 ++ x := small(a) // ERROR "inlining call to small .*" ++ y := medium(a) // The crux of this test: medium is not inlined. ++ return x + y ++} +-- +2.14.4 + diff --git a/0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch b/0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch deleted file mode 100644 index da9131a..0000000 --- a/0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 6d0f113b34e323234eeb279984af83ba98e61c10 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jakub=20=C4=8Cajka?= -Date: Wed, 18 Jul 2018 09:42:28 +0200 -Subject: [PATCH 3/3] Don't compress dwarf by derfault as rpm/debuginfo is not - yet ready for it. - ---- - src/cmd/link/internal/ld/main.go | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/cmd/link/internal/ld/main.go b/src/cmd/link/internal/ld/main.go -index 23462f1154..565da989dd 100644 ---- a/src/cmd/link/internal/ld/main.go -+++ b/src/cmd/link/internal/ld/main.go -@@ -123,7 +123,7 @@ func Main(arch *sys.Arch, theArch Arch) { - flag.BoolVar(&ctxt.linkShared, "linkshared", false, "link against installed Go shared libraries") - flag.Var(&ctxt.LinkMode, "linkmode", "set link `mode`") - flag.Var(&ctxt.BuildMode, "buildmode", "set build `mode`") -- flag.BoolVar(&ctxt.compressDWARF, "compressdwarf", true, "compress DWARF if possible") -+ flag.BoolVar(&ctxt.compressDWARF, "compressdwarf", false, "compress DWARF if possible") - objabi.Flagfn1("B", "add an ELF NT_GNU_BUILD_ID `note` when using ELF", addbuildinfo) - objabi.Flagfn1("L", "add specified `directory` to library path", func(a string) { Lflag(ctxt, a) }) - objabi.AddVersionFlag() // -V --- -2.14.4 - diff --git a/golang.spec b/golang.spec index 99b7f00..b08c366 100644 --- a/golang.spec +++ b/golang.spec @@ -106,7 +106,7 @@ Name: golang Version: 1.11 -Release: 0.beta2.1%{?dist} +Release: 0.beta2.2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -183,7 +183,7 @@ Requires: go-srpm-macros Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch -Patch3: 0003-Don-t-compress-dwarf-by-derfault-as-rpm-debuginfo-is.patch +Patch3: 0001-cmd-compile-set-stricter-inlining-threshold-in-large.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -546,6 +546,12 @@ fi %endif %changelog +* Fri Jul 27 2018 Jakub Čajka - 1.11-0.beta2.2 +- Turn on back DWARF compression by default +- Use less memory on 32bit targets during build +- Resolves: BZ#1607270 +- Related: BZ#1602096 + * Fri Jul 20 2018 Jakub Čajka - 1.11-0.beta2.1 - Rebase to 1.11beta2 From c45c36333767627627f480813eea2e9c13de9692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 6 Aug 2018 12:28:08 +0200 Subject: [PATCH 151/156] Rebase to go 1.11beta3 --- .gitignore | 1 + ...stricter-inlining-threshold-in-large.patch | 1310 ----------------- golang.spec | 9 +- sources | 2 +- 4 files changed, 7 insertions(+), 1315 deletions(-) delete mode 100644 0001-cmd-compile-set-stricter-inlining-threshold-in-large.patch diff --git a/.gitignore b/.gitignore index 6efcfaf..dbc5a35 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ /go1.10.3.src.tar.gz /go1.11beta1.src.tar.gz /go1.11beta2.src.tar.gz +/go1.11beta3.src.tar.gz diff --git a/0001-cmd-compile-set-stricter-inlining-threshold-in-large.patch b/0001-cmd-compile-set-stricter-inlining-threshold-in-large.patch deleted file mode 100644 index aaf9eb6..0000000 --- a/0001-cmd-compile-set-stricter-inlining-threshold-in-large.patch +++ /dev/null @@ -1,1310 +0,0 @@ -From 5fc70b6fac0664f3f9d2c2948ba78db420ba70c5 Mon Sep 17 00:00:00 2001 -From: Keith Randall -Date: Mon, 23 Jul 2018 13:09:48 -0700 -Subject: [PATCH] cmd/compile: set stricter inlining threshold in large - functions - -If we're compiling a large function, be more picky about how big -the function we're inlining is. If the function is >5000 nodes, -we lower the inlining threshold from a cost of 80 to 20. - -Turns out reflect.Value's cost is exactly 80. That's the function -at issue in #26546. - -20 was chosen as a proxy for "inlined body is smaller than the call would be". -Simple functions still get inlined, like this one at cost 7: - -func ifaceIndir(t *rtype) bool { - return t.kind&kindDirectIface == 0 -} - -5000 nodes was chosen as the big function size. Here are all the -5000+ node (~~1000+ lines) functions in the stdlib: - -5187 cmd/internal/obj/arm (*ctxt5).asmout -6879 cmd/internal/obj/s390x (*ctxtz).asmout -6567 cmd/internal/obj/ppc64 (*ctxt9).asmout -9643 cmd/internal/obj/arm64 (*ctxt7).asmout -5042 cmd/internal/obj/x86 (*AsmBuf).doasm -8768 cmd/compile/internal/ssa rewriteBlockAMD64 -8878 cmd/compile/internal/ssa rewriteBlockARM -8344 cmd/compile/internal/ssa rewriteValueARM64_OpARM64OR_20 -7916 cmd/compile/internal/ssa rewriteValueARM64_OpARM64OR_30 -5427 cmd/compile/internal/ssa rewriteBlockARM64 -5126 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_50 -6152 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_60 -6412 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_70 -6486 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_80 -6534 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_90 -6534 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_100 -6534 cmd/compile/internal/ssa rewriteValuePPC64_OpPPC64OR_110 -6675 cmd/compile/internal/gc typecheck1 -5433 cmd/compile/internal/gc walkexpr -14070 cmd/vendor/golang.org/x/arch/arm64/arm64asm decodeArg - -There are a lot more smaller (~1000 node) functions in the stdlib. -The function in #26546 has 12477 nodes. - -At some point it might be nice to have a better heuristic for "inlined -body is smaller than the call", a non-cliff way to scale down the cost -as the function gets bigger, doing cheaper inlined calls first, etc. -All that can wait for another release. I'd like to do this CL for -1.11. - -Fixes #26546 -Update #17566 - -Change-Id: Idda13020e46ec2b28d79a17217f44b189f8139ac -Reviewed-on: https://go-review.googlesource.com/125516 -Run-TryBot: Keith Randall -TryBot-Result: Gobot Gobot -Reviewed-by: David Chase ---- - src/cmd/compile/internal/gc/inl.go | 72 ++- - test/inline_big.go | 1029 ++++++++++++++++++++++++++++++++++++ - 2 files changed, 1082 insertions(+), 19 deletions(-) - create mode 100644 test/inline_big.go - -diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go -index cb3ddaf2a5..feb3c8556a 100644 ---- a/src/cmd/compile/internal/gc/inl.go -+++ b/src/cmd/compile/internal/gc/inl.go -@@ -41,6 +41,9 @@ const ( - inlineExtraCallCost = inlineMaxBudget // default is do not inline, -l=4 enables by using 1 instead. - inlineExtraPanicCost = 1 // do not penalize inlining panics. - inlineExtraThrowCost = inlineMaxBudget // with current (2018-05/1.11) code, inlining runtime.throw does not help. -+ -+ inlineBigFunctionNodes = 5000 // Functions with this many nodes are considered "big". -+ inlineBigFunctionMaxCost = 20 // Max cost of inlinee when inlining into a "big" function. - ) - - // Get the function's package. For ordinary functions it's on the ->sym, but for imported methods -@@ -459,12 +462,38 @@ func inlcopy(n *Node) *Node { - return m - } - -+func countNodes(n *Node) int { -+ if n == nil { -+ return 0 -+ } -+ cnt := 1 -+ cnt += countNodes(n.Left) -+ cnt += countNodes(n.Right) -+ for _, n1 := range n.Ninit.Slice() { -+ cnt += countNodes(n1) -+ } -+ for _, n1 := range n.Nbody.Slice() { -+ cnt += countNodes(n1) -+ } -+ for _, n1 := range n.List.Slice() { -+ cnt += countNodes(n1) -+ } -+ for _, n1 := range n.Rlist.Slice() { -+ cnt += countNodes(n1) -+ } -+ return cnt -+} -+ - // Inlcalls/nodelist/node walks fn's statements and expressions and substitutes any - // calls made to inlineable functions. This is the external entry point. - func inlcalls(fn *Node) { - savefn := Curfn - Curfn = fn -- fn = inlnode(fn) -+ maxCost := int32(inlineMaxBudget) -+ if countNodes(fn) >= inlineBigFunctionNodes { -+ maxCost = inlineBigFunctionMaxCost -+ } -+ fn = inlnode(fn, maxCost) - if fn != Curfn { - Fatalf("inlnode replaced curfn") - } -@@ -505,10 +534,10 @@ func inlconv2list(n *Node) []*Node { - return s - } - --func inlnodelist(l Nodes) { -+func inlnodelist(l Nodes, maxCost int32) { - s := l.Slice() - for i := range s { -- s[i] = inlnode(s[i]) -+ s[i] = inlnode(s[i], maxCost) - } - } - -@@ -525,7 +554,7 @@ func inlnodelist(l Nodes) { - // shorter and less complicated. - // The result of inlnode MUST be assigned back to n, e.g. - // n.Left = inlnode(n.Left) --func inlnode(n *Node) *Node { -+func inlnode(n *Node, maxCost int32) *Node { - if n == nil { - return n - } -@@ -547,19 +576,19 @@ func inlnode(n *Node) *Node { - - lno := setlineno(n) - -- inlnodelist(n.Ninit) -+ inlnodelist(n.Ninit, maxCost) - for _, n1 := range n.Ninit.Slice() { - if n1.Op == OINLCALL { - inlconv2stmt(n1) - } - } - -- n.Left = inlnode(n.Left) -+ n.Left = inlnode(n.Left, maxCost) - if n.Left != nil && n.Left.Op == OINLCALL { - n.Left = inlconv2expr(n.Left) - } - -- n.Right = inlnode(n.Right) -+ n.Right = inlnode(n.Right, maxCost) - if n.Right != nil && n.Right.Op == OINLCALL { - if n.Op == OFOR || n.Op == OFORUNTIL { - inlconv2stmt(n.Right) -@@ -568,7 +597,7 @@ func inlnode(n *Node) *Node { - } - } - -- inlnodelist(n.List) -+ inlnodelist(n.List, maxCost) - switch n.Op { - case OBLOCK: - for _, n2 := range n.List.Slice() { -@@ -595,7 +624,7 @@ func inlnode(n *Node) *Node { - } - } - -- inlnodelist(n.Rlist) -+ inlnodelist(n.Rlist, maxCost) - if n.Op == OAS2FUNC && n.Rlist.First().Op == OINLCALL { - n.Rlist.Set(inlconv2list(n.Rlist.First())) - n.Op = OAS2 -@@ -614,7 +643,7 @@ func inlnode(n *Node) *Node { - } - } - -- inlnodelist(n.Nbody) -+ inlnodelist(n.Nbody, maxCost) - for _, n := range n.Nbody.Slice() { - if n.Op == OINLCALL { - inlconv2stmt(n) -@@ -637,12 +666,12 @@ func inlnode(n *Node) *Node { - fmt.Printf("%v:call to func %+v\n", n.Line(), n.Left) - } - if n.Left.Func != nil && n.Left.Func.Inl != nil && !isIntrinsicCall(n) { // normal case -- n = mkinlcall(n, n.Left) -+ n = mkinlcall(n, n.Left, maxCost) - } else if n.Left.isMethodExpression() && asNode(n.Left.Sym.Def) != nil { -- n = mkinlcall(n, asNode(n.Left.Sym.Def)) -+ n = mkinlcall(n, asNode(n.Left.Sym.Def), maxCost) - } else if n.Left.Op == OCLOSURE { - if f := inlinableClosure(n.Left); f != nil { -- n = mkinlcall(n, f) -+ n = mkinlcall(n, f, maxCost) - } - } else if n.Left.Op == ONAME && n.Left.Name != nil && n.Left.Name.Defn != nil { - if d := n.Left.Name.Defn; d.Op == OAS && d.Right.Op == OCLOSURE { -@@ -668,7 +697,7 @@ func inlnode(n *Node) *Node { - } - break - } -- n = mkinlcall(n, f) -+ n = mkinlcall(n, f, maxCost) - } - } - } -@@ -687,7 +716,7 @@ func inlnode(n *Node) *Node { - Fatalf("no function definition for [%p] %+v\n", n.Left.Type, n.Left.Type) - } - -- n = mkinlcall(n, asNode(n.Left.Type.FuncType().Nname)) -+ n = mkinlcall(n, asNode(n.Left.Type.FuncType().Nname), maxCost) - } - - lineno = lno -@@ -788,7 +817,7 @@ func (v *reassignVisitor) visitList(l Nodes) *Node { - - // The result of mkinlcall MUST be assigned back to n, e.g. - // n.Left = mkinlcall(n.Left, fn, isddd) --func mkinlcall(n *Node, fn *Node) *Node { -+func mkinlcall(n *Node, fn *Node, maxCost int32) *Node { - save_safemode := safemode - - // imported functions may refer to unsafe as long as the -@@ -798,7 +827,7 @@ func mkinlcall(n *Node, fn *Node) *Node { - if pkg != localpkg && pkg != nil { - safemode = false - } -- n = mkinlcall1(n, fn) -+ n = mkinlcall1(n, fn, maxCost) - safemode = save_safemode - return n - } -@@ -824,11 +853,16 @@ var inlgen int - // parameters. - // The result of mkinlcall1 MUST be assigned back to n, e.g. - // n.Left = mkinlcall1(n.Left, fn, isddd) --func mkinlcall1(n, fn *Node) *Node { -+func mkinlcall1(n, fn *Node, maxCost int32) *Node { - if fn.Func.Inl == nil { - // No inlinable body. - return n - } -+ if fn.Func.Inl.Cost > maxCost { -+ // The inlined function body is too big. Typically we use this check to restrict -+ // inlining into very big functions. See issue 26546 and 17566. -+ return n -+ } - - if fn == Curfn || fn.Name.Defn == Curfn { - // Can't recursively inline a function into itself. -@@ -1094,7 +1128,7 @@ func mkinlcall1(n, fn *Node) *Node { - // instead we emit the things that the body needs - // and each use must redo the inlining. - // luckily these are small. -- inlnodelist(call.Nbody) -+ inlnodelist(call.Nbody, maxCost) - for _, n := range call.Nbody.Slice() { - if n.Op == OINLCALL { - inlconv2stmt(n) -diff --git a/test/inline_big.go b/test/inline_big.go -new file mode 100644 -index 0000000000..c4af15b4e1 ---- /dev/null -+++ b/test/inline_big.go -@@ -0,0 +1,1029 @@ -+// errorcheck -0 -m=2 -+ -+// Copyright 2018 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. -+ -+// Test that we restrict inlining into very large functions. -+// See issue #26546. -+ -+package foo -+ -+func small(a []int) int { // ERROR "can inline small as:.*" "small a does not escape" -+ // Cost 16 body (need cost < 20). -+ // See cmd/compile/internal/gc/inl.go:inlineBigFunction* -+ return a[0] + a[1] + a[2] + a[3] -+} -+func medium(a []int) int { // ERROR "can inline medium as:.*" "medium a does not escape" -+ // Cost 32 body (need cost > 20 and cost < 80). -+ // See cmd/compile/internal/gc/inl.go:inlineBigFunction* -+ return a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[7] -+} -+ -+func f(a []int) int { // ERROR "cannot inline f:.*" "f a does not escape" -+ // Add lots of nodes to f's body. We need >5000. -+ // See cmd/compile/internal/gc/inl.go:inlineBigFunction* -+ a[0] = 0 -+ a[1] = 0 -+ a[2] = 0 -+ a[3] = 0 -+ a[4] = 0 -+ a[5] = 0 -+ a[6] = 0 -+ a[7] = 0 -+ a[8] = 0 -+ a[9] = 0 -+ a[10] = 0 -+ a[11] = 0 -+ a[12] = 0 -+ a[13] = 0 -+ a[14] = 0 -+ a[15] = 0 -+ a[16] = 0 -+ a[17] = 0 -+ a[18] = 0 -+ a[19] = 0 -+ a[20] = 0 -+ a[21] = 0 -+ a[22] = 0 -+ a[23] = 0 -+ a[24] = 0 -+ a[25] = 0 -+ a[26] = 0 -+ a[27] = 0 -+ a[28] = 0 -+ a[29] = 0 -+ a[30] = 0 -+ a[31] = 0 -+ a[32] = 0 -+ a[33] = 0 -+ a[34] = 0 -+ a[35] = 0 -+ a[36] = 0 -+ a[37] = 0 -+ a[38] = 0 -+ a[39] = 0 -+ a[40] = 0 -+ a[41] = 0 -+ a[42] = 0 -+ a[43] = 0 -+ a[44] = 0 -+ a[45] = 0 -+ a[46] = 0 -+ a[47] = 0 -+ a[48] = 0 -+ a[49] = 0 -+ a[50] = 0 -+ a[51] = 0 -+ a[52] = 0 -+ a[53] = 0 -+ a[54] = 0 -+ a[55] = 0 -+ a[56] = 0 -+ a[57] = 0 -+ a[58] = 0 -+ a[59] = 0 -+ a[60] = 0 -+ a[61] = 0 -+ a[62] = 0 -+ a[63] = 0 -+ a[64] = 0 -+ a[65] = 0 -+ a[66] = 0 -+ a[67] = 0 -+ a[68] = 0 -+ a[69] = 0 -+ a[70] = 0 -+ a[71] = 0 -+ a[72] = 0 -+ a[73] = 0 -+ a[74] = 0 -+ a[75] = 0 -+ a[76] = 0 -+ a[77] = 0 -+ a[78] = 0 -+ a[79] = 0 -+ a[80] = 0 -+ a[81] = 0 -+ a[82] = 0 -+ a[83] = 0 -+ a[84] = 0 -+ a[85] = 0 -+ a[86] = 0 -+ a[87] = 0 -+ a[88] = 0 -+ a[89] = 0 -+ a[90] = 0 -+ a[91] = 0 -+ a[92] = 0 -+ a[93] = 0 -+ a[94] = 0 -+ a[95] = 0 -+ a[96] = 0 -+ a[97] = 0 -+ a[98] = 0 -+ a[99] = 0 -+ a[100] = 0 -+ a[101] = 0 -+ a[102] = 0 -+ a[103] = 0 -+ a[104] = 0 -+ a[105] = 0 -+ a[106] = 0 -+ a[107] = 0 -+ a[108] = 0 -+ a[109] = 0 -+ a[110] = 0 -+ a[111] = 0 -+ a[112] = 0 -+ a[113] = 0 -+ a[114] = 0 -+ a[115] = 0 -+ a[116] = 0 -+ a[117] = 0 -+ a[118] = 0 -+ a[119] = 0 -+ a[120] = 0 -+ a[121] = 0 -+ a[122] = 0 -+ a[123] = 0 -+ a[124] = 0 -+ a[125] = 0 -+ a[126] = 0 -+ a[127] = 0 -+ a[128] = 0 -+ a[129] = 0 -+ a[130] = 0 -+ a[131] = 0 -+ a[132] = 0 -+ a[133] = 0 -+ a[134] = 0 -+ a[135] = 0 -+ a[136] = 0 -+ a[137] = 0 -+ a[138] = 0 -+ a[139] = 0 -+ a[140] = 0 -+ a[141] = 0 -+ a[142] = 0 -+ a[143] = 0 -+ a[144] = 0 -+ a[145] = 0 -+ a[146] = 0 -+ a[147] = 0 -+ a[148] = 0 -+ a[149] = 0 -+ a[150] = 0 -+ a[151] = 0 -+ a[152] = 0 -+ a[153] = 0 -+ a[154] = 0 -+ a[155] = 0 -+ a[156] = 0 -+ a[157] = 0 -+ a[158] = 0 -+ a[159] = 0 -+ a[160] = 0 -+ a[161] = 0 -+ a[162] = 0 -+ a[163] = 0 -+ a[164] = 0 -+ a[165] = 0 -+ a[166] = 0 -+ a[167] = 0 -+ a[168] = 0 -+ a[169] = 0 -+ a[170] = 0 -+ a[171] = 0 -+ a[172] = 0 -+ a[173] = 0 -+ a[174] = 0 -+ a[175] = 0 -+ a[176] = 0 -+ a[177] = 0 -+ a[178] = 0 -+ a[179] = 0 -+ a[180] = 0 -+ a[181] = 0 -+ a[182] = 0 -+ a[183] = 0 -+ a[184] = 0 -+ a[185] = 0 -+ a[186] = 0 -+ a[187] = 0 -+ a[188] = 0 -+ a[189] = 0 -+ a[190] = 0 -+ a[191] = 0 -+ a[192] = 0 -+ a[193] = 0 -+ a[194] = 0 -+ a[195] = 0 -+ a[196] = 0 -+ a[197] = 0 -+ a[198] = 0 -+ a[199] = 0 -+ a[200] = 0 -+ a[201] = 0 -+ a[202] = 0 -+ a[203] = 0 -+ a[204] = 0 -+ a[205] = 0 -+ a[206] = 0 -+ a[207] = 0 -+ a[208] = 0 -+ a[209] = 0 -+ a[210] = 0 -+ a[211] = 0 -+ a[212] = 0 -+ a[213] = 0 -+ a[214] = 0 -+ a[215] = 0 -+ a[216] = 0 -+ a[217] = 0 -+ a[218] = 0 -+ a[219] = 0 -+ a[220] = 0 -+ a[221] = 0 -+ a[222] = 0 -+ a[223] = 0 -+ a[224] = 0 -+ a[225] = 0 -+ a[226] = 0 -+ a[227] = 0 -+ a[228] = 0 -+ a[229] = 0 -+ a[230] = 0 -+ a[231] = 0 -+ a[232] = 0 -+ a[233] = 0 -+ a[234] = 0 -+ a[235] = 0 -+ a[236] = 0 -+ a[237] = 0 -+ a[238] = 0 -+ a[239] = 0 -+ a[240] = 0 -+ a[241] = 0 -+ a[242] = 0 -+ a[243] = 0 -+ a[244] = 0 -+ a[245] = 0 -+ a[246] = 0 -+ a[247] = 0 -+ a[248] = 0 -+ a[249] = 0 -+ a[250] = 0 -+ a[251] = 0 -+ a[252] = 0 -+ a[253] = 0 -+ a[254] = 0 -+ a[255] = 0 -+ a[256] = 0 -+ a[257] = 0 -+ a[258] = 0 -+ a[259] = 0 -+ a[260] = 0 -+ a[261] = 0 -+ a[262] = 0 -+ a[263] = 0 -+ a[264] = 0 -+ a[265] = 0 -+ a[266] = 0 -+ a[267] = 0 -+ a[268] = 0 -+ a[269] = 0 -+ a[270] = 0 -+ a[271] = 0 -+ a[272] = 0 -+ a[273] = 0 -+ a[274] = 0 -+ a[275] = 0 -+ a[276] = 0 -+ a[277] = 0 -+ a[278] = 0 -+ a[279] = 0 -+ a[280] = 0 -+ a[281] = 0 -+ a[282] = 0 -+ a[283] = 0 -+ a[284] = 0 -+ a[285] = 0 -+ a[286] = 0 -+ a[287] = 0 -+ a[288] = 0 -+ a[289] = 0 -+ a[290] = 0 -+ a[291] = 0 -+ a[292] = 0 -+ a[293] = 0 -+ a[294] = 0 -+ a[295] = 0 -+ a[296] = 0 -+ a[297] = 0 -+ a[298] = 0 -+ a[299] = 0 -+ a[300] = 0 -+ a[301] = 0 -+ a[302] = 0 -+ a[303] = 0 -+ a[304] = 0 -+ a[305] = 0 -+ a[306] = 0 -+ a[307] = 0 -+ a[308] = 0 -+ a[309] = 0 -+ a[310] = 0 -+ a[311] = 0 -+ a[312] = 0 -+ a[313] = 0 -+ a[314] = 0 -+ a[315] = 0 -+ a[316] = 0 -+ a[317] = 0 -+ a[318] = 0 -+ a[319] = 0 -+ a[320] = 0 -+ a[321] = 0 -+ a[322] = 0 -+ a[323] = 0 -+ a[324] = 0 -+ a[325] = 0 -+ a[326] = 0 -+ a[327] = 0 -+ a[328] = 0 -+ a[329] = 0 -+ a[330] = 0 -+ a[331] = 0 -+ a[332] = 0 -+ a[333] = 0 -+ a[334] = 0 -+ a[335] = 0 -+ a[336] = 0 -+ a[337] = 0 -+ a[338] = 0 -+ a[339] = 0 -+ a[340] = 0 -+ a[341] = 0 -+ a[342] = 0 -+ a[343] = 0 -+ a[344] = 0 -+ a[345] = 0 -+ a[346] = 0 -+ a[347] = 0 -+ a[348] = 0 -+ a[349] = 0 -+ a[350] = 0 -+ a[351] = 0 -+ a[352] = 0 -+ a[353] = 0 -+ a[354] = 0 -+ a[355] = 0 -+ a[356] = 0 -+ a[357] = 0 -+ a[358] = 0 -+ a[359] = 0 -+ a[360] = 0 -+ a[361] = 0 -+ a[362] = 0 -+ a[363] = 0 -+ a[364] = 0 -+ a[365] = 0 -+ a[366] = 0 -+ a[367] = 0 -+ a[368] = 0 -+ a[369] = 0 -+ a[370] = 0 -+ a[371] = 0 -+ a[372] = 0 -+ a[373] = 0 -+ a[374] = 0 -+ a[375] = 0 -+ a[376] = 0 -+ a[377] = 0 -+ a[378] = 0 -+ a[379] = 0 -+ a[380] = 0 -+ a[381] = 0 -+ a[382] = 0 -+ a[383] = 0 -+ a[384] = 0 -+ a[385] = 0 -+ a[386] = 0 -+ a[387] = 0 -+ a[388] = 0 -+ a[389] = 0 -+ a[390] = 0 -+ a[391] = 0 -+ a[392] = 0 -+ a[393] = 0 -+ a[394] = 0 -+ a[395] = 0 -+ a[396] = 0 -+ a[397] = 0 -+ a[398] = 0 -+ a[399] = 0 -+ a[400] = 0 -+ a[401] = 0 -+ a[402] = 0 -+ a[403] = 0 -+ a[404] = 0 -+ a[405] = 0 -+ a[406] = 0 -+ a[407] = 0 -+ a[408] = 0 -+ a[409] = 0 -+ a[410] = 0 -+ a[411] = 0 -+ a[412] = 0 -+ a[413] = 0 -+ a[414] = 0 -+ a[415] = 0 -+ a[416] = 0 -+ a[417] = 0 -+ a[418] = 0 -+ a[419] = 0 -+ a[420] = 0 -+ a[421] = 0 -+ a[422] = 0 -+ a[423] = 0 -+ a[424] = 0 -+ a[425] = 0 -+ a[426] = 0 -+ a[427] = 0 -+ a[428] = 0 -+ a[429] = 0 -+ a[430] = 0 -+ a[431] = 0 -+ a[432] = 0 -+ a[433] = 0 -+ a[434] = 0 -+ a[435] = 0 -+ a[436] = 0 -+ a[437] = 0 -+ a[438] = 0 -+ a[439] = 0 -+ a[440] = 0 -+ a[441] = 0 -+ a[442] = 0 -+ a[443] = 0 -+ a[444] = 0 -+ a[445] = 0 -+ a[446] = 0 -+ a[447] = 0 -+ a[448] = 0 -+ a[449] = 0 -+ a[450] = 0 -+ a[451] = 0 -+ a[452] = 0 -+ a[453] = 0 -+ a[454] = 0 -+ a[455] = 0 -+ a[456] = 0 -+ a[457] = 0 -+ a[458] = 0 -+ a[459] = 0 -+ a[460] = 0 -+ a[461] = 0 -+ a[462] = 0 -+ a[463] = 0 -+ a[464] = 0 -+ a[465] = 0 -+ a[466] = 0 -+ a[467] = 0 -+ a[468] = 0 -+ a[469] = 0 -+ a[470] = 0 -+ a[471] = 0 -+ a[472] = 0 -+ a[473] = 0 -+ a[474] = 0 -+ a[475] = 0 -+ a[476] = 0 -+ a[477] = 0 -+ a[478] = 0 -+ a[479] = 0 -+ a[480] = 0 -+ a[481] = 0 -+ a[482] = 0 -+ a[483] = 0 -+ a[484] = 0 -+ a[485] = 0 -+ a[486] = 0 -+ a[487] = 0 -+ a[488] = 0 -+ a[489] = 0 -+ a[490] = 0 -+ a[491] = 0 -+ a[492] = 0 -+ a[493] = 0 -+ a[494] = 0 -+ a[495] = 0 -+ a[496] = 0 -+ a[497] = 0 -+ a[498] = 0 -+ a[499] = 0 -+ a[500] = 0 -+ a[501] = 0 -+ a[502] = 0 -+ a[503] = 0 -+ a[504] = 0 -+ a[505] = 0 -+ a[506] = 0 -+ a[507] = 0 -+ a[508] = 0 -+ a[509] = 0 -+ a[510] = 0 -+ a[511] = 0 -+ a[512] = 0 -+ a[513] = 0 -+ a[514] = 0 -+ a[515] = 0 -+ a[516] = 0 -+ a[517] = 0 -+ a[518] = 0 -+ a[519] = 0 -+ a[520] = 0 -+ a[521] = 0 -+ a[522] = 0 -+ a[523] = 0 -+ a[524] = 0 -+ a[525] = 0 -+ a[526] = 0 -+ a[527] = 0 -+ a[528] = 0 -+ a[529] = 0 -+ a[530] = 0 -+ a[531] = 0 -+ a[532] = 0 -+ a[533] = 0 -+ a[534] = 0 -+ a[535] = 0 -+ a[536] = 0 -+ a[537] = 0 -+ a[538] = 0 -+ a[539] = 0 -+ a[540] = 0 -+ a[541] = 0 -+ a[542] = 0 -+ a[543] = 0 -+ a[544] = 0 -+ a[545] = 0 -+ a[546] = 0 -+ a[547] = 0 -+ a[548] = 0 -+ a[549] = 0 -+ a[550] = 0 -+ a[551] = 0 -+ a[552] = 0 -+ a[553] = 0 -+ a[554] = 0 -+ a[555] = 0 -+ a[556] = 0 -+ a[557] = 0 -+ a[558] = 0 -+ a[559] = 0 -+ a[560] = 0 -+ a[561] = 0 -+ a[562] = 0 -+ a[563] = 0 -+ a[564] = 0 -+ a[565] = 0 -+ a[566] = 0 -+ a[567] = 0 -+ a[568] = 0 -+ a[569] = 0 -+ a[570] = 0 -+ a[571] = 0 -+ a[572] = 0 -+ a[573] = 0 -+ a[574] = 0 -+ a[575] = 0 -+ a[576] = 0 -+ a[577] = 0 -+ a[578] = 0 -+ a[579] = 0 -+ a[580] = 0 -+ a[581] = 0 -+ a[582] = 0 -+ a[583] = 0 -+ a[584] = 0 -+ a[585] = 0 -+ a[586] = 0 -+ a[587] = 0 -+ a[588] = 0 -+ a[589] = 0 -+ a[590] = 0 -+ a[591] = 0 -+ a[592] = 0 -+ a[593] = 0 -+ a[594] = 0 -+ a[595] = 0 -+ a[596] = 0 -+ a[597] = 0 -+ a[598] = 0 -+ a[599] = 0 -+ a[600] = 0 -+ a[601] = 0 -+ a[602] = 0 -+ a[603] = 0 -+ a[604] = 0 -+ a[605] = 0 -+ a[606] = 0 -+ a[607] = 0 -+ a[608] = 0 -+ a[609] = 0 -+ a[610] = 0 -+ a[611] = 0 -+ a[612] = 0 -+ a[613] = 0 -+ a[614] = 0 -+ a[615] = 0 -+ a[616] = 0 -+ a[617] = 0 -+ a[618] = 0 -+ a[619] = 0 -+ a[620] = 0 -+ a[621] = 0 -+ a[622] = 0 -+ a[623] = 0 -+ a[624] = 0 -+ a[625] = 0 -+ a[626] = 0 -+ a[627] = 0 -+ a[628] = 0 -+ a[629] = 0 -+ a[630] = 0 -+ a[631] = 0 -+ a[632] = 0 -+ a[633] = 0 -+ a[634] = 0 -+ a[635] = 0 -+ a[636] = 0 -+ a[637] = 0 -+ a[638] = 0 -+ a[639] = 0 -+ a[640] = 0 -+ a[641] = 0 -+ a[642] = 0 -+ a[643] = 0 -+ a[644] = 0 -+ a[645] = 0 -+ a[646] = 0 -+ a[647] = 0 -+ a[648] = 0 -+ a[649] = 0 -+ a[650] = 0 -+ a[651] = 0 -+ a[652] = 0 -+ a[653] = 0 -+ a[654] = 0 -+ a[655] = 0 -+ a[656] = 0 -+ a[657] = 0 -+ a[658] = 0 -+ a[659] = 0 -+ a[660] = 0 -+ a[661] = 0 -+ a[662] = 0 -+ a[663] = 0 -+ a[664] = 0 -+ a[665] = 0 -+ a[666] = 0 -+ a[667] = 0 -+ a[668] = 0 -+ a[669] = 0 -+ a[670] = 0 -+ a[671] = 0 -+ a[672] = 0 -+ a[673] = 0 -+ a[674] = 0 -+ a[675] = 0 -+ a[676] = 0 -+ a[677] = 0 -+ a[678] = 0 -+ a[679] = 0 -+ a[680] = 0 -+ a[681] = 0 -+ a[682] = 0 -+ a[683] = 0 -+ a[684] = 0 -+ a[685] = 0 -+ a[686] = 0 -+ a[687] = 0 -+ a[688] = 0 -+ a[689] = 0 -+ a[690] = 0 -+ a[691] = 0 -+ a[692] = 0 -+ a[693] = 0 -+ a[694] = 0 -+ a[695] = 0 -+ a[696] = 0 -+ a[697] = 0 -+ a[698] = 0 -+ a[699] = 0 -+ a[700] = 0 -+ a[701] = 0 -+ a[702] = 0 -+ a[703] = 0 -+ a[704] = 0 -+ a[705] = 0 -+ a[706] = 0 -+ a[707] = 0 -+ a[708] = 0 -+ a[709] = 0 -+ a[710] = 0 -+ a[711] = 0 -+ a[712] = 0 -+ a[713] = 0 -+ a[714] = 0 -+ a[715] = 0 -+ a[716] = 0 -+ a[717] = 0 -+ a[718] = 0 -+ a[719] = 0 -+ a[720] = 0 -+ a[721] = 0 -+ a[722] = 0 -+ a[723] = 0 -+ a[724] = 0 -+ a[725] = 0 -+ a[726] = 0 -+ a[727] = 0 -+ a[728] = 0 -+ a[729] = 0 -+ a[730] = 0 -+ a[731] = 0 -+ a[732] = 0 -+ a[733] = 0 -+ a[734] = 0 -+ a[735] = 0 -+ a[736] = 0 -+ a[737] = 0 -+ a[738] = 0 -+ a[739] = 0 -+ a[740] = 0 -+ a[741] = 0 -+ a[742] = 0 -+ a[743] = 0 -+ a[744] = 0 -+ a[745] = 0 -+ a[746] = 0 -+ a[747] = 0 -+ a[748] = 0 -+ a[749] = 0 -+ a[750] = 0 -+ a[751] = 0 -+ a[752] = 0 -+ a[753] = 0 -+ a[754] = 0 -+ a[755] = 0 -+ a[756] = 0 -+ a[757] = 0 -+ a[758] = 0 -+ a[759] = 0 -+ a[760] = 0 -+ a[761] = 0 -+ a[762] = 0 -+ a[763] = 0 -+ a[764] = 0 -+ a[765] = 0 -+ a[766] = 0 -+ a[767] = 0 -+ a[768] = 0 -+ a[769] = 0 -+ a[770] = 0 -+ a[771] = 0 -+ a[772] = 0 -+ a[773] = 0 -+ a[774] = 0 -+ a[775] = 0 -+ a[776] = 0 -+ a[777] = 0 -+ a[778] = 0 -+ a[779] = 0 -+ a[780] = 0 -+ a[781] = 0 -+ a[782] = 0 -+ a[783] = 0 -+ a[784] = 0 -+ a[785] = 0 -+ a[786] = 0 -+ a[787] = 0 -+ a[788] = 0 -+ a[789] = 0 -+ a[790] = 0 -+ a[791] = 0 -+ a[792] = 0 -+ a[793] = 0 -+ a[794] = 0 -+ a[795] = 0 -+ a[796] = 0 -+ a[797] = 0 -+ a[798] = 0 -+ a[799] = 0 -+ a[800] = 0 -+ a[801] = 0 -+ a[802] = 0 -+ a[803] = 0 -+ a[804] = 0 -+ a[805] = 0 -+ a[806] = 0 -+ a[807] = 0 -+ a[808] = 0 -+ a[809] = 0 -+ a[810] = 0 -+ a[811] = 0 -+ a[812] = 0 -+ a[813] = 0 -+ a[814] = 0 -+ a[815] = 0 -+ a[816] = 0 -+ a[817] = 0 -+ a[818] = 0 -+ a[819] = 0 -+ a[820] = 0 -+ a[821] = 0 -+ a[822] = 0 -+ a[823] = 0 -+ a[824] = 0 -+ a[825] = 0 -+ a[826] = 0 -+ a[827] = 0 -+ a[828] = 0 -+ a[829] = 0 -+ a[830] = 0 -+ a[831] = 0 -+ a[832] = 0 -+ a[833] = 0 -+ a[834] = 0 -+ a[835] = 0 -+ a[836] = 0 -+ a[837] = 0 -+ a[838] = 0 -+ a[839] = 0 -+ a[840] = 0 -+ a[841] = 0 -+ a[842] = 0 -+ a[843] = 0 -+ a[844] = 0 -+ a[845] = 0 -+ a[846] = 0 -+ a[847] = 0 -+ a[848] = 0 -+ a[849] = 0 -+ a[850] = 0 -+ a[851] = 0 -+ a[852] = 0 -+ a[853] = 0 -+ a[854] = 0 -+ a[855] = 0 -+ a[856] = 0 -+ a[857] = 0 -+ a[858] = 0 -+ a[859] = 0 -+ a[860] = 0 -+ a[861] = 0 -+ a[862] = 0 -+ a[863] = 0 -+ a[864] = 0 -+ a[865] = 0 -+ a[866] = 0 -+ a[867] = 0 -+ a[868] = 0 -+ a[869] = 0 -+ a[870] = 0 -+ a[871] = 0 -+ a[872] = 0 -+ a[873] = 0 -+ a[874] = 0 -+ a[875] = 0 -+ a[876] = 0 -+ a[877] = 0 -+ a[878] = 0 -+ a[879] = 0 -+ a[880] = 0 -+ a[881] = 0 -+ a[882] = 0 -+ a[883] = 0 -+ a[884] = 0 -+ a[885] = 0 -+ a[886] = 0 -+ a[887] = 0 -+ a[888] = 0 -+ a[889] = 0 -+ a[890] = 0 -+ a[891] = 0 -+ a[892] = 0 -+ a[893] = 0 -+ a[894] = 0 -+ a[895] = 0 -+ a[896] = 0 -+ a[897] = 0 -+ a[898] = 0 -+ a[899] = 0 -+ a[900] = 0 -+ a[901] = 0 -+ a[902] = 0 -+ a[903] = 0 -+ a[904] = 0 -+ a[905] = 0 -+ a[906] = 0 -+ a[907] = 0 -+ a[908] = 0 -+ a[909] = 0 -+ a[910] = 0 -+ a[911] = 0 -+ a[912] = 0 -+ a[913] = 0 -+ a[914] = 0 -+ a[915] = 0 -+ a[916] = 0 -+ a[917] = 0 -+ a[918] = 0 -+ a[919] = 0 -+ a[920] = 0 -+ a[921] = 0 -+ a[922] = 0 -+ a[923] = 0 -+ a[924] = 0 -+ a[925] = 0 -+ a[926] = 0 -+ a[927] = 0 -+ a[928] = 0 -+ a[929] = 0 -+ a[930] = 0 -+ a[931] = 0 -+ a[932] = 0 -+ a[933] = 0 -+ a[934] = 0 -+ a[935] = 0 -+ a[936] = 0 -+ a[937] = 0 -+ a[938] = 0 -+ a[939] = 0 -+ a[940] = 0 -+ a[941] = 0 -+ a[942] = 0 -+ a[943] = 0 -+ a[944] = 0 -+ a[945] = 0 -+ a[946] = 0 -+ a[947] = 0 -+ a[948] = 0 -+ a[949] = 0 -+ a[950] = 0 -+ a[951] = 0 -+ a[952] = 0 -+ a[953] = 0 -+ a[954] = 0 -+ a[955] = 0 -+ a[956] = 0 -+ a[957] = 0 -+ a[958] = 0 -+ a[959] = 0 -+ a[960] = 0 -+ a[961] = 0 -+ a[962] = 0 -+ a[963] = 0 -+ a[964] = 0 -+ a[965] = 0 -+ a[966] = 0 -+ a[967] = 0 -+ a[968] = 0 -+ a[969] = 0 -+ a[970] = 0 -+ a[971] = 0 -+ a[972] = 0 -+ a[973] = 0 -+ a[974] = 0 -+ a[975] = 0 -+ a[976] = 0 -+ a[977] = 0 -+ a[978] = 0 -+ a[979] = 0 -+ a[980] = 0 -+ a[981] = 0 -+ a[982] = 0 -+ a[983] = 0 -+ a[984] = 0 -+ a[985] = 0 -+ a[986] = 0 -+ a[987] = 0 -+ a[988] = 0 -+ a[989] = 0 -+ a[990] = 0 -+ a[991] = 0 -+ a[992] = 0 -+ a[993] = 0 -+ a[994] = 0 -+ a[995] = 0 -+ a[996] = 0 -+ a[997] = 0 -+ a[998] = 0 -+ a[999] = 0 -+ x := small(a) // ERROR "inlining call to small .*" -+ y := medium(a) // The crux of this test: medium is not inlined. -+ return x + y -+} --- -2.14.4 - diff --git a/golang.spec b/golang.spec index b08c366..8227086 100644 --- a/golang.spec +++ b/golang.spec @@ -102,11 +102,11 @@ %endif %global go_api 1.11 -%global go_version 1.11beta2 +%global go_version 1.11beta3 Name: golang Version: 1.11 -Release: 0.beta2.2%{?dist} +Release: 0.beta3.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -183,7 +183,6 @@ Requires: go-srpm-macros Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch -Patch3: 0001-cmd-compile-set-stricter-inlining-threshold-in-large.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -309,7 +308,6 @@ Requires: %{name} = %{version}-%{release} %patch1 -p1 %patch2 -p1 -%patch3 -p1 cp %{SOURCE1} ./src/runtime/ @@ -546,6 +544,9 @@ fi %endif %changelog +* Mon Aug 06 2018 Jakub Čajka - 1.11-0.beta3.1 +- Rebase to go1.11beta3 + * Fri Jul 27 2018 Jakub Čajka - 1.11-0.beta2.2 - Turn on back DWARF compression by default - Use less memory on 32bit targets during build diff --git a/sources b/sources index 2666473..9f8fc25 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.11beta2.src.tar.gz) = 0b88364f15c1b41c19c2dca3e69e4bb848d8534540f80b50e9cca00889398f464647530a972ec763b925e2d850ee4e88f08abda3ec01384462ff423e281e24aa +SHA512 (go1.11beta3.src.tar.gz) = af921a7879e148c70126bd56b7fb521931a73b13a904e801b5d2375e5a10ace9c8139840b9659dceb4366887966ca90d13a7e0151d52b8611e2e5aca3a1ab107 From a273a5236a8e08acc79ccc4dd226b63bd36dbcaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Tue, 14 Aug 2018 14:48:38 +0200 Subject: [PATCH 152/156] Rebase to go 1.11rc1 --- .gitignore | 1 + golang.spec | 9 ++++++--- sources | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index dbc5a35..aff1663 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,4 @@ /go1.11beta1.src.tar.gz /go1.11beta2.src.tar.gz /go1.11beta3.src.tar.gz +/go1.11rc1.src.tar.gz diff --git a/golang.spec b/golang.spec index 8227086..a417cdc 100644 --- a/golang.spec +++ b/golang.spec @@ -1,6 +1,6 @@ %bcond_with bootstrap # temporalily ignore test failures -%ifarch %{ix86} aarch64 x86_64 %{arm} +%ifarch %{ix86} aarch64 %{arm} %bcond_without ignore_tests %else %bcond_with ignore_tests @@ -102,11 +102,11 @@ %endif %global go_api 1.11 -%global go_version 1.11beta3 +%global go_version 1.11rc1 Name: golang Version: 1.11 -Release: 0.beta3.1%{?dist} +Release: 0.rc1.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -544,6 +544,9 @@ fi %endif %changelog +* Tue Aug 14 2018 Jakub Čajka - 1.11-0.rc1.1 +- Rebase to go1.11rc1 + * Mon Aug 06 2018 Jakub Čajka - 1.11-0.beta3.1 - Rebase to go1.11beta3 diff --git a/sources b/sources index 9f8fc25..fe56ad7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.11beta3.src.tar.gz) = af921a7879e148c70126bd56b7fb521931a73b13a904e801b5d2375e5a10ace9c8139840b9659dceb4366887966ca90d13a7e0151d52b8611e2e5aca3a1ab107 +SHA512 (go1.11rc1.src.tar.gz) = 0ada53018ebed21fe421239087e0d36a2a892fa8584c0279cc61c49307b6130ea1cdd103aab373f44d4aeabed9e98e72bed7c06c4503aebcc09004ab5f213c6d From f1f6f5d515026af9aad116c35836444a948debcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Thu, 23 Aug 2018 11:20:46 +0200 Subject: [PATCH 153/156] Rebase to go1.11rc2 Reduce size of bin package --- .gitignore | 1 + golang.spec | 10 ++++++++-- sources | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index aff1663..c1557a2 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ /go1.11beta2.src.tar.gz /go1.11beta3.src.tar.gz /go1.11rc1.src.tar.gz +/go1.11rc2.src.tar.gz diff --git a/golang.spec b/golang.spec index a417cdc..63afee9 100644 --- a/golang.spec +++ b/golang.spec @@ -102,11 +102,11 @@ %endif %global go_api 1.11 -%global go_version 1.11rc1 +%global go_version 1.11rc2 Name: golang Version: 1.11 -Release: 0.rc1.1%{?dist} +Release: 0.rc2.1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -358,6 +358,8 @@ GOROOT=$(pwd) PATH=$(pwd)/bin:$PATH go install -race -v -x std %install rm -rf $RPM_BUILD_ROOT +# remove GC build cache +rm -rf pkg/obj/go-build/* # create the top level directories mkdir -p $RPM_BUILD_ROOT%{_bindir} @@ -544,6 +546,10 @@ fi %endif %changelog +* Thu Aug 23 2018 Jakub Čajka - 1.11-0.rc2.1 +- Rebase to go1.11rc2 +- Reduce size of bin package + * Tue Aug 14 2018 Jakub Čajka - 1.11-0.rc1.1 - Rebase to go1.11rc1 diff --git a/sources b/sources index fe56ad7..c12eae8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.11rc1.src.tar.gz) = 0ada53018ebed21fe421239087e0d36a2a892fa8584c0279cc61c49307b6130ea1cdd103aab373f44d4aeabed9e98e72bed7c06c4503aebcc09004ab5f213c6d +SHA512 (go1.11rc2.src.tar.gz) = b6d9dc14c5dc9dafb0d84ea3847038f5dd3bd3db4419e2105b0c3dfe848ded1a2c9223480f3bed0bea7a2dd7ca76f6a65d86fac2df22d39bade1aae7177046a0 From 3014b945690e2ff855ed96dc9736afed143a794c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 27 Aug 2018 16:21:42 +0200 Subject: [PATCH 154/156] Rebase to 1.11 release --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c1557a2..f61258c 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,4 @@ /go1.11beta3.src.tar.gz /go1.11rc1.src.tar.gz /go1.11rc2.src.tar.gz +/go1.11.src.tar.gz diff --git a/golang.spec b/golang.spec index 63afee9..77e3919 100644 --- a/golang.spec +++ b/golang.spec @@ -102,11 +102,11 @@ %endif %global go_api 1.11 -%global go_version 1.11rc2 +%global go_version 1.11 Name: golang Version: 1.11 -Release: 0.rc2.1%{?dist} +Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -546,6 +546,9 @@ fi %endif %changelog +* Mon Aug 27 2018 Jakub Čajka - 1.11-1 +- Rebase to go1.11 release + * Thu Aug 23 2018 Jakub Čajka - 1.11-0.rc2.1 - Rebase to go1.11rc2 - Reduce size of bin package diff --git a/sources b/sources index c12eae8..3f685c9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.11rc2.src.tar.gz) = b6d9dc14c5dc9dafb0d84ea3847038f5dd3bd3db4419e2105b0c3dfe848ded1a2c9223480f3bed0bea7a2dd7ca76f6a65d86fac2df22d39bade1aae7177046a0 +SHA512 (go1.11.src.tar.gz) = 2758b7924b4b8cffc30b56fbf039b8e23d1a3c42506ed4997bd64531ba742e2c60e95d1fa70cae2ccda45d1959fadccfd2404af87d962530e4b1d3556c4aaf43 From eb7ec5ddc18a5dae364b8763d95ddc3d4a3a7c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Sat, 6 Oct 2018 15:39:01 +0200 Subject: [PATCH 155/156] Rebase to 1.11.1 --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f61258c..6879e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ /go1.11rc1.src.tar.gz /go1.11rc2.src.tar.gz /go1.11.src.tar.gz +/go1.11.1.src.tar.gz diff --git a/golang.spec b/golang.spec index 77e3919..df13215 100644 --- a/golang.spec +++ b/golang.spec @@ -102,10 +102,10 @@ %endif %global go_api 1.11 -%global go_version 1.11 +%global go_version 1.11.1 Name: golang -Version: 1.11 +Version: 1.11.1 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -546,6 +546,9 @@ fi %endif %changelog +* Thu Oct 04 2018 Jakub Čajka - 1.11.1-1 +- Rebase to go1.11.1 + * Mon Aug 27 2018 Jakub Čajka - 1.11-1 - Rebase to go1.11 release diff --git a/sources b/sources index 3f685c9..1ea8a32 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.11.src.tar.gz) = 2758b7924b4b8cffc30b56fbf039b8e23d1a3c42506ed4997bd64531ba742e2c60e95d1fa70cae2ccda45d1959fadccfd2404af87d962530e4b1d3556c4aaf43 +SHA512 (go1.11.1.src.tar.gz) = 9c19f40b24f2180563705511a5692932c0db3585939053e6d78eea1f394902d37f05b0386f0e7d0c0266178de7e9bd7b003324ed232ce2e5050c9faafafdd979 From b86284b4f3b7d4ce99489ffcdafae093fe4ffbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Mon, 5 Nov 2018 15:16:56 +0100 Subject: [PATCH 156/156] Rebase to 1.11.2 --- .gitignore | 1 + golang.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6879e3c..7f6c1dd 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,4 @@ /go1.11rc2.src.tar.gz /go1.11.src.tar.gz /go1.11.1.src.tar.gz +/go1.11.2.src.tar.gz diff --git a/golang.spec b/golang.spec index df13215..241590c 100644 --- a/golang.spec +++ b/golang.spec @@ -102,10 +102,10 @@ %endif %global go_api 1.11 -%global go_version 1.11.1 +%global go_version 1.11.2 Name: golang -Version: 1.11.1 +Version: 1.11.2 Release: 1%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain @@ -546,6 +546,9 @@ fi %endif %changelog +* Mon Nov 05 2018 Jakub Čajka - 1.11.2-1 +- Rebase to go1.11.2 + * Thu Oct 04 2018 Jakub Čajka - 1.11.1-1 - Rebase to go1.11.1 diff --git a/sources b/sources index 1ea8a32..b7858d3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (go1.11.1.src.tar.gz) = 9c19f40b24f2180563705511a5692932c0db3585939053e6d78eea1f394902d37f05b0386f0e7d0c0266178de7e9bd7b003324ed232ce2e5050c9faafafdd979 +SHA512 (go1.11.2.src.tar.gz) = 3d9b182718c7615975a4b47cecb9ff2a8ce62156461e4112452c14617ea226121e7ab736a469050f14c89861cc4934ddd2df295b80fffff0a2dd6c155eaf0aee