Assignment of a computed uint64 value to an
address derived with a function call was executing
the call after computing the value, which trashed
the value (held in registers).
long long *f(void) { return 0; }
void g(int x, int y) {
*f() = (long long)x | (long long)y<<32;
}
Before:
(x.c:3) TEXT g+0(SB),(gok(71))
...
(x.c:4) ORL AX,DX
(x.c:4) ORL CX,BX
(x.c:4) CALL ,f+0(SB)
(x.c:4) MOVL DX,(AX)
(x.c:4) MOVL BX,4(AX)
After:
(x.c:3) TEXT g+0(SB),(gok(71))
(x.c:4) CALL ,f+0(SB)
...
(x.c:4) ORL CX,BX
(x.c:4) ORL DX,BP
(x.c:4) MOVL BX,(AX)
(x.c:4) MOVL BP,4(AX)
Fixes#3501.
R=ken2
CC=golang-dev
https://golang.org/cl/5998043
On windows Mercurial installed with easy_install typically creates
an hg.bat batch file in Python Scripts directory, which cannot be used
with CreateProcess unless full path is specified. Work around by
launching hg via cmd.exe /c.
Additionally, fix a rare FormatMessageW crash.
Fixes#3093.
R=golang-dev, rsc, alex.brainman, aram, jdpoirier, mattn.jp
CC=golang-dev
https://golang.org/cl/5937043
Before, "go get -v foo/bar" was assuming "foo" was a hostname
and trying to perform discovery on it. Now, require a dot in
the first path component (the hostname).
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5981057
"go1" dominates. Delete the text about weekly and release.
We can revisit this once the situation changes.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5969043
Another attempt at https://golang.org/cl/5754088.
Before, we only consulted $GOBIN for source code
found in $GOROOT, but that's confusing to explain
and less useful. The new behavior lets users set
GOBIN=$HOME/bin and have all go-compiled binaries
installed there.
Tested a few cases in test.bash.
Ran all.bash with and without $GOBIN and it works.
Even so, I expect it to break the builders,
like it did last time, we can debug from there.
Fixes#3269 (again).
Fixes#3396.
Fixes#3397.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5927051
Issue 3207 was caused by setting GOPATH=GOROOT.
This is a common mistake, so diagnose it at command start
and also correct the bug that it caused in get (downloading
to GOROOT/src/foo instead of GOROOT/src/pkg/foo).
Issue 3268 was caused by recognizing 'packages' that
had installed binaries but no source. This behavior is not
documented and causes trouble, so remove it. We can
revisit the concept of binary-only packages after Go 1.
Fixes#3207.
Fixes#3268.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5930044
In a browser with many open tabs, the tab titles become short
and uninformative because they all start with the same prefix
("Package ", "Directory ", etc.).
Permit use of shorter tab titles that start with the relevant
information first.
Fixes#3365.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5865056
The two optimizations for small structs and arrays
were missing the implicit cast from ideal bool.
Fixes#3351.
R=rsc, lvd
CC=golang-dev
https://golang.org/cl/5848062
Adds new file api/go1.txt, locking down the current API.
Any changes to the API will need to update that file.
run.bash (but not make.bash, or Windows) will check for
accidental API changes.
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5820070
This makes the last error-reporting CL a bit less
aggressive. errPrintedOutput is a sentinel value
that should not be wrapped.
R=gri
CC=golang-dev
https://golang.org/cl/5845052
Fixes part of issue 3253.
We still need to support scattered relocations though.
R=golang-dev, bsiegert, rsc, iant
CC=golang-dev
https://golang.org/cl/5822050
windows cmd.exe can't show utf-8 correctly basically.
chcp 65001 may make it show, but most people don't have fonts which can
show it.
R=golang-dev, rsc, adg, gri, r
CC=golang-dev
https://golang.org/cl/5820060
A "gccgoprefix" flag is added and used by the go tool,
to mirror the -fgo-prefix flag for gccgo, whose value
is required to know how to access functions from C.
Trying to export Go methods or unexported Go functions
will not work.
Also fix go test on "main" packages.
Updates #2313.
Fixes#3262.
R=mpimenov, rsc, iant
CC=golang-dev
https://golang.org/cl/5797046
Fixes#3324.
Robert suggested not reporting errors until the end of the output.
which I'd also like to do, but errPrintedOutput makes that a bigger
change than I want to do before Go 1. This change should at least
remove the confusion we had.
# Building packages and commands for linux/amd64.
runtime
errors
sync/atomic
unicode
unicode/utf8
math
sync
unicode/utf16
crypto/subtle
io
syscall
hash
crypto
crypto/md5
hash/crc32
crypto/cipher
crypto/hmac
crypto/sha1
go install unicode: copying /tmp/go-build816525784/unicode.a to /home/rsc/g/go/pkg/linux_amd64/unicode.a: short write
hash/adler32
container/list
container/ring
...
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5837054
A node spans multiple lines if the line difference
between start and end point is > 0 (rather than > 1).
Fixes some odd cases introduced by CL 5706055;
pointed out by dsymonds.
Added corresponding test case. The other change
in the .golden file reverts to the status before
the CL mentioned above and is correct.
gofmt -w src misc changes godoc.go back to where
it was before the CL mentioned above.
Fixes#3304.
R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5820044
Windows has paths like C:/Users/ADMIN~1. Also, it so happens
that go/parser allows ~ in import paths. So does the spec.
Fixes the build too.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5777073
For URLs ending with /, the handler did not work, trying to append
".xml" to the path.
For instance, the "Share Memory by Communicating" returned the
following error:
open /Users/francisco.souza/lib/go/doc/codewalk/sharemem/.xml: no such file or directory
R=adg, minux.ma
CC=golang-dev
https://golang.org/cl/5797065
broke builders
««« original CL description
cmd/go: respect $GOBIN always
Before, we only consulted $GOBIN for source code
found in $GOROOT, but that's confusing to explain
and less useful. The new behavior lets users set
GOBIN=$HOME/bin and have all go-compiled binaries
installed there.
Fixes#3269.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5754088
»»»
TBR=bradfitz
CC=golang-dev
https://golang.org/cl/5794065
Before, we only consulted $GOBIN for source code
found in $GOROOT, but that's confusing to explain
and less useful. The new behavior lets users set
GOBIN=$HOME/bin and have all go-compiled binaries
installed there.
Fixes#3269.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5754088
Undo CL 5783076 and apply correct fix.
The /doc hack is wrong. The code to handle this case was
already there and just needs a simple fix:
// We didn't find any directories containing Go files.
// If some directory returned successfully, use that.
- if len(all) == 0 && first != nil {
+ if !haveGo {
for _, d := range first {
haveName[d.Name()] = true
all = append(all, d)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5783079
They were necessary to produce a canonical script
when we checked in build scripts, but now they're just
getting in the way.
Fixes#3279.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5796068
The generated syscall files for Windows are still breaking "go tool api"
(unknown function []byte); I'll look at fixing that separately.
Fixes#3285.
R=bradfitz
CC=golang-dev
https://golang.org/cl/5777062
1) The -D argument should always be a pseudo-import path,
like _/Users/rsc/foo/bar, never a standard import path,
because we want local imports to always resolve to pseudo-paths.
2) Disallow local imports in non-local packages. Otherwise
everything works but you get two copies of a package
(the real one and the "local" one) in your binary.
R=golang-dev, bradfitz, yiyu.jgl
CC=golang-dev
https://golang.org/cl/5787055
So that we don't duplicate knowledge about which OS/ARCH combination
supports cgo.
Also updated src/run.bash and src/sudo.bash to use 'go env'.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5792055
1. consistent usage section (go tool xxx)
2. reformat cmd/ld document with minor correction
document which -H flags are valid on which ld
document -d flag can't be used on Windows.
document -Hwindowsgui
R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5782043
Before:
$ go run x.go
signal 11 (core dumped)
$
After:
$ go run x.go
runtime: cgo callback on thread not created by Go.
signal 11 (core dumped)
$
For issue 3068.
Not a fix, but as much of a fix as we can do before Go 1.
R=golang-dev, rogpeppe, gri
CC=golang-dev
https://golang.org/cl/5781047
doc: convert to use godoc built-in templates
tmpltohtml is gone, to avoid having a second copy of the code.
Instead, godoc -url /doc/go1.html will print the actual HTML
served for that URL. "make" will generate files named go1.rawhtml
etc, which can be fed through tidy.
It can be hard to tell from the codereview diffs, but all the
tmpl files have been renamed to be html files and then
have "Template": true added.
R=golang-dev, adg, r, gri
CC=golang-dev
https://golang.org/cl/5782046
Was missing recompilation of packages imported only
by external test packages (package foo_test), primarily
because Root was not set, so those packages looked like
they were from a different Go tree, so they were not
recompiled if they already existed.
Also clean things up so that only one call to computeStale
is needed.
Fixes#3238.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5786048
The spec is looser than the current implementation.
The spec edit was made in CL 4444050 (May 2011)
but I never implemented it.
Fixes#3244.
R=ken2
CC=golang-dev
https://golang.org/cl/5785049
.syso files are system objects copied directly
into the package archive.
Fixes#1552.
R=alex.brainman, iant, r, minux.ma, remyoudompheng
CC=golang-dev
https://golang.org/cl/5778043
The compiler must be changed with the Set method
so that the buildToolchain gets updated too.
Fixes#3231.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5768044
$ go run
go run: no go files listed
$ go run ../../pkg/math/bits.go
go run: cannot run non-main package
$
Fixes#3168.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5755064
Either documentation or implementation
of go run's flags is wrong currently.
This change assumes the documentation
to be right.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5752054
This CL permits using arbitrary, non-VCS-qualified URLs as
aliases for fully VCS-qualified and/or well-known code hosting
sites.
Example 1) A VCS-qualified URL can now be shorter.
Before:
$ go get camlistore.org/r/p/camlistore.git/pkg/blobref
After:
$ go get camlistore.org/pkg/blobref
Example 2) A custom domain can be used as the import,
referencing a well-known code hosting site.
Before:
$ go get github.com/bradfitz/sonden
After:
$ go get bradfitz.com/pkg/sonden
The mechanism used is a <meta> tag in the HTML document
retrieved from fetching:
https://<import>?go-get=1 (preferred)
http://<import>?go-get=1 (fallback)
The meta tag should look like:
<meta name="go-import" content="import-alias-prefix vcs full-repo-root">
The full-repo-root must be a full URL root to a repository containing
a scheme and *not* containing a ".vcs" qualifier.
The vcs is one of "git", "hg", "svn", etc.
The import-alias-prefix must be a prefix or exact match of the
package being fetched with "go get".
If there are multiple meta tags, only the one with a prefix
matching the import path is used. It is an error if multiple
go-import values match the import prefix.
If the import-alias-prefix is not an exact match for the import,
another HTTP fetch is performed, at the declared root (which does
*not* need to be the domain's root).
For example, assuming that "camlistore.org/pkg/blobref" declares
in its HTML head:
<meta name="go-import" content="camlistore.org git https://camlistore.org/r/p/camlistore" />
... then:
$ go get camlistore.org/pkg/blobref
... looks at the following URLs:
https://camlistore.org/pkg/blobref?go-get=1http://camlistore.org/pkg/blobref?go-get=1https://camlistore.org/?go-get=1http://camlistore.org/?go-get=1
Ultimately it finds, at the root (camlistore.org/), the same go-import:
<meta name="go-import" content="camlistore.org git https://camlistore.org/r/p/camlistore" />
... and proceeds to trust it, checking out git //camlistore.org/r/p/camlistore at
the import path of "camlistore.org" on disk.
Fixes#3099
R=r, rsc, gary.burd, eikeon, untheoretic, n13m3y3r, rsc
CC=golang-dev
https://golang.org/cl/5660051
GOROOT_FINAL is a build parameter that means "eventually
the Go tree will be installed here". Make the file name information
match that eventual location.
Fixes#3180.
R=ken, ken
CC=golang-dev
https://golang.org/cl/5742043
The motivation for this CL is to support $GOPATH well.
Since we already have a FileSystem interface, implement a
Plan 9-style name space. Bind each of the $GOPATH src
directories onto the $GOROOT src/pkg directory: now
everything is laid out exactly like a normal $GOROOT and
needs very little special case code.
The filter files are no longer used (by us), so I think they
can just be deleted. Similarly, the Mapping code and the
FileSystem interface were two different ways to accomplish
the same end, so delete the Mapping code.
Within the implementation, since FileSystem is defined to be
slash-separated, use package path consistently, leaving
path/filepath only for manipulating operating system paths.
I kept the -path flag, but I think it can be deleted too.
Fixes#2234.
Fixes#3046.
R=gri, r, r, rsc
CC=golang-dev
https://golang.org/cl/5711058
I tried before to make relative imports work by simply
invoking the compiler in the right directory, so that
an import of ./foo could be resolved by ./foo.a.
This required creating a separate tree of package binaries
that included the full path to the source directory, so that
/home/gopher/bar.go would be compiled in
tmpdir/work/local/home/gopher and perhaps find
a ./foo.a in that directory.
This model breaks on Windows because : appears in path
names but cannot be used in subdirectory names, and I
missed one or two places where it needed to be removed.
The model breaks more fundamentally when compiling
a test of a package that lives outside the Go path, because
we effectively use a ./ import in the generated testmain,
but there we want to be able to resolve the ./ import
of the test package to one directory and all the other ./
imports to a different directory. Piggybacking on the compiler's
current working directory is then no longer possible.
Instead, introduce a new compiler option -D prefix that
makes the compiler turn a ./ import into prefix+that,
so that import "./foo" with -D a/b/c turns into import
"a/b/c/foo". Then we can invent a package hierarchy
"_/" with subdirectories named for file system paths:
import "./foo" in the directory /home/gopher becomes
import "_/home/gopher/foo", and since that final path
is just an ordinary import now, all the ordinary processing
works, without special cases.
We will have to change the name of the hierarchy if we
ever decide to introduce a standard package with import
path "_", but that seems unlikely, and the detail is known
only in temporary packages that get thrown away at the
end of a build.
Fixes#3169.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5732045
Fixes a problem Rob is having with goprotobuf.
Cannot add a test because the same case is more broken
when using ./ imports. That still needs to be fixed,
and is one aspect of issue 3169.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5725043
Also remove useless "install" argument to pkgpath now that go/build
defines package install locations.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5714059
* Install tools into tool dir always
(Fixes issue 3049. Fixes issue 2868. Fixes issue 2925.)
* Make packages depend on compiler, linker (Fixes issue 3036.)
* Do not recompile packages across roots (Fixes issue 3149.)
* Allow use of binary-only packages (Fixes issue 2775.)
* Avoid duplicate cgo dependencies (Fixes issue 3001.)
* Show less in go get -x. (Fixes issue 2926.)
* Do not force repo root for existing checkout (Fixes issue 2969.)
* Show full syntax error list always (Fixes issue 2811.)
* Clean arguments before processing (Fixes issue 3034.)
* Add flags for compiler, linker arguments (Fixes issue 2996.)
* Pass flags in make.bash (Fixes issue 3091.)
* Unify build flags, defined in one place.
* Clean up error messages (Fixes issue 3075. Fixes issue 2923.)
* Support local import paths (Fixes issue 3118.)
* Allow top-level package outside $GOPATH (Fixes issue 3009.)
In addition to these fixes, all commands now take a list of
go files as a way to specify a single package, just as go build and
go run always have. This means you can:
go list -json x.go
go fix x.go
go vet x.go
go test x_test.go
Preliminary tests in test.bash.
Mainly testing things that the ordinary build does not.
I don't mind if the script doesn't run on Windows.
I expect that gccgo support is now broken, and I hope that
people will feel free to file issues and/or send CLs to fix it. :-)
R=golang-dev, dsymonds, r, rogpeppe
CC=golang-dev
https://golang.org/cl/5708054
This is an API change, but one I have been promising would
happen when it was clear what the go command needed.
This is basically a complete replacement of what used to be here.
build.Tree is gone.
build.DirInfo is expanded and now called build.Package.
build.FindTree is now build.Import(package, srcDir, build.FindOnly).
The returned *Package contains information that FindTree returned,
but applicable only to a single package.
build.ScanDir is now build.ImportDir.
build.FindTree+build.ScanDir is now build.Import.
The new Import API allows specifying the source directory,
in order to resolve local imports (import "./foo") and also allows
scanning of packages outside of $GOPATH. They will come back
with less information in the Package, but they will still work.
The old go/build API exposed both too much and too little.
This API is much closer to what the go command needs,
and it works well enough in the other places where it is
used. Path is gone, so it can no longer be misused. (Fixes issue 2749.)
This CL updates clients of go/build other than the go command.
The go command changes are in a separate CL, to be submitted
at the same time.
R=golang-dev, r, alex.brainman, adg
CC=golang-dev
https://golang.org/cl/5713043
The two string comparison optimizations were
missing the implicit cast from ideal bool.
Fixes#3119.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5696071
They are broken and hard to make work.
They have never worked: if you import "/tmp/x"
from "/home/rsc/p.c" then the compiler rewrites
this into import "/home/rsc/tmp/x", which is
clearly wrong.
Also we just disallowed the : character in import
paths, so import "c:/foo" is already not allowed.
Finally, in order to support absolute paths well in
a build tool we'd have to provide a mechanism to
instruct the compiler to resolve absolute imports
by looking in some other tree (where the binaries live)
and provide a mapping from absolute path to location
in that tree. This CL avoids adding that complexity.
This is not part of the language spec (and should not be),
so no spec change is needed.
If we need to make them work later, we can.
R=ken2
CC=golang-dev
https://golang.org/cl/5712043
This CL mostly deletes code.
Using existing position information is
just as good to determine if a new section
is needed; no need to track exact multi-
line information. Eliminates the need to
carry around a multiLine parameter with
practically every function.
Applied gofmt -w src misc resulting in only
a minor change to godoc.go. In return, a couple
of test cases are now formatted better.
Not Go1-required, but nice-to-have as it will
simplify fixes going forward.
R=rsc
CC=golang-dev
https://golang.org/cl/5706055
Work around profiling kernel bug with signal masks.
Still broken on 64-bit Snow Leopard kernel,
but I think we can ignore that one and let people
upgrade to Lion.
Add new trivial tools addr2line and objdump to take
the place of the GNU tools of the same name, since
those are not installed on OS X.
Adapt pprof to invoke 'go tool addr2line' and
'go tool objdump' if the system tools do not exist.
Clean up disassembly of base register on amd64.
Fixes#2008.
R=golang-dev, bradfitz, mikioh.mikioh, r, iant
CC=golang-dev
https://golang.org/cl/5697066
If stdout and stderr are indeed the same file (not a tty), which is
often the case, fully-buffered stdout will make it harder to see
progresses, for example, ./make.bash 2>&1 | tee log
R=r, rsc
CC=golang-dev
https://golang.org/cl/5700070
I've elected to omit escaping the output of Marshalers for now.
I haven't thought through the implications of that;
I suspect that double escaping might be the undoing of that idea.
Fixes#3127.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5694098
The main change is simple: Both the Directory and DirEntry
struct have an extra field 'HasPkg' indicating whether the
directory contains any package files. The remaining changes
are more comments and adjustments to the template files.
Fixes#3121.
R=golang-dev, bradfitz, sameer
CC=golang-dev
https://golang.org/cl/5699072
Otherwise
go list -f "{{if .Stale}}{{.ImportPath}}{{end}}" all
and similar commands can print pages of empty lines.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5696058
Also allow multiple invalid import statements in a
single file.
Fixes#3021. The changes to go/parser and the
language specifcation have already been committed.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/5672084
We were not aligning the code size,
so read-only data, which follows in the same
segment, could be arbitrarily misaligned.
Fixes#2506.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5693055
Avoids global array buffer overflows if they are
indexed using some of the values between NTYPE
and NALLTYPE. It is entirely likely that not all of these
are necessary, but this is the C compiler and not worth
worrying much about. This change takes up only a
few more bytes of memory and makes the behavior
deterministic.
Fixes#3078.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5693052
Alternatively, we could expand the ewidth array
in [568]c/txt.c to have NALLTYPES elements and
give all types above NTYPE a width of -1.
I don't think it's worth it since TDOT and TOLD
are the only two type values above NTYPE that
are passed to typ:
$ /tmp/cctypes
cc/dcl.c:683: t->down = typ(TOLD, T);
cc/dcl.c:919: return typ(TDOT, T);
$
Fixes#3063.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5694047
Although Intel considers the three-argument form of IMUL to be a
variant of IMUL, I couldn't make 6l able to differentiate it without
huge changes, so I called it IMUL3.
R=rsc
CC=golang-dev
https://golang.org/cl/5686055
Using reg as the flag word was unfortunate, since the
default value is not 0 but NREG (==16), which happens
to be the bit NOPTR now. Clear it.
If I say this will fix the build, it won't.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5690072
dodata will convert to SNOPTRDATA if appropriate.
Should fix arm build (hope springs eternal).
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5687074
This is a manual undo of CL 5674098.
It does not implement the even less strict spec
that we just agreed on, but it gets us back where
we were at the last weekly.
R=ken2
CC=golang-dev
https://golang.org/cl/5683069
cc: add #pragma textflag to set it
runtime: mark mheap to go into noptr-bss.
remove special case in garbage collector
Remove the ARM from.flag field created by CL 5687044.
The DUPOK flag was already in p->reg, so keep using that.
Otherwise test/nilptr.go creates a very large binary.
Should fix the arm build.
Diagnosed by minux.ma; replacement for CL 5690044.
R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/5686060
When installing pprof into the tools directory, it needs to
have execute permissions on unix-like systems.
Fixes issues 3077.
R=golang-dev, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/5675095
Also cleanup the resolveName method.
Fixes failure on go/build declaration:
var ToolDir = filepath.Join(...)
R=golang-dev, bradfitz
CC=golang-dev, remy
https://golang.org/cl/5681043
Such variables would be put at 0(SP), leading to serious
corruptions at zero initialization.
Fixes#3084.
R=golang-dev, r
CC=golang-dev, remy
https://golang.org/cl/5683052
Use methods for key questions.
Provide access to non-portable pieces through portable methods.
Windows and Plan 9 updated.
R=golang-dev, bradfitz, bradfitz, r, dsymonds, rsc, iant, iant
CC=golang-dev
https://golang.org/cl/5673077
The alternative is to record enough information that the
trap handler know which registers contain cached globals
and can flush the registers back to their original locations.
That's significantly more work.
This only affects globals that have been written to.
Code that reads from a global should continue to registerize
as well as before.
Fixes#1304.
R=ken2
CC=golang-dev
https://golang.org/cl/5687046
They are portability problems and the options are almost always zero in practice anyway.
R=golang-dev, dsymonds, r, bradfitz
CC=golang-dev
https://golang.org/cl/5688046
ARM doesn't have the concept of scale, so I renamed the field
Addr.scale to Addr.flag to better reflect its true meaning.
R=rsc
CC=golang-dev
https://golang.org/cl/5687044
* disallow embedding of C type (Fixes issue 2552)
* detect 0-length array (Fixes issue 2806)
* use typedefs when possible, to avoid attribute((unavailable)) (Fixes issue 2888)
* print Go types constructed from C types using original C types (Fixes issue 2612)
This fix changes _cgo_export.h to repeat the preamble from import "C".
Otherwise the fix to issue 2612 is impossible, since it cannot refer to
types that have not been defined. If people are using //export and
putting non-header information in the preamble, they will need to
refactor their code.
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5672080
The garbage collector can avoid scanning this section, with
reduces collection time as well as the number of false positives.
Helps a little bit with issue 909, but certainly does not solve it.
R=ken2
CC=golang-dev
https://golang.org/cl/5671099
1, strip last path separator from $GOROOT
The user might define GOROOT=/path/to/go/, but then the dir
check in defaulttarg() will always complain the current dir
is not within $GOROOT/src/.
2, resolve symlinks in the default goroot
Or if getcwd() returns a fully-resolved path, the check in
defaulttarg() will always fail.
R=rsc
CC=golang-dev
https://golang.org/cl/5649073
Convert cryptotype to general go1rename fix.
Add os.Exec -> syscall.Exec fix along with new
URL fixes.
Fixes#2946.
R=golang-dev, r, dsymonds
CC=golang-dev
https://golang.org/cl/5672072
Clang 3.1 has more warnings enabled by default than GCC.
Combined with -Werror, they cause the build to fail
unnecessarily. if the name of our compiler ends in "clang",
add the necessary extra -Wno options. Ideally we would add
these flags unconditionally, as GCC is supposed to ignore
unknown -Wno flags, but apple's llvm-gcc doesn't.
Fixes#2878.
R=rsc, dave
CC=golang-dev
https://golang.org/cl/5673055
It depended on old behavior of functions in structs.
Solved by adding a boolean method to check .Run != nil.
R=golang-dev, adg, r, rsc
CC=golang-dev
https://golang.org/cl/5674062
go/doc: move Examples to go/ast
cmd/go: use go/doc to read examples
src/pkg: update examples to use new convention
This is to make whole file examples more readable. When presented as a
complete function, preceding an Example with its output is confusing.
The new convention is to put the expected output in the final comment
of the example, preceded by the string "output:" (case insensitive).
An idiomatic example looks like this:
// This example demonstrates Foo by doing bar and quux.
func ExampleFoo() {
// example body that does bar and quux
// Output:
// example output
}
R=rsc, gri
CC=golang-dev
https://golang.org/cl/5673053
Also: Simplified handling of selector expressions. As a result, complicated
multi-line expressions containing selectors and calls/indices with arguments
broken accross lines don't get indented the same way as before, but the change
is minimal (see tests) and there's no such code in the std library. It seems
a worthwhile compromise given the much simpler code.
Applied gofmt -w $GOROOT/src $GOROOT/misc .
Fixes#1847.
R=rsc
CC=golang-dev
https://golang.org/cl/5675062
Makes it possible to run
GOARCH=amd64 make.bash
GOARCH=386 make.bash --no-clean
to avoid deleting some of the work done by the first one.
R=golang-dev
CC=golang-dev
https://golang.org/cl/5673056
- if a package path leads to subdirectories only,
show command instead, if any
- to force documentation for a command, use the
cmd/ prefix, as in: godoc cmd/go
(note that for the go command, the prefix is
not required since there is no actual go library
package at the moment)
Fixes#3012.
R=rsc
CC=golang-dev
https://golang.org/cl/5665049
* add -work option to save temporary files (Fixes issue 2980)
* fix go test -i to work with cgo packages (Fixes issue 2936)
* do not overwrite/remove empty directories or non-object
files during build (Fixes issue 2829)
* remove package main vs package non-main heuristic:
a directory must contain only one package (Fixes issue 2864)
* to make last item workable, ignore +build tags for files
named on command line: go build x.go builds x.go even
if it says // +build ignore.
* add // +build ignore tags to helper programs
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5674043
This CL makes it possible to run make.bash with
GOOS and GOARCH set to something other than
the native host GOOS and GOARCH.
As part of the CL, the tool directory moves from bin/tool/
to pkg/tool/goos_goarch where goos and goarch are
the values for the host system (running the build), not
the target. pkg/ is not technically appropriate, but C objects
are there now tool (pkg/obj/) so this puts all the generated
binaries in one place (rm -rf $GOROOT/pkg cleans everything).
Including goos_goarch in the name allows different systems
to share a single $GOROOT on a shared file system.
Fixes#2920.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5645093
Makes files like src/pkg/syscall/ztypes_linux_amd64.go easier to read.
(The copy that is checked in predates the //line output mode,
so this also preserves the status quo.)
R=golang-dev, iant, gri
CC=golang-dev
https://golang.org/cl/5655068
Also update build to be able to run mkbuiltin again.
The export form has changed a little, so builtin.c has
more diffs than unsafe.go.
In CL 5650069, I just edited the documentation, a rarely
successful method of change.
R=ken2
CC=golang-dev
https://golang.org/cl/5662043
This is not the finished product,
but a good checkpoint from which to
proceed with further development.
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5571061
8g/cgen.c
print format type mismatch
8l/asm.c
resoff set and not used
gc/pgen.c
misleading comparison INT > 0x80000000
gc/reflect.c
dalgsym must be static to match forward declaration
gc/subr.c
assumed_equal set and not used
hashmem's second argument is not used
gc/walk.c
duplicated (unreachable) code
R=rsc
CC=golang-dev
https://golang.org/cl/5651079
Fixes#2776.
There was a previous attempt at CL 5592043 but that
seems to have stalled. This one is simpler, and more up to date
(correct handling of spdy, for example).
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5645091
unsafe: delete Typeof, Reflect, Unreflect, New, NewArray
Part of issue 2955 and issue 2968.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5650069
I thought that -timeout was per-test, but it is for the
whole program execution, so cmd/go can adjust its timer
(also for whole program execution) accordingly.
Fixes#2993.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5650070
If the values being compared have different concrete types,
then they're clearly unequal without needing to invoke the
actual interface compare routine. This speeds tests for
specific values, like if err == io.EOF, by about 3x.
benchmark old ns/op new ns/op delta
BenchmarkIfaceCmp100 843 287 -65.95%
BenchmarkIfaceCmpNil100 184 182 -1.09%
Fixes#2591.
R=ken2
CC=golang-dev
https://golang.org/cl/5651073