Fix by atom (from CL 89190044), comment and test by me.
Fixes#6823.
LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=0xe2.0x9a.0x9b, adg, golang-codereviews, iant, r
https://golang.org/cl/148180043
If you say 'go get -v' you get extra information when import
paths are not of the expected form.
If you say 'go get -v src/rsc.io/pdf' the message says that
src/rsc.io/pdf does not contain a hostname, which is incorrect.
The problem is that it does not begin with a hostname.
Fixes#7432.
LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/144650043
If you do 'go get -u rsc.io/pdf' and then rsc.io/pdf's redirect
changes to point somewhere else, after this CL a later
'go get -u rsc.io/pdf' will tell you that.
Fixes#8548.
LGTM=iant
R=golang-codereviews, iant
CC=adg, golang-codereviews, n13m3y3r, r
https://golang.org/cl/147170043
The pattern was only working if the checkout had
already been done, but the code was trying to make
it work even the first time. Test and fix.
Fixes#8335.
LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, iant
https://golang.org/cl/146310043
Need to restore the g register. Somehow this line vaporized from
CL 144130043. Also cgo_topofstack -> _cgo_topofstack, that vaporized also.
TBR=rsc
CC=golang-codereviews
https://golang.org/cl/150940044
During a cgo call, the stack can be copied. This copy invalidates
the pointer that cgo has into the return value area. To fix this
problem, pass the address of the location containing the stack
top value (which is in the G struct). For cgo functions which
return values, read the stktop before and after the cgo call to
compute the adjustment necessary to write the return value.
Fixes#8771
LGTM=iant, rsc
R=iant, rsc, khr
CC=golang-codereviews
https://golang.org/cl/144130043
Not sure why they used empty.s and all these other
packages were special cased in cmd/go instead.
Add them to the list.
This avoids problems with net .s files being compiled
with gcc in cgo mode and gcc not supporting // comments
on ARM.
Not a problem with bytes, but be consistent.
The last change fixed the ARM build but broke the Windows build.
Maybe *this* will make everyone happy. Sigh.
TBR=iant
CC=golang-codereviews
https://golang.org/cl/144530046
In cgo mode it gets passed to gcc, and on ARM
it appears that gcc does not support // comments.
TBR=iant
CC=golang-codereviews
https://golang.org/cl/142640043
Fixes linux builds (_vdso); may fix others.
I can at least cross-compile cmd/go for every
implemented system now.
TBR=iant
CC=golang-codereviews
https://golang.org/cl/142630043
Should fix the Windows build. Untested.
on Windows, args are made by src/os/exec_windows.go, not package runtime.
runtime·goargs has if(Windows) return;
The two init funcs in pkg os were conflicting, with the second
overwriting Args back to an empty slice.
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/143540044
Corrections due to new strict type rules for data+bss.
Also disable misc/cgo/cdefstest since you can't compile C code anymore.
TBR=iant
CC=golang-codereviews
https://golang.org/cl/148050044
Previous behavior was undocumented and inconsistent. Now it is documented
and consistent and measures the input size, since that makes more sense
when talking about %q and %x. For %s the change has no effect.
Fixes#8151.
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/144540044
In linker, refuse to write conservative (array of pointers) as the
garbage collection type for any variable in the data/bss GC program.
In the linker, attach the Go type to an already-read C declaration
during dedup. This gives us Go types for C globals for free as long
as the cmd/dist-generated Go code contains the declaration.
(Most runtime C declarations have a corresponding Go declaration.
Both are bss declarations and so the linker dedups them.)
In cmd/dist, add a few more C files to the auto-Go-declaration list
in order to get Go type information for the C declarations into the linker.
In C compiler, mark all non-pointer-containing global declarations
and all string data as NOPTR. This allows them to exist in C files
without any corresponding Go declaration. Count C function pointers
as "non-pointer-containing", since we have no heap-allocated C functions.
In runtime, add NOPTR to the remaining pointer-containing declarations,
none of which refer to Go heap objects.
In runtime, also move os.Args and syscall.envs data into runtime-owned
variables. Otherwise, in programs that do not import os or syscall, the
runtime variables named os.Args and syscall.envs will be missing type
information.
I believe that this CL eliminates the final source of conservative GC scanning
in non-SWIG Go programs, and therefore...
Fixes#909.
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/149770043
Those C files would have been compiled with 6c.
It's close to impossible to use C correctly anymore,
and the C compilers are going away eventually.
Make them unavailable now.
go1.4.txt change in CL 145890046
LGTM=iant
R=iant
CC=golang-codereviews, r
https://golang.org/cl/149720043
Normally, the caller to runtime.entersyscall() must not return before
calling runtime.exitsyscall(), lest g->syscallsp become a dangling
pointer. runtime.cgocallbackg() violates this constraint. To work around
this, save g->syscallsp and g->syscallpc around cgo->Go callbacks, then
restore them after calling runtime.entersyscall(), which restores the
syscall stack frame pointer saved by cgocall. This allows the GC to
correctly trace a goroutine that is currently returning from a
Go->cgo->Go chain.
This also adds a check to proc.c that panics if g->syscallsp is clearly
invalid. It is not 100% foolproof, as it will not catch a case where the
stack was popped then pushed back beyond g->syscallsp, but it does catch
the present cgo issue and makes existing tests fail without the bugfix.
Fixes#7978.
LGTM=dvyukov, rsc
R=golang-codereviews, dvyukov, minux, bradfitz, iant, gobot, rsc
CC=golang-codereviews, rsc
https://golang.org/cl/131910043
There were at least two bugs:
1) It would overwrite a non-archive.
2) It would truncate a non-archive and then fail.
In general the file handling was too clever to be correct.
Make it more straightforward, doing the creation
separately from archive management.
Fixes#8369.
LGTM=adg, iant
R=golang-codereviews, adg, iant
CC=golang-codereviews
https://golang.org/cl/147010046
Was just a missing case (literally) in the type checker.
Fixes#8473.
LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/142460043