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
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
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
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
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
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
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
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
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
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
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
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
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
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
* 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
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
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
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
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
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
If the same directory was used for multiple builds,
it was possible for a stale version.go to contain the
wrong definitions for $GOOS and $GOARCH, because
they can change even if the hg version does not.
Split into multiple files to fix.
R=r, r2
CC=golang-dev
https://golang.org/cl/4124050
Shame on me: I fixed the same bug in 6l in 8691fcc6a66e
(https://golang.org/cl/2609041) and neglected
to look at 5l and 8l to see if they were affected.
On the positive side, the check I added in that CL is the
one that detected this bug.
Fixes#1457.
R=ken2
CC=golang-dev
https://golang.org/cl/3981052
This aligns the naming scheme with the testing package and
also lets govet work on more logging calls.
R=rsc
CC=golang-dev
https://golang.org/cl/4001048
Make the error message and the needed action more obvious
when a command isn't found to obtain the source code
of a project. Users seem to strugle with the existing
wording in practice.
R=rsc
CC=golang-dev
https://golang.org/cl/4058047
The callback mechanism has been made more flexible.
Eliminated one round of argument copying in Syscall.
Faster Get/SetLastError implemented.
Added gettime for gc perf profiling.
R=rsc, brainman, mattn, rog
CC=golang-dev
https://golang.org/cl/4058046
The crypto package is added as a common place to store identifiers for
hash functions. At the moment, the rsa package has an enumeration of
hash functions and knowledge of their digest lengths. This is an
unfortunate coupling and other high level crypto packages tend to need
to duplicate this enumeration and knowledge (i.e. openpgp).
crypto pulls this code out into a common location.
It would also make sense to add similar support for ciphers to crypto,
but the problem there isn't as acute that isn't done in this change.
R=bradfitzgo, r, rsc
CC=golang-dev
https://golang.org/cl/4080046
If there were warnings or errors in the user code,
cgo would print the first error from gcc and then stop,
which is not helpful.
This CL makes cgo ignore errors from user code
in the first pass - they will be shown later.
It also prints errors from user preamble code
with the correct line numbers.
(Also fixed misleading usage message).
R=iant, rsc
CC=golang-dev
https://golang.org/cl/4082047
The "all:" target is the default for running gomake
by hand, but it is not used during the build.
The build runs make install and make test.
Save the build of maketables for the test phase
so that the packages it needs will have been
installed already.
R=r, r2
CC=golang-dev
https://golang.org/cl/4121043
- fixed length of amd64 .data pe section
(don't need to include non-initialised data)
- use correct oh/oh64 variable when updating
data directory in addexports
- simplify and cleanup
R=vcc, rsc
CC=golang-dev
https://golang.org/cl/4106044
The sanity checking in pass 2 is wrong
when a select is offering to communicate in
either direction on a channel and neither case
is immediately ready.
R=ken2
CC=golang-dev
https://golang.org/cl/3991047
The old heap maps used a multilevel table, but that
was overkill: there are only 1M entries on a 32-bit
machine and we can arrange to use a dense address
range on a 64-bit machine.
The heap map is in bss. The assumption is that if
we don't touch the pages they won't be mapped in.
Also moved some duplicated memory allocation
code out of the OS-specific files.
R=r
CC=golang-dev
https://golang.org/cl/4118042
- complex numbers now supported.
- entirely independent of standard decode code.
- parser has no read-ahead; that is, the scanning works
simply by reading the values as they arrive, not by trying
to count bytes for message boundaries, a proof of concept
for the pending rewrite of the regular decoder.
R=rsc, r2
CC=golang-dev
https://golang.org/cl/4084044
This bug prevented files such as READMEs etc. from being included in the index.
For instance, now author names recorded in the AUTHORS file can be found with
a godoc query.
R=rsc, r2
CC=golang-dev
https://golang.org/cl/4005047
The linker avoids a GOT indirection by turning a MOV into
a LEA, but with x86-64 GCC has started emitting CMOV*
instructions which break the existing logic.
This will generate errors such as:
unexpected GOT reloc for non-dynamic symbol luaO_nilobject_
The CMOV* instructions may be emitted with normal code like:
if (o >= L->top) return cast(TValue *, luaO_nilobject);
else return o;
Which gets compiled into (relocation offset at 1b):
13: 48 3b 47 10 cmp 0x10(%rdi),%rax
17: 48 0f 43 05 00 00 00 cmovae 0x0(%rip),%rax
1e: 00
This change will allow the indirection through the GOT to
avoid the problem in those cases.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4071044
It is unmaintained and untested, and I think it's broken too.
It was a toy to show that Go can run on real hardware,
and it served its purpose.
The source code will of course remain in the repository
history, so it could be brought back if needed later.
R=r, r2, uriel
CC=golang-dev
https://golang.org/cl/3996047
The implementation of the position computation
was surprisingly broken. Implemented fixes and
added extra test cases.
There is a slight interface change: Calling
Pos() returns the current position; but if
called before Scan() that position may not
be the position of the next token returned
by Scan() (depending on the scan settings
and the source text) - this in contrast to
the original comment.
However, after calling Scan(), the Scanner's
Position field reports the position of the
scanned token, as before.
Fixes#1327.
R=rsc
CC=golang-dev
https://golang.org/cl/3972047
Also simplify sleeper algorithm and poll
occasionally so redundant sleeper goroutines
will quit sooner.
R=r, niemeyer, r2
CC=golang-dev
https://golang.org/cl/4063043
The docstring claims the function uses PSS message encoding,
when the function actually implements PKCS1-v1_5 encoding.
R=agl1, rsc
CC=danderson, golang-dev
https://golang.org/cl/4097042
Init may report an error on the first character and
thus one needs an ability to set the error handler
for Init. Was a design bug.
Added corresponding test cases and better documentation.
Also: Fixed a subtle infinite loop exposed by one of the
new test cases.
Fixes#1380.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/4094041
When parsing numbers with an exponent (like "12e-1"), the JSON scanner
would only allow a lowercase 'e', while the RFC also allows the
uppercase 'E'.
R=adg
CC=golang-dev, rsc
https://golang.org/cl/3986042
(or at least a correct encoder, still to come).
Change the debug structure slightly to better represent
the grammar.
Minor tweaks for consistency in type.go.
R=rsc
CC=golang-dev
https://golang.org/cl/4007044
The test code used to do this:
for _, tc := range tests {
ch <- &tc
}
Note that &tc is always the same value here. As the value is
received from the channel, the sender can loop around and
change the contents of tc. This means that the receiver's
value is unstable and can change while it is in use.
R=adg, r2, rsc
CC=chris, golang-dev
https://golang.org/cl/3978043
Close of closed channel panics.
Receive from closed channel never panics,
even if done repeatedly.
Fixes#1349.
Fixes#1419.
R=gri, iant, ken2, r, gri1, r2, iant2, rog, albert.strasheim, niemeyer, ejsherry
CC=golang-dev
https://golang.org/cl/3989042
Re-implement the debugging helper to be independent of the existing
implementation. This is preparatory to a rewrite to clean up issue 1416.
Include a definition of the grammar of the data stream.
R=rsc
CC=golang-dev
https://golang.org/cl/3970045
This was broken after the last update (2011-01-20).
However, I'm not sure if the changed example is a
sensible use of import(), so I'd appreciate comments.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4067043
The functionality we want (shared ppid) is implied
by CLONE_THREAD already, and CLONE_PARENT
causes problems if the Go program is pid 1 (init).
See issue 1406 for more details.
Fixes#1406.
R=adg, iant
CC=golang-dev
https://golang.org/cl/3971044