1. 09 Nov, 2017 6 commits
    • Jeff R. Allen's avatar
      cmd/compile: do not write slices/strings > 2g · d7ac9bb9
      Jeff R. Allen authored
      The linker will refuse to work on objects larger than
      2e9 bytes (see issue #9862 for why).
      
      With this change, the compiler gives a useful error
      message explaining this, instead of leaving it to the
      linker to give a cryptic message later.
      
      Fixes #1700.
      
      Change-Id: I3933ce08ef846721ece7405bdba81dff644cb004
      Reviewed-on: https://go-review.googlesource.com/74330Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d7ac9bb9
    • Alberto Donizetti's avatar
      cmd/vendor/github.com/google/pprof: fix iOS builders · 8fc64a30
      Alberto Donizetti authored
      The recent vendored pprof update broke the iOS builders. The issue was
      reported and patched upstream. Re-vendor the internal pprof copy.
      
      Updates vendored pprof to commit 9e20b5b106e946f4cd1df94c1f6fe3f88456628d
      from github.com/google/pprof (2017-11-08).
      
      Fixes #22612
      
      Change-Id: I74c46c75e92ce401e605c55e27d8545c0d66082c
      Reviewed-on: https://go-review.googlesource.com/76651Reviewed-by: 's avatarElias Naur <elias.naur@gmail.com>
      8fc64a30
    • Russ Cox's avatar
      cmd/go: always update mtime during go install / go build -o / go test -c · 18361604
      Russ Cox authored
      Even if the go command can see that the target is up-to-date
      an mtime-based build system invoking the go command may not
      be able to tell. Update the mtime to make clear that the target is
      up-to-date, and also to hide exactly how smart the go command
      is or is not. This keeps users (and programs) from depending on
      the exact details of the go command's staleness determination.
      
      Without this I believe we will get a stream of (completely reasonable)
      bug reports that "go install (or go test -c) did not update the binary
      after I trivially changed the source code or touched a source file".
      
      Change-Id: I920e4aaed2a57319e3c0c37717f872bc059e484e
      Reviewed-on: https://go-review.googlesource.com/76590
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      18361604
    • Russ Cox's avatar
      cmd/go: treat cached test results as satisfying any timeout · 48f2a55a
      Russ Cox authored
      We want test caching to work even for people with scripts
      that set a non-default test timeout. But then that raises the
      question of what to do about runs with different timeouts:
      is a cached success with one timeout available for use when
      asked to run the test with a different timeout?
      
      This CL answers that question by saying that the timeout applies
      to the overall execution of either running the test or displaying
      the cached result, and displaying a cached result takes no time.
      So it's always OK to record a cached result, regardless of timeout,
      and it's always OK to display a cached result, again regardless of timeout.
      
      Fixes #22633.
      
      Change-Id: Iaef3602710e3be107602267bbc6dba9a2250796c
      Reviewed-on: https://go-review.googlesource.com/76552
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarroger peppe <rogpeppe@gmail.com>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      48f2a55a
    • Russ Cox's avatar
      cmd/go: implement per-package asmflags, gcflags, ldflags, gccgoflags · 5993251c
      Russ Cox authored
      It has always been problematic that there was no way to specify
      tool flags that applied only to the build of certain packages;
      it was only to specify flags for all packages being built.
      The usual workaround was to install all dependencies of something,
      then build just that one thing with different flags. Since the
      dependencies appeared to be up-to-date, they were not rebuilt
      with the different flags. The new content-based staleness
      (up-to-date) checks see through this trick, because they detect
      changes in flags. This forces us to address the underlying problem
      of providing a way to specify per-package flags.
      
      The solution is to allow -gcflags=pattern=flags, which means
      that flags apply to packages matching pattern, in addition to the
      usual -gcflags=flags, which is now redefined to apply only to
      the packages named on the command line.
      
      See #22527 for discussion and rationale.
      
      Fixes #22527.
      
      Change-Id: I6716bed69edc324767f707b5bbf3aaa90e8e7302
      Reviewed-on: https://go-review.googlesource.com/76551
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      5993251c
    • Russ Cox's avatar
      cmd/go: move cfg.ExternalLinkingForced to internal/load · 98f1bfbb
      Russ Cox authored
      It needs to refer to packages, so it can no longer be in cfg.
      No semantic changes here.
      
      Can now be unexported, so that was a net win anyway.
      
      Change-Id: I58bf6cdcd435e6e019291bb8dcd5d5b7f1ac03a3
      Reviewed-on: https://go-review.googlesource.com/76550
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      98f1bfbb
  2. 08 Nov, 2017 8 commits
  3. 07 Nov, 2017 16 commits
  4. 06 Nov, 2017 10 commits
    • griesemer's avatar
      cmd/compile/internal/syntax: better syntax errors for typos in if/switch/for headers · 17ff23f7
      griesemer authored
      Be more pessimistic when parsing if/switch/for headers for better error
      messages when things go wrong.
      
      Fixes #22581.
      
      Change-Id: Ibb99925291ff53f35021bc0a59a4c9a7f695a194
      Reviewed-on: https://go-review.googlesource.com/76290
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      17ff23f7
    • Carlos Eduardo Seo's avatar
      runtime: improve IndexByte for ppc64x · be943df5
      Carlos Eduardo Seo authored
      This change adds a better implementation of IndexByte in asm that uses the
      vector registers/instructions on ppc64x.
      
      benchmark                            old ns/op     new ns/op     delta
      BenchmarkIndexByte/10-8              9.70          9.37          -3.40%
      BenchmarkIndexByte/32-8              10.9          10.9          +0.00%
      BenchmarkIndexByte/4K-8              254           92.8          -63.46%
      BenchmarkIndexByte/4M-8              249246        118435        -52.48%
      BenchmarkIndexByte/64M-8             10737987      7383096       -31.24%
      
      benchmark                            old MB/s     new MB/s     speedup
      BenchmarkIndexByte/10-8              1030.63      1067.24      1.04x
      BenchmarkIndexByte/32-8              2922.69      2928.53      1.00x
      BenchmarkIndexByte/4K-8              16065.95     44156.45     2.75x
      BenchmarkIndexByte/4M-8              16827.96     35414.21     2.10x
      BenchmarkIndexByte/64M-8             6249.67      9089.53      1.45x
      
      Change-Id: I81dbdd620f7bb4e395ce4d1f2a14e8e91e39f9a1
      Reviewed-on: https://go-review.googlesource.com/71710
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarLynn Boger <laboger@linux.vnet.ibm.com>
      be943df5
    • Joe Tsai's avatar
      archive/zip: add FileHeader.NonUTF8 field · 4fcc8359
      Joe Tsai authored
      The NonUTF8 field provides users with a way to explictly tell the
      ZIP writer to avoid setting the UTF-8 flag.
      This is necessary because many readers:
      	1) (Still) do not support UTF-8
      	2) And use the local system encoding instead
      
      Thus, even though character encodings other than CP-437 and UTF-8
      are not officially supported by the ZIP specification, pragmatically
      the world has permitted use of them.
      
      When a non-standard encoding is used, it is the user's responsibility
      to ensure that the target system is expecting the encoding used
      (e.g., producing a ZIP file you know is used on a Chinese version of Windows).
      
      We adjust the detectUTF8 function to account for Shift-JIS and EUC-KR
      not being identical to ASCII for two characters.
      
      We don't need an API for users to explicitly specify that they are encoding
      with UTF-8 since all single byte characters are compatible with all other
      common encodings (Windows-1256, Windows-1252, Windows-1251, Windows-1250,
      IEC-8859, EUC-KR, KOI8-R, Latin-1, Shift-JIS, GB-2312, GBK) except for
      the non-printable characters and the backslash character (all of which
      are invalid characters in a path name anyways).
      
      Fixes #10741
      
      Change-Id: I9004542d1d522c9137973f1b6e2b623fa54dfd66
      Reviewed-on: https://go-review.googlesource.com/75592
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      4fcc8359
    • Emmanuel Odeke's avatar
      cmd/compile: lock in test for column numbers in unused error · 0c554957
      Emmanuel Odeke authored
      Updates #21317
      
      @mdempsky fixed issue #21317 with CL 66810,
      so lock a test in to ensure we don't regress.
      
      The test is manual for now before test/run.go
      has support for matching column numbers so do
      it old school and match expected output after
      an exec.
      
      Change-Id: I6c2a66ddf04248f79d17ed7033a3280d50e41562
      Reviewed-on: https://go-review.googlesource.com/76150
      Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0c554957
    • Austin Clements's avatar
      cmd/compile: []T where T is go:notinheap does not need write barriers · 3a446d86
      Austin Clements authored
      Currently, assigning a []T where T is a go:notinheap type generates an
      unnecessary write barrier for storing the slice pointer.
      
      This fixes this by teaching HasHeapPointer that this type does not
      have a heap pointer, and tweaking the lowering of slice assignments so
      the pointer store retains the correct type rather than simply lowering
      it to a *uint8 store.
      
      Change-Id: I8bf7c66e64a7fefdd14f2bd0de8a5a3596340bab
      Reviewed-on: https://go-review.googlesource.com/76027
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3a446d86
    • Cherry Zhang's avatar
      cmd/dist: include "cmd/buildid" in toolchain in debug mode · 0838c0f2
      Cherry Zhang authored
      Fixes #22599.
      
      Change-Id: I2d59a8fae457881f681184fc6ed1f2aa597699b3
      Reviewed-on: https://go-review.googlesource.com/76026
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      0838c0f2
    • Russ Cox's avatar
      cmd/dist: do not reinstall runtime/cgo with -tags lldb on ios builders · fa62ea69
      Russ Cox authored
      The cache will take care of keeping go test -tags lldb fast.
      Installing runtime/cgo this way just makes all the checkNotStale
      tests think runtime/cgo is out of date.
      
      Should fix ios builders.
      
      Fixes #22509.
      
      Change-Id: If092cc4feb189eb848b6a22f6d22b89b70df219c
      Reviewed-on: https://go-review.googlesource.com/76020
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      fa62ea69
    • Russ Cox's avatar
      cmd/dist, cmd/go: make GODEBUG=godebughash=1 ./make.bash work better · 1ca4768e
      Russ Cox authored
      The change in cmd/dist ignores debug output, instead of assuming
      any output is from the template.
      
      The change in cmd/go makes the debug output show the package name
      on every line, so that interlaced prints can be deinterlaced.
      
      Change-Id: Ic3d59ee0256271067cb9be2fde643a0e19405375
      Reviewed-on: https://go-review.googlesource.com/76019
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      1ca4768e
    • Russ Cox's avatar
      cmd/dist, cmd/cgo, cmd/go: allow per-goos/goarch default CC · 4739c0db
      Russ Cox authored
      Even though cmd/dist has historically distinguished "CC for gohostos/gohostarch"
      from "CC for target goos/goarch", it has not recorded that distinction
      for later use by cmd/cgo and cmd/go. Now that content-based staleness
      includes the CC setting in the decision about when to rebuild packages,
      the go command needs to know the details of which CC to use when.
      Otherwise lots of things look out of date and (worse) may be rebuilt with
      the wrong CC.
      
      A related issue is that users may want to be able to build a toolchain
      capable of cross-compiling for two different non-host targets, and
      to date we've required that CC_FOR_TARGET apply to both.
      This CL introduces CC_FOR_${GOOS}_${GOARCH}, so that you can
      (for example) set CC_FOR_linux_arm and CC_FOR_linux_arm64
      separately on a linux/ppc64 host and be able to cross-compile to
      either arm or arm64 with the right toolchain.
      
      Fixes #8161.
      Half of a fix for #22509.
      
      Change-Id: I7a43769f39d859f659d31bc96980918ba102fb83
      Reviewed-on: https://go-review.googlesource.com/76018
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      4739c0db
    • Russ Cox's avatar
      cmd/go: ignore stderr from tool version checks · 5e48d2b6
      Russ Cox authored
      There are multiple valid reasons a tool might print to stderr.
      As long as we get the expected output on stdout, that's fine.
      
      Fixes #22588.
      
      Change-Id: I9c5d32da08288cb26dd575530a8257cd5f375367
      Reviewed-on: https://go-review.googlesource.com/76017
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      5e48d2b6