1
0
mirror of https://github.com/golang/go synced 2024-10-03 23:11:21 -06:00
Commit Graph

5272 Commits

Author SHA1 Message Date
Alex Brainman
5e83d40904 syscall: implement windows version of Fsync
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4158043
2011-02-09 14:54:54 +11:00
Russ Cox
e6f9b2f110 fix build clean.bash
TBR=r
CC=golang-dev
https://golang.org/cl/4151042
2011-02-08 22:39:39 -05:00
Alex Brainman
642c774081 src/run.bash: get rid of long windows expression
R=rsc
CC=golang-dev
https://golang.org/cl/4138041
2011-02-09 12:37:08 +11:00
Ken Thompson
5080d7617a cgen64: dont use MVN instruction
R=r
CC=golang-dev
https://golang.org/cl/4154043
2011-02-08 17:30:23 -08:00
Ken Thompson
dc331e6565 peep: more optimization
R=r
CC=golang-dev
https://golang.org/cl/4149044
2011-02-08 16:55:59 -08:00
Graham Miller
69334ee62b netchan: graceful handling of closed connection
Currently, when an importer closes the connection, the exporter gives an
error message 'netchan export: error decoding client header:EOF'.  This
change causes the exporter to look for an EOF during the parse of the
header, and silences the log message in that case.

R=r
CC=golang-dev, rog
https://golang.org/cl/4132044
2011-02-08 12:42:31 -08:00
Gustavo Niemeyer
b9183b986a cgo: don't run cgo when not compiling
The logic introduced to avoid running cgo when
introducing _cgo_flags is faulty.  My goal was
to handle it with the following statement:

    -include _cgo_flags

The dash tells make to ignore errors if it can't
include the file.

What I missed, though, was the fact that it
*will* attempt to build the file if it knows
how.

This change will introduce the originally
intended semantics of not attempting to build
the file before necessary.

R=rsc
CC=golang-dev
https://golang.org/cl/4023069
2011-02-08 15:40:11 -05:00
Adam Langley
1b8d373463 crypto/openpgp/packet: add UserId packet type
This was split from CL 4124054

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4126057
2011-02-07 21:40:33 -05:00
Ken Thompson
e26b741523 peep: fix optimization bug
R=r
CC=golang-dev
https://golang.org/cl/4105058
2011-02-07 17:21:04 -08:00
Ken Thompson
2799e0ecb9 peep: fix bug in peep optimizer.
reg: enable peep optimizer.
cgen64: better int64 code.

R=r
CC=golang-dev
https://golang.org/cl/3989065
2011-02-07 15:00:30 -08:00
Russ Cox
223459891e syscall: fix arm build
R=r
CC=golang-dev
https://golang.org/cl/4105057
2011-02-07 17:49:45 -05:00
Rob Pike
0ae041735a ld: fix build (uvlong vs uint64 conflict on freebsd)
R=rsc
CC=golang-dev
https://golang.org/cl/4023071
2011-02-07 14:40:36 -08:00
Rob Pike
fb55941539 loader: move the XputY routines into the ld directory.
Fixes the build for 5l, and also removes an inconsequential bug in 8l.

R=rsc
CC=golang-dev
https://golang.org/cl/4127051
2011-02-07 14:34:21 -08:00
Adam Langley
ab2aca5e52 crypto/tls: select best ciphersuite, not worst.
Previously, the outer loop would continue until we selected the
client's least preferable ciphersuite.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4029056
2011-02-05 13:56:36 -05:00
Adam Langley
566d432f54 asn1: marshal true as 255, not 1.
OS X, at least, appears to test |byte == 255|, not |byte != 0| to
establish if a bool is true or false.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4128064
2011-02-05 13:55:37 -05:00
Adam Langley
5626bd9e38 crypto/tls: load a chain of certificates from a file.
Many recently issued certificates are chained: there's one or more
intermediate certificates between the host certificate and the root CA
certificate. This change causes the code to load any number of
certificates from the certificate file. This matches the behaviour of
common webservers, and the output of OpenSSL's command line tools.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4119057
2011-02-05 13:54:25 -05:00
Adam Langley
c63a88072b crypto/openpgp/packet: two more packet types.
R=bradfitzgo, r
CC=golang-dev
https://golang.org/cl/4124054
2011-02-05 12:06:42 -05:00
Robert Griesemer
d812e8c994 go/printer, gofmt: smarter handling of multi-line raw strings
If a multi-line raw string is the first token on a line, it
should not be indented because the following lines (belonging
to the raw string) are not indented either.

