Skip to content

Commit

Permalink
Import Debian changes 1.14.6-1
Browse files Browse the repository at this point in the history
golang-1.14 (1.14.6-1) unstable; urgency=medium

  * New upstream version 1.14.6
    - Refresh patches
    - net/http: Expect 100-continue panics in httputil.ReverseProxy.
      See golang/go#34902, fixes CVE-2020-15586
  • Loading branch information
toddy15 authored and kph committed Sep 9, 2020
2 parents 81ac2f8 + 78fbf60 commit dccdab4
Show file tree
Hide file tree
Showing 47 changed files with 1,554 additions and 855 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
go1.14.4
go1.14.6
9 changes: 9 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
golang-1.14 (1.14.6-1) unstable; urgency=medium

* New upstream version 1.14.6
- Refresh patches
- net/http: Expect 100-continue panics in httputil.ReverseProxy.
See https://github.com/golang/go/issues/34902, fixes CVE-2020-15586

-- Dr. Tobias Quathamer <[email protected]> Mon, 03 Aug 2020 20:38:32 +0200

golang-1.14 (1.14.4-2) unstable; urgency=medium

* Team upload.
Expand Down
22 changes: 13 additions & 9 deletions debian/patches/0004-Mips32-cgo-use-mfp32-option.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 350223e0208a91e11a9fcc65611f21b63b840247 Mon Sep 17 00:00:00 2001
From: YunQiang Su <[email protected]>
Date: Tue, 09 Jun 2020 04:09:58 +0000
Subject: [PATCH] cmd/go, cmd/cgo: pass -mfp32 and -mhard/soft-float to MIPS GCC
Date: Tue, 9 Jun 2020 04:09:58 +0000
Subject: [PATCH] cmd/go,
cmd/cgo: pass -mfp32 and -mhard/soft-float to MIPS GCC

For mips32 currently, we are using FP32, while the gcc may be FPXX,
which may generate .MIPS.abiflags and .gnu.attributes section with
Expand All @@ -28,12 +28,16 @@ Fixes #39435

