All packages now use the -pack option to the compiler.
For a pure Go package, that's enough.
For a package with additional C and assembly files, the extra
archive entries can be added directly (by concatenation)
instead of by invoking go tool pack.
These changes make it possible to rewrite cmd/pack in Go.
R=iant, r
CC=golang-dev
https://golang.org/cl/42910043
All packages now use the -pack option to the compiler.
For a pure Go package, that's enough.
For a package with additional C and assembly files, the extra
archive entries can be added directly (by concatenation)
instead of by invoking go tool pack.
These changes make it possible to rewrite cmd/pack in Go.
R=iant, r
CC=golang-dev
https://golang.org/cl/42890043
The -pack flag causes 5g, 6g, 8g to write a Go archive directly,
instead of requiring the use of 'go tool pack' to convert the .5/.6/.8
to .a format.
Writing directly avoids the copy and also avoids having the
export data stored twice in the archive (once in __.PKGDEF,
once in .5/.6/.8).
A separate CL will enable the use of this flag by cmd/go.
Other build systems that do not know about -pack will be unaffected.
The changes to cmd/ld handle a minor simplification to the format:
an unused section is removed.
R=iant, r
CC=golang-dev
https://golang.org/cl/42880043
Hash tables currently store an evacuated bit in the low bit
of the overflow pointer. That's probably not sustainable in the
long term as GC wants correctly typed & aligned pointers. It is
also a pain to move any of this code to Go in the current state.
This change moves the evacuated bit into the tophash entries.
Performance change is negligable.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/14412043
gccgo has problems using reflect.Call with functions that take and
return structs with no members. Prior to fixing that problem there, I
thought it sensible to add some tests of this situation.
Update #6761
First contribution to Go, apologies in advance if I'm doing it wrong.
R=golang-dev, dave, minux.ma, iant, khr, bradfitz
CC=golang-dev
https://golang.org/cl/26570046
And document it explicitly, even though it already said
it wasn't guaranteed.
Fixes#6857
R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/43580043
os: don't ignore LStat errors in Readdir. If it's ENOENT,
on the second pass, just treat it as missing. If it's another
error, it's real.
path/filepath: use ReaddirNames instead of Readdir in Walk,
in order to obey the documented WalkFunc contract of returning
each walked item's LStat error, if any.
Fixes#6656Fixes#6680
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/43530043
They cause too much bloat in the internals as we find ourselves adding
special case code for all the cross-connections. It's better to use RGBA
and just max out the alpha. We lose a little memory but reduce the number
of special cases the encoders, decoders, and drawers need to provide.
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/42910045
Currently it fails as:
go tool dist: $GOROOT is not set correctly or not exported
GOROOT=c:\go
c:\go\include\u.h does not exist
Fail.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42550044
On the Chinese Windows XP system that I'm using, GetTimeZoneInformation returns a struct containing "中国标准时间" (China Standard Time in Chinese) in both StandardName and DaylightName (which is correct, because China does not use DST). However, in registry, under key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time, the key Std and Dlt contain "中国标准时间" (China Standard Time in Chinese) and "中国夏季时间" (China Summer Time in Chinese) respectively. This means that time.toEnglishName() cannot determine the abbreviation for the local timezone (CST) and causes test failures (time.Local is empty)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/43210043
Instead of writing out 0..n and then reading it
back, just use i when it is needed.
Wikipedia calls this the "inside-out" implementation:
http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
This yields identical values to the previous
implementation, given the same seed. (Note that the
output from Example_rand is unchanged.)
2.8 GHz Intel Core i7, results very stable:
benchmark old ns/op new ns/op delta
BenchmarkPerm3 138 136 -1.45%
BenchmarkPerm30 825 803 -2.67%
Stock Raspberry Pi, minimum improvement out of three runs:
benchmark old ns/op new ns/op delta
BenchmarkPerm3 5774 5664 -1.91%
BenchmarkPerm30 32582 29381 -9.82%
R=golang-dev, dave, mtj, adg
CC=golang-dev
https://golang.org/cl/21030043
This particular test would never pass unless you had GOROOT set in your
environment. This changes makes the test use the baked-in GOROOT, as it
does with GOOS and GOARCH.
R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/43080043
The previous coding did not correctly check for errors from the driver's
Next() or Close(), which could mask genuine errors from the database, as
witnessed in issue #6651.
Even after this change errors from Close() will be ignored if the query
returned no rows (as Rows.Next will have closed the handle already), but it
is a lot easier for the drivers to guard against that.
Fixes#6651.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/41590043
Protocol keywords are case-insensitive,
but the Ndb database is case-sensitive.
Also use the generic net protocol instead
of tcp in lookupHost.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/40600047
Use an input which better shows that behaviour of the function. Only leading
and trailing runes are trimed, not intermediate ones.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42390043
The immediate goal is to support the new object file format,
which libmach (nm's support library) does not understand.
Rather than add code to libmach or reengineer liblink to
support this new use, just write it in Go.
The C version of nm reads the Plan 9 symbol table stored in
Go binaries, now otherwise unused.
This reimplementation uses the standard symbol table for
the corresponding file format instead, bringing us one step
closer to removing the Plan 9 symbol table from Go binaries.
Tell cmd/dist not to build cmd/nm anymore.
Tell cmd/go to install cmd/nm in the tool directory.
R=golang-dev, r, iant, alex.brainman
CC=golang-dev
https://golang.org/cl/40600043
- new object file reader/writer (liblink/objfile.c)
- remove old object file writing routines
- add pcdata iterator
- remove all trace of "line number stack" and "path fragments" from
object files, linker (!!!)
- dwarf now writes a single "compilation unit" instead of one per package
This CL disables the check for chains of no-split functions that
could overflow the stack red zone. A future CL will attack the problem
of reenabling that check (issue 6931).
This CL is just the liblink and cmd/ld changes.
There are minor associated adjustments in CL 37030045.
Each depends on the other.
R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/39680043
- add buffered stdout to all tools and provide to link ctxt.
- avoid extra \n before ! in .6 files written by assemblers
(makes them match the C compilers).
- use linkwriteobj instead of linkouthist+linkwritefuncs.
- in assemblers and C compilers, record pc explicitly in Prog,
for use by liblink.
- in C compilers, preserve jump target links.
- in Go compilers (gsubr.c) attach gotype directly to
corresponding LSym* instead of rederiving from instruction stream.
- in Go compilers, emit just one definition for runtime.zerovalue
from each compilation.
This CL consists entirely of small adjustments.
The heavy lifting is in CL 39680043.
Each depends on the other.
R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/37030045
The EncodeRune test exercises DecodeRune, but only for runes that it can encode. Add an explicit test for invalid utf16 surrogate pairs.
Bonus: coverage is now 100%
unicode/utf16/utf16.go: IsSurrogate 100.0%
unicode/utf16/utf16.go: DecodeRune 100.0%
unicode/utf16/utf16.go: EncodeRune 100.0%
unicode/utf16/utf16.go: Encode 100.0%
unicode/utf16/utf16.go: Decode 100.0%
total: (statements) 100.0%
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/39150044
NSS (used in Firefox and Chrome) won't accept two certificates with the same
issuer and serial. But this causes problems with self-signed certificates
with a fixed serial number.
This change randomises the serial numbers in the certificates generated by
generate_cert.go.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/38290044
a073d65e6f8c had a couple of bugs in the CFB mode that I missed in code review:
1) The loop condition wasn't updated from the old version.
2) It wasn't safe when src and dst aliased.
Fixes#6950.
R=golang-dev, hanwen
CC=golang-dev
https://golang.org/cl/42110043