Adjusted src of ebnf/ebnf_test.go manually as it now is formatted
as expected.

gofmt -w src misc

Fixes #1072.

R=r
CC=golang-dev
https://golang.org/cl/4119056
2011-02-04 17:34:16 -08:00
Kyle Consalus
42973dddf4 template: Add simple formatter chaining.
Fixes #676.

R=r, rsc, r2
CC=golang-dev
https://golang.org/cl/4127043
2011-02-04 16:37:30 -08:00
Robert Griesemer
eeafc06538 gofmt: no need for lexical compare of src and res (optimization)
R=r
CC=golang-dev
https://golang.org/cl/4130046
2011-02-04 15:36:32 -08:00
Rob Pike
5008c63e6e template: allow a leading '*' to indicate that evaulation should
indirect through a pointer.

Fixes #1478.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/4131045
2011-02-04 15:21:08 -08:00
Rob Pike
6e615a57af scan: permit base prefixes 0nnn and 0xnn when scanning
signed or unsigned integers using %v or the formatless scanner.
That is, Sscan("0x11", &i) or Sscanf("0x11", "%v", &i) will now
set i to 17.   If a format other than %v is presented, the behavior
is as before.

Fixes #1469.

R=rsc
CC=golang-dev
https://golang.org/cl/4131042
2011-02-04 13:14:38 -08:00
Yuval Pavel Zholkover
c14c4e55e0 8l: fix crash writing Plan 9 binaries
Was crashing with GOOS=plan9 unless -s was passed.
Add symbols and line numbers to Plan 9 a.out.

R=rsc
CC=golang-dev
https://golang.org/cl/4080050
2011-02-04 14:33:21 -05:00
Russ Cox
6c5e4e1854 build: allow clean.bash to work on fresh checkout
Must be invoked as ./clean.bash --gomake make
(or --gomake gmake, depending on the name of
GNU make).

R=niemeyer
CC=golang-dev
https://golang.org/cl/4023065
2011-02-04 14:33:08 -05:00
Russ Cox
4fa6d57f6e runtime: fix asm.h on Windows
Thanks to mhantsch@gmail.com.

R=adg, brainman
CC=golang-dev
https://golang.org/cl/4092048
2011-02-04 14:32:59 -05:00
Adam Langley
4a14bc524b crypto/openpgp/packet: add public key support
Note that DSA public key support is nascent and the verification
functions clearly don't support it yet. I'm intending to get RSA keys
working first.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/3973054
2011-02-04 09:00:17 -05:00
Alex Brainman
4ecebfea53 os: implement new Process api
Fixes #1004.
Fixes #1460.

R=mattn, r, niemeyer, rog, rsc
CC=golang-dev
https://golang.org/cl/4029053
2011-02-04 14:41:26 +11:00
Yasuhiro Matsumoto
8b9d6e38be gopack: unused variable.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4121057
2011-02-03 17:29:09 -08:00
Robert Griesemer
ea2c6a3e59 godoc: minor internal fix
The value of the internal flag includeNonGoFile
really is the value of the fulltextIndex flag.

R=rsc
CC=golang-dev
https://golang.org/cl/4044052
2011-02-03 16:05:57 -08:00
Rob Pike
7db904c1f6 regexp: add support for matching text read from things that implement
ReadRune.  (If you have a Reader but not a RuneReader, use bufio.)

The matching code is a few percent slower but significantly cleaner.

R=rsc
CC=golang-dev
https://golang.org/cl/4125046
2011-02-03 13:58:40 -08:00
Gustavo Niemeyer
63457d089e sync: Proposal for barrier implementation
As discussed in the mailing list, this adds a simple barrier
implementation to the sync package which enables one or more
goroutines to wait for a counter to go down to zero.