Change-Id: I54026ad416a815fe43a9261ebf6d02e5519c3930
---
src/cmd/cgo/gcc.go | 12 ++++++++++--
src/cmd/cgo/main.go | 4 +++-
src/cmd/go/internal/work/exec.go | 14 ++++++++++++--
3 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go
index a59534e..d1bdee8 100644
index 7f99057..dd69fd7 100644
--- a/src/cmd/cgo/gcc.go
+++ b/src/cmd/cgo/gcc.go
@@ -1548,9 +1548,17 @@
@@ -1545,9 +1545,17 @@ func (p *Package) gccMachine() []string {
case "s390x":
return []string{"-m64"}
case "mips64", "mips64le":
Expand All @@ -57,7 +61,7 @@ diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go
index 5a7bb3f..e0fede8 100644
--- a/src/cmd/cgo/main.go
+++ b/src/cmd/cgo/main.go
@@ -227,7 +227,7 @@
@@ -227,7 +227,7 @@ var gccgoMangleCheckDone bool
var gccgoNewmanglingInEffect bool
var importRuntimeCgo = flag.Bool("import_runtime_cgo", true, "import runtime/cgo in generated code")
var importSyscall = flag.Bool("import_syscall", true, "import syscall in generated code")
Expand All @@ -66,7 +70,7 @@ index 5a7bb3f..e0fede8 100644

func main() {
objabi.AddVersionFlag() // -V
@@ -376,6 +376,8 @@
@@ -376,6 +376,8 @@ func newPackage(args []string) *Package {
if s := os.Getenv("GOOS"); s != "" {
goos = s
}
Expand All @@ -76,10 +80,10 @@ index 5a7bb3f..e0fede8 100644
if ptrSize == 0 {
fatalf("unknown ptrSize for $GOARCH %q", goarch)
diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
index 071c9d2..347a060 100644
index 25d1507..bdef08e 100644
--- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go
@@ -2488,9 +2488,19 @@
@@ -2409,9 +2409,19 @@ func (b *Builder) gccArchArgs() []string {
case "s390x":
return []string{"-m64", "-march=z196"}
case "mips64", "mips64le":
Expand Down
10 changes: 9 additions & 1 deletion doc/go1.14.html
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,15 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
certificate, and letting the package automatically select the best one.
Note that the performance of this selection is going to be poor unless the
<a href="/pkg/crypto/tls/#Certificate.Leaf"><code>Certificate.Leaf</code></a>
field is set.
field is set. The
<a href="/pkg/crypto/tls/#Config.NameToCertificate"><code>Config.NameToCertificate</code></a>
field, which only supports associating a single certificate with
a give name, is now deprecated and should be left as <code>nil</code>.
Similarly the
<a href="/pkg/crypto/tls/#Config.BuildNameToCertificate"><code>Config.BuildNameToCertificate</code></a>
method, which builds the <code>NameToCertificate</code> field
from the leaf certificates, is now deprecated and should not be
called.
</p>

<p><!-- CL 175517 -->
Expand Down
16 changes: 7 additions & 9 deletions src/cmd/compile/internal/ssa/deadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ func dse(f *Func) {
}

// Walk backwards looking for dead stores. Keep track of shadowed addresses.
// An "address" is an SSA Value which encodes both the address and size of
// the write. This code will not remove dead stores to the same address
// of different types.
// A "shadowed address" is a pointer and a size describing a memory region that
// is known to be written. We keep track of shadowed addresses in the shadowed
// map, mapping the ID of the address to the size of the shadowed region.
// Since we're walking backwards, writes to a shadowed region are useless,
// as they will be immediately overwritten.
shadowed.clear()
v := last

Expand All @@ -93,17 +95,13 @@ func dse(f *Func) {
sz = v.AuxInt
}
if shadowedSize := int64(shadowed.get(v.Args[0].ID)); shadowedSize != -1 && shadowedSize >= sz {
// Modify store into a copy
// Modify the store/zero into a copy of the memory state,
// effectively eliding the store operation.
if v.Op == OpStore {
// store addr value mem
v.SetArgs1(v.Args[2])
} else {
// zero addr mem
typesz := v.Args[0].Type.Elem().Size()
if sz != typesz {
f.Fatalf("mismatched zero/store sizes: %d and %d [%s]",
sz, typesz, v.LongString())
}
v.SetArgs1(v.Args[1])
}
v.Aux = nil
Expand Down
20 changes: 13 additions & 7 deletions src/cmd/compile/internal/ssa/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ var gogcflags = os.Getenv("GO_GCFLAGS")
// optimizedLibs usually means "not running in a noopt test builder".
var optimizedLibs = (!strings.Contains(gogcflags, "-N") && !strings.Contains(gogcflags, "-l"))

// TestNexting go-builds a file, then uses a debugger (default gdb, optionally delve)
// TestNexting go-builds a file, then uses a debugger (default delve, optionally gdb)
// to next through the generated executable, recording each line landed at, and
// then compares those lines with reference file(s).
// Flag -u updates the reference file(s).
// Flag -d changes the debugger to delve (and uses delve-specific reference files)
// Flag -g changes the debugger to gdb (and uses gdb-specific reference files)
// Flag -v is ever-so-slightly verbose.
// Flag -n is for dry-run, and prints the shell and first debug commands.
//
Expand Down Expand Up @@ -83,17 +83,17 @@ var optimizedLibs = (!strings.Contains(gogcflags, "-N") && !strings.Contains(gog
// to indicate normalization of Strings, (hex) addresses, and numbers.
// "O" is an explicit indication that we expect it to be optimized out.
// For example:
/*
if len(os.Args) > 1 { //gdb-dbg=(hist/A,cannedInput/A) //dlv-dbg=(hist/A,cannedInput/A)
*/
//
// if len(os.Args) > 1 { //gdb-dbg=(hist/A,cannedInput/A) //dlv-dbg=(hist/A,cannedInput/A)
//
// TODO: not implemented for Delve yet, but this is the plan
//
// After a compiler change that causes a difference in the debug behavior, check
// to see if it is sensible or not, and if it is, update the reference files with
// go test debug_test.go -args -u
// (for Delve)
// go test debug_test.go -args -u -d

//
func TestNexting(t *testing.T) {
skipReasons := "" // Many possible skip reasons, list all that apply
if testing.Short() {
Expand All @@ -108,7 +108,13 @@ func TestNexting(t *testing.T) {
// Various architectures tend to differ slightly sometimes, and keeping them
// all in sync is a pain for people who don't have them all at hand,
// so limit testing to amd64 (for now)
skipReasons += "not run when testing gdb (-g) unless forced (-f) or linux-amd64"
skipReasons += "not run when testing gdb (-g) unless forced (-f) or linux-amd64; "
}

if !*useGdb && !*force && testenv.Builder() == "linux-386-longtest" {
// The latest version of Delve does support linux/386. However, the version currently
// installed in the linux-386-longtest builder does not. See golang.org/issue/39309.
skipReasons += "not run when testing delve on linux-386-longtest builder unless forced (-f); "
}

if *useGdb {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ require (
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d
golang.org/x/mod v0.2.0
golang.org/x/sys v0.0.0-20200131233351-9e5cf931a04b // indirect
golang.org/x/tools v0.0.0-20200131233409-575de47986ce
golang.org/x/tools v0.0.0-20200602230032-c00d67ef29d0
)
4 changes: 2 additions & 2 deletions src/cmd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e h1:aZzprAO9/8oim3qStq3wc1Xuxx4QmAGriC4VU4ojemQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200131233409-575de47986ce h1:Uglradbb4KfUWaYasZhlsDsGRwHHvRsHoNAEONef0W8=
golang.org/x/tools v0.0.0-20200131233409-575de47986ce/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200602230032-c00d67ef29d0 h1:6txNFSnY+tteYoO+hf01EpdYcYZiurdC9MDIrcUzEu4=
golang.org/x/tools v0.0.0-20200602230032-c00d67ef29d0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
39 changes: 0 additions & 39 deletions src/cmd/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3955,45 +3955,6 @@ func TestCgoFlagContainsSpace(t *testing.T) {
tg.grepStderrNot(`"-L[^"]+c flags".*"-L[^"]+c flags"`, "found too many quoted ld flags")
}

// Issue 9737: verify that GOARM and GO386 affect the computed build ID.
func TestBuildIDContainsArchModeEnv(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}

var tg *testgoData
testWith := func(before, after func()) func(*testing.T) {
return func(t *testing.T) {
tg = testgo(t)
defer tg.cleanup()
tg.tempFile("src/mycmd/x.go", `package main
func main() {}`)
tg.setenv("GOPATH", tg.path("."))

tg.cd(tg.path("src/mycmd"))
tg.setenv("GOOS", "linux")
before()
tg.run("install", "mycmd")
after()
tg.wantStale("mycmd", "stale dependency", "should be stale after environment variable change")
}
}

t.Run("386", testWith(func() {
tg.setenv("GOARCH", "386")
tg.setenv("GO386", "387")
}, func() {
tg.setenv("GO386", "sse2")
}))

t.Run("arm", testWith(func() {
tg.setenv("GOARCH", "arm")
tg.setenv("GOARM", "5")
}, func() {
tg.setenv("GOARM", "7")
}))
}

func TestListTests(t *testing.T) {
tooSlow(t)
var tg *testgoData
Expand Down
27 changes: 27 additions & 0 deletions src/cmd/go/testdata/script/build_cache_arch_mode.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Issue 9737: verify that GOARM and GO386 affect the computed build ID

[short] skip

# 386
cd $GOPATH/src/mycmd
env GOOS=linux
env GOARCH=386
env GO386=387
go install mycmd
env GO386=sse2
stale mycmd

# arm
cd $GOPATH/src/mycmd
env GOOS=linux
env GOARCH=arm
env GOARM=5
go install mycmd
env GOARM=7
stale mycmd


-- mycmd/x.go --
package main

func main() {}
32 changes: 32 additions & 0 deletions src/cmd/go/testdata/script/test_benchmark_chatty_fail.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Run chatty tests. Assert on CONT lines.
! go test chatty_test.go -v -bench . chatty_bench

# Sanity check that output occurs.
stdout -count=2 'this is sub-0'
stdout -count=2 'this is sub-1'
stdout -count=2 'this is sub-2'
stdout -count=1 'error from sub-0'
stdout -count=1 'error from sub-1'
stdout -count=1 'error from sub-2'

# Benchmarks should not print CONT.
! stdout CONT

-- chatty_test.go --
package chatty_bench

import (
"testing"
"fmt"
)

func BenchmarkChatty(b *testing.B) {
for i := 0; i < 3; i++ {
b.Run(fmt.Sprintf("sub-%d", i), func(b *testing.B) {
for j := 0; j < 2; j++ {
b.Logf("this is sub-%d", i)
}
b.Errorf("error from sub-%d", i)
})
}
}
29 changes: 29 additions & 0 deletions src/cmd/go/testdata/script/test_benchmark_chatty_success.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Run chatty tests. Assert on CONT lines.
go test chatty_test.go -v -bench . chatty_bench

# Sanity check that output happens. We don't provide -count because the amount
# of output is variable.
stdout 'this is sub-0'
stdout 'this is sub-1'
stdout 'this is sub-2'

# Benchmarks should not print CONT.
! stdout CONT

-- chatty_test.go --
package chatty_bench

import (
"testing"
"fmt"
)

func BenchmarkChatty(b *testing.B) {
for i := 0; i < 3; i++ {
b.Run(fmt.Sprintf("sub-%d", i), func(b *testing.B) {
for j := 0; j < 2; j++ {
b.Logf("this is sub-%d", i)
}
})
}
}
32 changes: 32 additions & 0 deletions src/cmd/go/testdata/script/test_chatty_fail.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Run chatty tests. Assert on CONT lines.
! go test chatty_test.go -v

# Sanity check that output occurs.
stdout -count=2 'this is sub-0'
stdout -count=2 'this is sub-1'
stdout -count=2 'this is sub-2'
stdout -count=1 'error from sub-0'
stdout -count=1 'error from sub-1'
stdout -count=1 'error from sub-2'

# Non-parallel tests should not print CONT.
! stdout CONT

-- chatty_test.go --
package chatty_test

import (
"testing"
"fmt"
)

func TestChatty(t *testing.T) {
for i := 0; i < 3; i++ {
t.Run(fmt.Sprintf("sub-%d", i), func(t *testing.T) {
for j := 0; j < 2; j++ {
t.Logf("this is sub-%d", i)
}
t.Errorf("error from sub-%d", i)
})
}
}
Loading

0 comments on commit dccdab4

Please sign in to comment.