1. 05 Oct, 2017 25 commits
    • Alex Brainman's avatar
      misc/cgo/testcshared: skip all but TestExportedSymbols on windows · 7e31d9b9
      Alex Brainman authored
      TestUnexportedSymbols requires dup2 that
      my gcc installation does not have.
      
      TestSignalHandlersWithNotify fails with:
      undefined: syscall.SIGIO.
      
      TestSignalHandlers fails with:
      sched.h: No such file or directory.
      
      TestExportedSymbolsWithDynamicLoad fails with:
      dlfcn.h: No such file or directory.
      
      Also add t.Helper calls to better error messages.
      
      Updates #11058
      
      Change-Id: I7eb514968464256b8337e45f57fcb7d7fe0e4693
      Reviewed-on: https://go-review.googlesource.com/68410
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      7e31d9b9
    • Matthew Dempsky's avatar
      cmd/compile: cleanup genwrapper slightly · 31a3b719
      Matthew Dempsky authored
      ORETJMP doesn't need an ONAME if we just set the target method on Sym
      instead of Left. Conveniently, this is where fmt.go was looking for it
      anyway.
      
      Change the iface parameter and global compiling_wrappers to bool.
      
      Passes toolstash-check.
      
      Change-Id: I5333f8bcb4e06bf8161808041125eb95c439aafe
      Reviewed-on: https://go-review.googlesource.com/68252
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDaniel Martí <mvdan@mvdan.cc>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      31a3b719
    • Cherry Zhang's avatar
      cmd/internal/obj/arm64: fix handling of unaligned offset between 256 and 504 · a92a77c5
      Cherry Zhang authored
      C_PPAUTO was matching offsets that is a multiple 8. But this
      condition is dropped in CL 55610, causing unaligned offset
      between 256 and 504 mistakenly matched to some classes, e.g.
      C_UAUTO8K. This CL restores this condition, also fixes an
      error that C_PPAUTO shouldn't match C_PSAUTO, because the
      latter is not guaranteed to be multiple of 8. C_PPAUTO_8 is
      unnecessary, removed.
      
      Fixes #21992.
      
      Change-Id: I75d5a0e5f5dc3dae335721fbec1bbcd4a3b862f2
      Reviewed-on: https://go-review.googlesource.com/65730Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      a92a77c5
    • Ilya Tocar's avatar
      cmd/compile/internal/amd64: add SETccmem · 6b8a3c88
      Ilya Tocar authored
      Combine setcc and store of result into setcc that writes directly to memory.
      Triggers 200+ times in go tool.
      
      Fixes #21630
      
      Change-Id: Iafa22607426f4120140c88fae4b9aecb46e0bba8
      Reviewed-on: https://go-review.googlesource.com/67950
      Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      6b8a3c88
    • Austin Clements's avatar
      runtime: fix exit1 arguments on Darwin · 91121ff7
      Austin Clements authored
      exit1 calls the bsdthread_terminate system call on Darwin. Currently
      it passes no arguments on 386, arm, and arm64, and an exit status on
      amd64. None of these are right. The signature of bsdthread_terminate
      is:
      
      int bsdthread_terminate(user_addr_t stackaddr, size_t freesize, uint32_t port, uint32_t sem);
      
      Fix all of the Darwin exit1 implementations to call
      bsdthread_terminate with 0 for all of these arguments so it doesn't
      try to unmap some random memory, free some random port, or signal a
      random semaphore.
      
      This isn't a problem in practice because exit1 is never called.
      However, we're about to start using exit1.
      
      Change-Id: Idc534d196e3104e5253fc399553f21eb608693d7
      Reviewed-on: https://go-review.googlesource.com/46036
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      91121ff7
    • Russ Cox's avatar
      cmd/go: stop treating GOROOT binaries specially · aac0d52d
      Russ Cox authored
      This was for cmd/cgo, and cmd/cgo isn't special anymore.
      
      Change-Id: I71efaf553b24798b523c7102859428d36b470698
      Reviewed-on: https://go-review.googlesource.com/68530
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      aac0d52d
    • Keith Randall's avatar
      runtime: force the type of specialfinalizer into DWARF · 97d17fcf
      Keith Randall authored
      The core dump reader wants to know the layout of this type.
      No variable has this type, so it wasn't previously dumped
      to DWARF output.
      
      Change-Id: I982040b81bff202976743edc7fe53247533a9d81
      Reviewed-on: https://go-review.googlesource.com/68312Reviewed-by: 's avatarAustin Clements <austin@google.com>
      97d17fcf
    • Austin Clements's avatar
      runtime: make LockOSThread/UnlockOSThread nested · c85b12b5
      Austin Clements authored
      Currently, there is a single bit for LockOSThread, so two calls to
      LockOSThread followed by one call to UnlockOSThread will unlock the
      thread. There's evidence (#20458) that this is almost never what
      people want or expect and it makes these APIs very hard to use
      correctly or reliably.
      
      Change this so LockOSThread/UnlockOSThread can be nested and the
      calling goroutine will not be unwired until UnlockOSThread has been
      called as many times as LockOSThread has. This should fix the vast
      majority of incorrect uses while having no effect on the vast majority
      of correct uses.
      
      Fixes #20458.
      
      Change-Id: I1464e5e9a0ea4208fbb83638ee9847f929a2bacb
      Reviewed-on: https://go-review.googlesource.com/45752
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      c85b12b5
    • Russ Cox's avatar
      cmd/dist, cmd/go: treat cmd/cgo like other build tools · 555c16d8
      Russ Cox authored
      The primary build tools cmd/asm, cmd/compile, and cmd/link are
      built during cmd/dist bootstrap and then assumed by cmd/go to
      be available for any future builds.
      
      The only tool invoked by cmd/go during a build and not in this list
      is cmd/cgo; instead of being built during cmd/dist and assumed by
      cmd/go, cmd/go arranges to build cmd/cgo if needed as part of
      the regular build. We got here because at the time cmd/go was written,
      cmd/cgo was the only build tool written in Go (the others were in C),
      and so it made some sense to put cmd/dist in charge of building
      the C tools and to have custom code in cmd/go to build cmd/cgo
      just in time for it to be used by a particular build.
      
      This custom code has historically been quite subtle, though, because
      the build of cmd/cgo inherits whatever build flags apply to the
      build that wants to use cmd/cgo. If you're not careful,
      "go install -race strings" might under the wrong circumstances
      also install a race-enabled cmd/cgo binary, which is unexpected
      at the least.
      
      The custom code is only going to get more problematic as we
      move toward more precise analysis of whether dependencies are
      up-to-date. In that case, "go build -race strings" will check to
      see if there is not just a cmd/cgo already but a race-enabled
      cmd/cgo, which makes no sense.
      
      Instead of perpetuating the special case, treat cgo like all the
      other build tools: build it first in cmd/dist, and then assume it is present.
      This simplifies cmd/go.
      
      Building cmd/cgo during bootstrap also allows the default
      build of cmd/cgo to be built using cgo, which may be necessary
      on future essentially-cgo-only systems.
      
      Change-Id: I414e22c10c9920f4e98f97fa35ff22058c0f143d
      Reviewed-on: https://go-review.googlesource.com/68338
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      555c16d8
    • David Chase's avatar
      cmd/compile: make loop finder more aware of irreducible loops · 9e21e9c5
      David Chase authored
      The loop finder doesn't return good information if it
      encounters an irreducible loop.  Make a start on improving
      this, and set a function-level flag to indicate when there
      is such a loop (and the returned information might be flaky).
      
      Use that flag to prevent the loop rotater from getting
      confused; the existing code seems to depend on artifacts
      of the previous loop-finding algorithm. (There is one
      irreducible loop in the go library, in "inflate.go").
      
      Change-Id: If6e26feab38d9b009d2252d556e1470c803bde40
      Reviewed-on: https://go-review.googlesource.com/42150
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      9e21e9c5
    • Matthew Dempsky's avatar
      cmd/internal/dwarf: remove unused SymValue method · acdb4476
      Matthew Dempsky authored
      Change-Id: Ied42c2778899ce12cc256f0a124b77bf0e141aee
      Reviewed-on: https://go-review.googlesource.com/68471
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      acdb4476
    • Russ Cox's avatar
      cmd/go: clean up implicit compiler and linker dependencies · 5edfaa2c
      Russ Cox authored
      Telling the truth about these will be important for
      content-based staleness checks.
      
      Change-Id: Iaed6ca6c945eb805d815156753a3e5dc48c6f0b9
      Reviewed-on: https://go-review.googlesource.com/68336
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      5edfaa2c
    • Russ Cox's avatar
      cmd/go, runtime/cgo: rewrite darwin/arm panicmem setup to avoid init function · 69b0b3ad
      Russ Cox authored
      Init functions are problematic because we want cmd/link to be
      able to insert an import of runtime/cgo for external linking.
      For all the other systems that just means putting runtime/cgo into
      the binary. The linker is not set up to generate calls to init functions,
      and luckily this one can be avoided entirely.
      
      This means people don't have to import _ "runtime/cgo" in their
      iOS programs anymore. The linker's default import is now enough.
      
      This CL also adjusts cmd/go to record the linker's default import,
      now that the explicit import is gone.
      
      Change-Id: I81d23476663e03664f90d531c24db2e4f2e6c66b
      Reviewed-on: https://go-review.googlesource.com/68490
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      69b0b3ad
    • Matthew Dempsky's avatar
      cmd/compile: allow := to shadow dot-imported names · f22ef702
      Matthew Dempsky authored
      Historically, gc optimistically parsed the left-hand side of
      assignments as expressions. Later, if it discovered a ":=" assignment,
      it rewrote the parsed expressions as declarations.
      
      This failed in the presence of dot imports though, because we lost
      information about whether an imported object was named via a bare
      identifier "Foo" or a normal qualified "pkg.Foo".
      
      This CL fixes the issue by specially noding the left-hand side of ":="
      assignments.
      
      Fixes #22076.
      
      Change-Id: I18190ecdb863112e7d009e1687e6112eec559921
      Reviewed-on: https://go-review.googlesource.com/66810
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: 's avatarDaniel Martí <mvdan@mvdan.cc>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      f22ef702
    • Michael Munday's avatar
      crypto/elliptic: fix incomplete addition used in CombinedMult on s390x · 3b8a0315
      Michael Munday authored
      This applies the amd64-specific changes from CL 42611 to the s390x P256
      implementation. The s390x implementation was disabled in CL 62292 and
      this CL re-enables it.
      
      Adam Langley's commit message from CL 42611:
      
      The optimised P-256 includes a CombinedMult function, which doesn't do
      dual-scalar multiplication, but does avoid an affine conversion for
      ECDSA verification.
      
      However, it currently uses an assembly point addition function that
      doesn't handle exceptional cases.
      
      Fixes #20215.
      
      Change-Id: I2f6b532f495e85b8903475b4f64cc32a3b2f6769
      Reviewed-on: https://go-review.googlesource.com/64290
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      3b8a0315
    • Russ Cox's avatar
      debug/elf: make safe for Go 1.4 compilers · d24a36cc
      Russ Cox authored
      We're going to start building cmd/cgo as part of the bootstrap,
      and with it debug/elf, so the copy here needs to work with Go 1.4.
      It does except for the use of the new io.SeekStart etc constants,
      so remove that use.
      
      Change-Id: Ib7fcf46e1e9060f96d2bacaaf349c9b0df347550
      Reviewed-on: https://go-review.googlesource.com/68337
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      d24a36cc
    • Russ Cox's avatar
      cmd/go/internal/work: pass *Action to toolchain methods · 8ec18897
      Russ Cox authored
      This shortens the args lists but also sets up better for
      the content-based staleness changes.
      
      While we're here, delete the now-unused Pkgpath method.
      
      Change-Id: Ic60fa03efbc37a7c7fe9758a1cfa5dddef1a4151
      Reviewed-on: https://go-review.googlesource.com/68335Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      8ec18897
    • Ben Shi's avatar
      cmd/internal/obj/arm: support more ARMv6 instructions · 0ed1c380
      Ben Shi authored
      The following instructions were introduced in ARMv6, and the compiler
      can do more optimization with them.
      
      1. "MOVBS Rm@>i, Rd": rotates Rm 0/8/16/24 bits, does signed
      byte extension to word, and writes the result to Rd.
      
      2. "MOVHS Rm@>i, Rd": rotates Rm 0/8/16/24 bits, does signed
      halfword extension to word, and writes the result to Rd.
      
      3. "MOVBU Rm@>i, Rd": rotates Rm 0/8/16/24 bits, does unsigned
      byte extension to word, and writes the result to Rd.
      
      4. "MOVHU Rm@>i, Rd": rotates Rm 0/8/16/24 bits, does unsigned
      half-word extension to word, and writes the result to Rd.
      
      5. "XTAB Rm@>i, Rn, Rd": rotates Rm 0/8/16/24 bits, does signed
      byte extension to word, adds Rn, and writes the result to Rd.
      
      6. "XTAH Rm@>i, Rn, Rd": rotates Rm 0/8/16/24 bits, does signed
      half-word extension to word, adds Rn, and writes the result to Rd.
      
      7. "XTABU Rm@>i, Rn, Rd": rotates Rm 0/8/16/24 bits, does unsigned
      byte extension to word, adds Rn, and writes the result to Rd.
      
      8. "XTAHU Rm@>i, Rn, Rd": rotates Rm 0/8/16/24 bits, does unsigned
      half-word extension to word, adds Rn, and writes the result to Rd.
      
      Change-Id: I4306d7ebac93015d7e2e40d307f2c4271c03f466
      Reviewed-on: https://go-review.googlesource.com/65790Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0ed1c380
    • David Crawshaw's avatar
      cmd/link: move Library type to sym package · a910fe2c
      David Crawshaw authored
      For #22095
      
      Change-Id: I2cb0d3e0aaf9f97952cf8dda0e99a4379e275020
      Reviewed-on: https://go-review.googlesource.com/68332
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDave Cheney <dave@cheney.net>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      a910fe2c
    • David Crawshaw's avatar
      cmd/link: put symbol data types in new package · 475d92ba
      David Crawshaw authored
      For #22095
      
      Change-Id: I07c288208d94dabae164c2ca0a067402a8e5c2e6
      Reviewed-on: https://go-review.googlesource.com/68331
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      475d92ba
    • David Crawshaw's avatar
      cmd/link: type symbol name mangling for plugins · 24e4a128
      David Crawshaw authored
      Moves type symbol name mangling out of the object reader
      and into a separate pass. Requires some care, as changing
      the name of a type may require dealing with duplicate
      symbols for the first time.
      
      Disables DWARF for both plugins and programs that use plugin.Open,
      because type manging is currently incompatible with the go.info.*
      symbol generator in cmd/link. (It relies on the symbol names to
      find type information.) A future fix for this would be moving the
      go.info.* generation into the compiler, with the logic we use
      for generating the type.* symbols.
      
      Fixes #19529
      
      Change-Id: I75615f8bdda86ff9e767e536d9aa36e15c194098
      Reviewed-on: https://go-review.googlesource.com/67312
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      24e4a128
    • Russ Cox's avatar
      cmd/go/internal/cache: add support definitions · be272ec0
      Russ Cox authored
      There is no cache here yet. This CL defines ActionID, Hash, and HashFile,
      which the new content-based staleness code can use. Eventually we'll
      put a real cache implementation here, but it's not necessary yet.
      
      Change-Id: Ide433cb449f4dbe658694453f348c947642df79b
      Reviewed-on: https://go-review.googlesource.com/67311Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      be272ec0
    • Alex Brainman's avatar
      path/filepath: re-implement windows EvalSymlinks · 66c03d39
      Alex Brainman authored
      CL 41834 used approach suggested by Raymond Chen in
      https://blogs.msdn.microsoft.com/oldnewthing/20100212-00/?p=14963/
      to implement os.Stat by getting Windows I/O manager
      follow symbolic links.
      
      Do the same for filepath.EvalSymlinks, when existing
      strategy fails.
      
      Updates #19922
      Fixes #20506
      
      Change-Id: I15f3d3a80256bae86ac4fb321fd8877e84d8834f
      Reviewed-on: https://go-review.googlesource.com/55612Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      66c03d39
    • Austin Clements's avatar
      runtime: normalize (*sigctxt).fault() type · 56462d0f
      Austin Clements authored
      (*sigctxt).fault() currently returns either uintptr, uint32, or uint64
      depending on the platform. Make them all return uintptr.
      
      For #10958 (but a nice change on its own).
      
      Change-Id: I7813e779d0edcba112dd47fda776f4ce6e50e227
      Reviewed-on: https://go-review.googlesource.com/68015
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      56462d0f
    • Austin Clements's avatar
      cmd/link: sniff runtime-gdb.py path from runtime/proc.go · ba42b3ff
      Austin Clements authored
      Currently the linker figures out where runtime-gdb.py should be by
      looking for the path to runtime/debug.go. However, debug.go contains
      only a few symbols and can easily get dead-code eliminated entirely,
      especially from simple binaries. When this happens, the resulting
      binary lacks a reference to runtime-gdb.py, so the GDB helpers don't
      get loaded.
      
      Fix this by instead sniffing for runtime/proc.go. This contains
      runtime.main and the scheduler, so it's not going anywhere.
      
      Change-Id: Ie3380c77c840d28614fada68b8c5861625f2aff5
      Reviewed-on: https://go-review.googlesource.com/68019
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAlex Brainman <alex.brainman@gmail.com>
      ba42b3ff
  2. 04 Oct, 2017 15 commits