This will enable test sharding over multiple VMs, to speed trybot answers.
Update #10029
Change-Id: Ie277c6459bc38005e4d6af14d22effeaa0a4667e
Reviewed-on: https://go-review.googlesource.com/6531
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
We now wait until we see the completed prompt from a command before
proceeding. This seems to cut down on a spurious error I have seen
this afternoon.
Change-Id: Ic0a3481d8c265c3c3b4449ec7ac1c2752b85b0b6
Reviewed-on: https://go-review.googlesource.com/6691
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Just a missed case in in the handling of branches.
Fixes#10065
Change-Id: I6be054d30bf1f383c12b4c7626abd5f8ae22b22e
Reviewed-on: https://go-review.googlesource.com/6631
Reviewed-by: Minux Ma <minux@golang.org>
c2go produced accurate but complex constant definitions like
"ElfSymBindLocal = 0 + iota - 67" which break when any constants
are added above them in the list. Change them to explicit values
in separate blocks by class. I wrote a little program (using awk)
to dump the values of the constants:
https://gist.github.com/mwhudson/82f82008279a38ce584e
and confirmed that its output before and after this change is the
same.
Change-Id: Ib4aea4a0d688a16cdcb76af4715d1a97ec0f013c
Reviewed-on: https://go-review.googlesource.com/6581
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
- use Bvec, not *Bvec, and bulk allocate backing store
- use range loops
- put Bvecs in BasicBlock struct instead of indexing into parallel slices
Change-Id: I5cb30f50dccb4d38cc18fae422f7f132c52876be
Reviewed-on: https://go-review.googlesource.com/6602
Reviewed-by: Rob Pike <r@golang.org>
Also change gc.Naddr to return the Addr instead of filling it in.
Change-Id: I98a86705d23bee49626a12a042a4d51cabe290ea
Reviewed-on: https://go-review.googlesource.com/6601
Reviewed-by: Rob Pike <r@golang.org>
The C version of the compiler had just one hash table,
indexed by a (name string, pkg *Pkg) pair.
Because we always know the pkg during a lookup,
replace the one table with a per-Pkg map[string]*Sym.
This also lets us do non-allocating []byte key lookups.
This CL *does* change the generated object files.
In the old code, export data and init calls were emitted
in "hash table order". Now they are emitted in the order
in which they were added to the table.
Change-Id: I5a48d5c9add996dc43ad04a905641d901522de0b
Reviewed-on: https://go-review.googlesource.com/6600
Reviewed-by: Rob Pike <r@golang.org>
Strlit was just a poor excuse for a Go string.
Use a Go string.
In the one case where it was a string-or-nil (Type.Note), use a *string.
Zconv was a poor excuse for %q. Use %q.
The only important part about Zconv's implementation
was that the compiler and linker agreed on the quoting rules.
Now they both use %q instead of having two Zconvs.
This CL *does* change the generated object files, because the
quoted strings end up in symbol names.
For example the string "\r\n" used to be named go.string."\r\n"
and is now go.string."\x0d\n".
Change-Id: I5c0d38e1570ffc495f0db1a20273c9564104a7e8
Reviewed-on: https://go-review.googlesource.com/6519
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
This avoids the argument appearing to escape
(due to the fact that proginfo is always called
via a function pointer).
Change-Id: Ib9351ba18c80fd89e6a1d4f19dea386d4c657337
Reviewed-on: https://go-review.googlesource.com/6518
Reviewed-by: Rob Pike <r@golang.org>
Run rsc.io/grind rev 796d0f2 on C->Go conversions.
This replaces various awkward := initializations with plain var declarations.
Checked bit-for-bit compatibility with toolstash + buildall.
Change-Id: I601101d8177894adb9b0e3fb55dfe0ed4f544716
Reviewed-on: https://go-review.googlesource.com/6517
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Change-Id: If2d303caae933eec61634152e5d83faaba591315
Reviewed-on: https://go-review.googlesource.com/6660
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Mishandled the mask for the arm instructions.
TBR=rsc
Change-Id: Idc596097c0fa61dcacdfb4aca5bc6d0b4fd40eeb
Reviewed-on: https://go-review.googlesource.com/6641
Reviewed-by: Rob Pike <r@golang.org>
Error detection code copied from syscall, where presumably
we actually do it right.
Note that we throw the errno away. The runtime doesn't use it.
Fixes#10052
Change-Id: I8de77dda6bf287276b137646c26b84fa61554ec8
Reviewed-on: https://go-review.googlesource.com/6571
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Aconv is the pretty-printer for instruction opcodes like AMOVQ.
There was one for each architecture.
Make the space of A names have a different region for each architecture,
much as we did for the registers, so a single global Aconv function can
do the work. Each architecture registers its region as a slice of names
at a given offset.
The global names like CALL and JMP are now defined only once.
The A values are used for indexing tables, so make it easy to do the
indexing by making the offset maskable.
Remove a bunch of now-duplicated architecture-specific code.
Change-Id: Ib15647b7145a1c089e21e36543691a19e146b60e
Reviewed-on: https://go-review.googlesource.com/6620
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
grind's goto inliner moved a continue and changed its meaning. Oops.
Change-Id: Ifa2d3e1427036a606a069f356cd9b586ef22ec84
Reviewed-on: https://go-review.googlesource.com/6610
Reviewed-by: Russ Cox <rsc@golang.org>
Roll forward of 54efdc596f. Better testing of the build on
darwin/amd64. There is still some variance between cmd/dist
and the Go tool for build tag handling.
Change-Id: I105669ae7f90c8c89b3839c04b182cff46be8dde
Reviewed-on: https://go-review.googlesource.com/6516
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Previously, if there was a namespace defined on
a a>b tag, the namespace was ignored when
printing the parent elements. This fixes that,
and also fixes the racy behaviour of printerStack.trim
as discussed in https://go-review.googlesource.com/#/c/4152/10 .
Fixes#9796.
Change-Id: I75f97f67c08bbee151d1e0970f8462dd0f4511ef
Reviewed-on: https://go-review.googlesource.com/5910
Reviewed-by: Nigel Tao <nigeltao@golang.org>
No functional changes.
This diff was generated as follows:
* Manually edit cmd/internal/gc/go.go to update types and group variables.
* Manually edit initialization in cmd/internal/gc/align.go--localized s/1/true.
* Manually fix the handling of sign in cmd/internal/gc/walk.go in func bounded (near line 4000).
* Manually update go.y and regenerate y.go.
* Run gofmt -r many times to do the rest, using https://gist.github.com/josharian/0f61dbb2dff81f938e70.
toolstash -cmp on the stdlib comes back green.
Change-Id: I19766ed551714e51b325133e7138818d117b3a9a
Reviewed-on: https://go-review.googlesource.com/6530
Reviewed-by: Russ Cox <rsc@golang.org>
This CL makes the switch walking and typechecking code
more idiomatic and adds documentation.
It also removes all but one global variable.
No functional changes. Confirmed with toolstash -cmp on the stdlib.
Change-Id: Ic3f38acc66e906edd722498839aeb557863639cf
Reviewed-on: https://go-review.googlesource.com/6268
Reviewed-by: Russ Cox <rsc@golang.org>
This change fixes a missing case that a routing address contains an
invalid address family label but it holds a valid length of address
structure.
Also makes test robust.
Fixes#10041.
Change-Id: I2480ba273929e859896697382d1a75b01a116b98
Reviewed-on: https://go-review.googlesource.com/6391
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This reverts commit 54efdc596f.
Broken on darwin.
Change-Id: Ic74275f36d30975263340e2b4045226eae71b16a
Reviewed-on: https://go-review.googlesource.com/6514
Reviewed-by: David Crawshaw <crawshaw@golang.org>
A future change will include an NSTimeZone hook so we can determine
the device's current time zone.
Change-Id: Ia4bd6b955e4cb720c518055541b66ff57a4dd303
Reviewed-on: https://go-review.googlesource.com/6511
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
See golang.org/cl/6511.
Change-Id: I2145a42877ed6b78400f29c2ef18969870dab5c3
Reviewed-on: https://go-review.googlesource.com/6512
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This change removes wrongly added API entries for OpenBSD from the
candidate list.
Change-Id: Ibadfb9003ced6d3338794e4f3072054e65211e4a
Reviewed-on: https://go-review.googlesource.com/6550
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
components.
This fixes decoding JPEG images where the component selector is 0. Such
images are rare, but not impossible.
Change-Id: I6d221bce01cce8cc0440e117543233371782ca22
Reviewed-on: https://go-review.googlesource.com/6421
Reviewed-by: Rob Pike <r@golang.org>
It is unused and should have been deleted when Rconv was made
a global function.
Change-Id: Id745dcee6f0769604cabde04887c6d0c94855405
Reviewed-on: https://go-review.googlesource.com/6521
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This is a followup to http://golang.org/cl/6280.
clang -pie fails to link misc/cgo/test on freebsd-amd64.
Change-Id: I6f9575d6bb579f4d38d70707fb9c92e303e30e6f
Reviewed-on: https://go-review.googlesource.com/6520
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
PIE binaries can be built by the Go compiler in external link mode with
extldflags="-pie". These binaries support ASLR (address space layout
randomization) when executed on systems with appropriate kernel/dynamic
linker support.
This CL enables some cgo tests to run with -pie as a sanity check (in
addition to the other linker flag combinations they already test).
I have tested this functionality more thoroughly by building the full
compiler testsuite (test/...) and standard library tests with -pie
and executing them remotely on ChromeOS devices for all three linux
architectures (linux_amd64, linux_386, and linux_arm).
Change-Id: I3f644a72e94c3341f3360dfee58db5ec3a591e26
Reviewed-on: https://go-review.googlesource.com/6280
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This script is getting very close to complete, and is complex enough
that I'd like to get what's there so far reviewed. With it the builder
is left failing on eight packages. Two of those involve correcting
GOROOT which may need modifications to this script, the others are
either a unix sockets bug I have to hunt down or are caused by lldb
getting stuck on SIGSEGV, a TODO.
Change-Id: I5ff933800167b6764b51ad195da7dcda61d59ff8
Reviewed-on: https://go-review.googlesource.com/6404
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Have the implementations of each architecture declare the one-operand,
destination-writing instructions instead of splitting the information between
there and asm.
Change-Id: I44899435011a4a7a398ed03c0801e9f81cc8c905
Reviewed-on: https://go-review.googlesource.com/6490
Reviewed-by: Russ Cox <rsc@golang.org>
Broke some tests that assume $GORACE is unset (because it never is).
Those tests are arguably wrong, but this is more robust.
Change-Id: Id56daa160c9e7e01f301c1386791e410bbd5deef
Reviewed-on: https://go-review.googlesource.com/6480
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This is a roll forward of 2adc3bd6ef. It occurred to me that we will
want this code on both darwin/arm and darwin/arm64. Removing _arm from
the file name conveniently avoids #10032.
Change-Id: I3a96a3e7020907d9307af8f696e26ad55b2060f0
Reviewed-on: https://go-review.googlesource.com/6460
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Run rsc.io/grind rev a26569f on C->Go conversions.
The new change in grind is the inlining of goto targets.
If code says 'goto x' and the block starting at label x is unreachable
except through that goto and the code can be moved to where
the goto is without changing the meaning of its variable names,
grind does that move. Simlarly, a goto to a plain return statement
turns into that return statement (even if there are other paths to
the return statement).
Combined, these remove many long-distance gotos, which in turn
makes it possible to reduce the scope of more variable declarations.
(Because gotos can't jump across declarations, the gotos were
keeping the declarations from moving.)
Checked bit-for-bit compatibility with toolstash + buildall.
Reduces compiler runtime in html/template by about 12%.
Change-Id: Id727c0bd7763a61aa22f3daa00aeb8fccbc057a3
Reviewed-on: https://go-review.googlesource.com/6472
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
There's no point to having them in every GOOS_GOARCH directory,
since they are neither GOOS- nor GOARCH-specific.
(There used to be other headers that were.)
This makes building for additional toolchains easier:
no need to run make.bash at all.
Fixes#10049.
Change-Id: I710ecaafd7a5c8cad85ccd595ea9cb6058f553b3
Reviewed-on: https://go-review.googlesource.com/6471
Reviewed-by: Rob Pike <r@golang.org>
Replaced by Ctxt.ByteOrder, which uses the standard binary.ByteOrder type.
Change-Id: I06cec0674c153a9ad75ff937f7eb934891effd0b
Reviewed-on: https://go-review.googlesource.com/6450
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Rob Pike <r@golang.org>
This avoids needing every invoked tool to have an identical
computation of the build defaults as the go command does.
It makes sure the tools all know what the go command wants.
Change-Id: I484f15982bfb93c86cde8fc9df7f456505270b87
Reviewed-on: https://go-review.googlesource.com/6409
Reviewed-by: Rob Pike <r@golang.org>
Before this CL, if you are on a darwin/amd64 machine and
cross-compile 9g for a linux/ppc64 machine, when you copy
9g over to that kind of machine and run it, you'll find it thinks
the default object target is darwin/amd64. Not useful.
Make the default target linux/ppc64 in this case. More useful.
Change-Id: I62f2e9cb5f60b3077a922b31cd023a9cb7a6cfda
Reviewed-on: https://go-review.googlesource.com/6407
Reviewed-by: Rob Pike <r@golang.org>
OpenBSD's sigprocmask system call passes the signal mask by value
rather than reference, so vars are unnecessary. Additionally,
declaring "var sigset_all = ^sigset_none" means sigset_all won't be
initialized until runtime_init is called, but the first call to
newosproc happens before then.
I've witnessed Go processes on OpenBSD crash from receiving SIGWINCH
on the newly created OS thread before it finished initializing.
Change-Id: I16995e7e466d5e7e50bcaa7d9490173789a0b4cc
Reviewed-on: https://go-review.googlesource.com/6440
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Move type definitions from chan1.go to chan.go and select.go.
Remove underscores from names.
Make c.buf unsafe.Pointer instead of *uint8.
Change-Id: I75cf8385bdb9f79eb5a7f7ad319495abbacbe942
Reviewed-on: https://go-review.googlesource.com/4900
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
Currently the test fails if run more than once:
$ go test -v -run=TestChildServeCleansUp -cpu=1,1 net/http/fcgi
=== RUN TestChildServeCleansUp
--- PASS: TestChildServeCleansUp (0.00s)
=== RUN TestChildServeCleansUp
fatal error: all goroutines are asleep - deadlock!
The problem is that the writer mutates test input data,
so it is wrong on the second execution.
Change-Id: I4ca54dd2926c6986b2908023ac65e5e65630ed26
Reviewed-on: https://go-review.googlesource.com/6383
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This fixes runtime's TestBreakpoint on ppc64:
the Breakpoint frame was not showing up in the trace.
It seems like f.frame should be either the frame size
including the saved LR (if any) or the frame size
not including the saved LR.
On ppc64, f.frame is the frame size not including the saved LR.
On arm, f.frame is the frame size not including the saved LR,
except when that's -4, f.frame is 0 instead.
The code here in the runtime expects that f.frame is the frame
size including the saved LR.
Since all three disagree and nothing else uses f.frame anymore,
stop using it here too. Use funcspdelta, which tells us the exact
difference between the FP and SP. If it's zero, LR has not been
saved yet, so the one saved for sigpanic should be recorded.
This fixes TestBreakpoint on both ppc64 and ppc64le.
I don't really understand how it ever worked there.
Change-Id: I2d2c580d5c0252cc8471e828980aeedcab76858d
Reviewed-on: https://go-review.googlesource.com/6430
Reviewed-by: Minux Ma <minux@golang.org>