R=rsc, rog, r
CC=golang-dev
https://golang.org/cl/3770045
2011-02-03 12:39:11 -08:00
Rob Pike
8bf0bc2754 fmt: document %%
R=rsc, gri
CC=golang-dev
https://golang.org/cl/4130044
2011-02-03 11:55:33 -08:00
Russ Cox
9d3db4b62e gotest: enable unit tests for cmd directories
R=r
CC=golang-dev
https://golang.org/cl/4001056
2011-02-03 14:54:01 -05:00
Russ Cox
c1a695c160 gc, ld: package name main no longer reserved
R=ken2
CC=golang-dev
https://golang.org/cl/4128054
2011-02-03 14:17:20 -05:00
Dave Cheney
eff1952873 syscall: add SetsockoptIpMreq
notes:
* due to Issue 1466 the Msghdr struct for
 src/pkg/syscall/ztypes_darwin_386.go
 src/pkg/syscall/ztypes_darwin_amd64.go
had to be edited after the godefs generation.
* ztypes_*.go files for linux, freebsd and darwin
have been prepared on the correct host OS and ARCH.
While the total increase is a dozen lines per file
the diff is larger due to a change to godefs,
 http://code.google.com/p/go/source/detail?r=c79e30afe9c8
while has altered the names of Pad members which
causes gofmt to realign the affected structs

R=rsc, mikioh
CC=golang-dev
https://golang.org/cl/4119053
2011-02-03 14:15:35 -05:00
Gustavo Niemeyer
ab15a978fb cgo: os/arch dependent #cgo directives
This enables #cgo directives to contain a os/arch
specification which restricts the definition of
the given option to matching systems.

For example:

#cgo amd64 CFLAGS: -DAMD64=1
#cgo linux CFLAGS: -DLINUX=1
#cgo linux/amd64 CFLAGS: -DLINUX_ON_AMD64=1

R=rsc
CC=golang-dev
https://golang.org/cl/4121048
2011-02-03 13:51:47 -05:00
Russ Cox
3f61184e1b gc, ld: detect stale or incompatible object files
The object files begin with a header that is

        $GOARCH

on a line by itself.  This CL changes that header to

        go object $GOOS $GOARCH release.2011-01-01 4567+

where the final two fields are the most recent release
tag and the current hg version number.

All objects imported into a Go compilation or linked into an
executable must have the same header line, and that header
line must match the compiler and linker versions.

The effect of this will be that if you update and run all.bash
and then try to link in objects compiled with an earlier version
of the compiler (or invoke the wrong version of the compiler),
you will get an error showing the different headers instead
of perhaps silent incompatibility.

Normal usage with all.bash should be unaffected, because
all.bash deletes all the object files in $GOROOT/pkg/$GOOS_$GOARCH
and cleans all intermediate object files before starting.

This change is intended to diagnose stale objects arising when
users maintaining alternate installation directories forget to
rebuild some of their files after updating.

It should help make the adoption of $GOPATH (CL 3780043)
less error-prone.

R=ken2, r
CC=golang-dev
https://golang.org/cl/4023063
2011-02-03 13:51:43 -05:00
Adam Langley
364cb831f7 crypto/openpgp/packet: add basic routines
Since nobody suggested major changes to the higher level API, I'm
splitting up the lower level code for review. This is the first of the
changes for the packet reading/writing code.

It deliberately doesn't include a Makefile because the package is
incomplete.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4080051
2011-02-03 09:22:40 -05:00
Adam Langley
2a2995cec8 crypto/openpgp/armor: bug fixes
* Don't require lines to be full.
* Don't forget to flush the line buffer.
* Update the test so that it doesn't happen to include only full lines
  in order to test the above.
* Always write the line after the header as GNUPG expects it.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4124043
2011-02-03 09:19:20 -05:00
Adam Langley
fc5c1f0a18 crypto/cipher: add resync open to OCFB mode.
OpenPGP changed its OCFB mode for more modern packets (for example, the
MDC symmetrically encrypted packet). This change adds a bool to
determine which mode is used.

R=bradfitzgo, r, rsc
CC=golang-dev
https://golang.org/cl/4126041
2011-02-03 09:17:42 -05:00
Christopher Nielsen
31ccf19612 build: fix spaces in GOROOT
Fixes #1413.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4007041
2011-02-03 00:42:03 -05:00
Russ Cox
1e063b32cd runtime: faster allocator, garbage collector
GC is still single-threaded.
Multiple threads will happen in another CL.

Garbage collection pauses are typically
about half as long as they were before this CL.

R=brainman, iant, r
CC=golang-dev
https://golang.org/cl/3975046
2011-02-02 23:03:47 -05:00
Russ Cox
6b93a92ac0 windows: fix build?
Shot in the dark.

TBR=r
CC=golang-dev
https://golang.org/cl/4126054
2011-02-02 22:53:10 -05:00
Gustavo Niemeyer
34336bd9f3 cgo: fix _cgo_run timestamp file order
The timestamp file is being created before cgo
runs, which means errors will not prevent it
from being created and thus will cause the
build to break by rendering the rule up-to-date
when it isn't.

R=rsc
CC=golang-dev
https://golang.org/cl/4001049
2011-02-02 22:37:40 -05:00
Eoghan Sherry
cf63e34b1d gc: correct rounding of denormal constants
Fixes #1463.

R=rsc
CC=golang-dev
https://golang.org/cl/4079060
2011-02-02 22:36:54 -05:00
Hector Chu
fb9fc886ff windows: syscall: Make ForkExec acquire the ForkLock
so that spawned processes avoid inheriting pipes.

Implement CloseOnExec.
Make file and pipe handles inheritable.

R=rsc, brainman, vincent.vanackere
CC=golang-dev
https://golang.org/cl/4126047
2011-02-03 12:50:41 +11:00
Russ Cox
259a974292 cgo: rename internal f to avoid conflict with possible C global named f
Fixes #1452.

R=r
CC=golang-dev
https://golang.org/cl/4023060
2011-02-02 18:53:03 -05:00
Russ Cox
8a2891fc56 gc: select receive bug fix
Affects receive using := when new variable escapes to heap.

Fixes #1468.

R=ken2
CC=golang-dev
https://golang.org/cl/4119052
2011-02-02 18:34:09 -05:00
Robert Griesemer
c5fc3b6972 fmt: rename internal interfaces
readRuner -> runeReader
unreadRuner -> runeUnreader

R=r, rsc
CC=golang-dev
https://golang.org/cl/4000054
2011-02-02 15:00:14 -08:00
Russ Cox
b287d7cbe1 runtime: more detailed panic traces, line number work
Follow morestack, so that crashes during a stack split
give complete traces.  Also mark stack segment boundaries
as an aid to debugging.

Correct various line number bugs with yet another attempt
at interpreting the pc/ln table.  This one has a chance at
being correct, because I based it on reading src/cmd/ld/lib.c
instead of on reading the documentation.

Fixes #1138.
Fixes #1430.
Fixes #1461.

throw: runtime: split stack overflow

runtime.throw+0x3e /home/rsc/g/go2/src/pkg/runtime/runtime.c:78
        runtime.throw(0x81880af, 0xf75c8b18)
runtime.newstack+0xad /home/rsc/g/go2/src/pkg/runtime/proc.c:728
        runtime.newstack()
runtime.morestack+0x4f /home/rsc/g/go2/src/pkg/runtime/386/asm.s:184
        runtime.morestack()
----- morestack called from stack: -----
runtime.new+0x1a /home/rsc/g/go2/src/pkg/runtime/malloc.c:288
        runtime.new(0x1, 0x0, 0x0)
gongo.makeBoard+0x33 /tmp/Gongo/gongo_robot_test.go:344
        gongo.makeBoard(0x809d238, 0x1, 0xf76092c8, 0x1)
----- stack segment boundary -----
gongo.checkEasyScore+0xcc /tmp/Gongo/gongo_robot_test.go:287
        gongo.checkEasyScore(0xf764b710, 0x0, 0x809d238, 0x1)
gongo.TestEasyScore+0x8c /tmp/Gongo/gongo_robot_test.go:255
        gongo.TestEasyScore(0xf764b710, 0x818a990)
testing.tRunner+0x2f /home/rsc/g/go2/src/pkg/testing/testing.go:132
        testing.tRunner(0xf764b710, 0xf763b5dc, 0x0)
runtime.goexit /home/rsc/g/go2/src/pkg/runtime/proc.c:149
        runtime.goexit()

R=ken2, r
CC=golang-dev
https://golang.org/cl/4000053
2011-02-02 16:44:20 -05:00