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

2457 Commits

Author SHA1 Message Date
Rob Pike
2fc962697a goinstall: generate makefiles using exp/template
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4809052
2011-07-26 14:45:36 -07:00
Russ Cox
12a5774cde gc, runtime: fix range+panic line number bugs
Fixes #1856.

R=ken2
CC=golang-dev
https://golang.org/cl/4810054
2011-07-26 00:52:46 -04:00
Russ Cox
cce10dacc6 gc: fix select line number
Fixes #1393.

R=ken2
CC=golang-dev
https://golang.org/cl/4811054
2011-07-26 00:52:17 -04:00
Russ Cox
bf899befdb gc: disallow [...][...]int{{1,2,3}}
Fixes #1600.

R=ken2
CC=golang-dev
https://golang.org/cl/4819045
2011-07-26 00:52:02 -04:00
Andrew Gerrand
83305fecfe goinstall: abort and warn when using any url scheme, not just 'http://'
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4801053
2011-07-26 04:16:34 +10:00
Lucio De Re
75c918c1ae ld: fix build on Plan 9
ld/data.c:
. Format specifier with corresponding cast to cater for all
  architectures (llux and vlong).

ld/ldelf.c:
ld/ldmacho.c:
. Missing "pn" argument in diag() calls.

ld/ldpe.c:
. Dropped "sym->sectnum" in diag() call.
. Typo in a comment.

ld/lib.h:
. Added varargck pragma for "O".

R=rsc
CC=golang-dev
https://golang.org/cl/4749042
2011-07-25 13:45:50 -04:00
Lucio De Re
12995e2d35 gc: fix mkbuiltin for Plan 9 build
. Replaced Posix #includes with u.h and libc.h.
. Replaced fprintf(stderr,...); exit(1); with sysfatal() calls.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4823047
2011-07-25 13:45:37 -04:00
Wei Guangjing
0871af25aa ld: don't skip first 2 symbols in ldpe.
some object files don't has file name symbol.

R=golang-dev, lucio.dere, rsc
CC=golang-dev
https://golang.org/cl/4814051
2011-07-25 12:25:44 -04:00
Dmitriy Vyukov
33ff947cac runtime: fix compilation of send select cases
Fixes #2102.

R=fullung, rsc
CC=golang-dev
https://golang.org/cl/4825043
2011-07-25 12:25:37 -04:00
Andrew Gerrand
fc2480da3c goinstall: write to goinstall.log in respective GOPATH
goinstall: report every newly installed package to the dashboard

This makes "goinstall -a" work on systems with GOROOTs that are
not user-writable, as is the case with Debian's Go packages.

This also makes goinstall.log the canonical list of installed
packages, in that only packages new to goinstall.log are reported to
the dashboard.

A side-effect is that writing to goinstall.log is now mandatory.
(A bug in the original implementation meant this was the case, anyway.)

The principal benefit of this change is that multiple packages from the
same repository can now be reported to the dashboard.  It is also less
likely for a user to report multiple installations of the same package
to the dashboard (they would need to remove the package from
goinstall.log first).

R=rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/4786041
2011-07-24 13:43:08 +10:00
Wei Guangjing
7ce1a4bdc0 ld: fixes .bss for ldpe
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4794056
2011-07-23 12:21:13 -04:00
Robert Griesemer
3ddaa95d71 fix build: clean up file end in an attempt to fix build
R=r, iant
CC=golang-dev
https://golang.org/cl/4809050
2011-07-22 22:45:14 -07:00
Robert Griesemer
dcef981217 godoc/httpzip.go: use correct path in Readdir
Fixes a problem where Readdir would always return
empty directories (Readdir is only called by godoc
if the usual directory handler is commented out
in godoc.go, and if a zip file system is provided;
thus, this bug never manifested itself in godoc).

Also:
- better choice of variable/field names
- simplified error handling a bit
- better comments

R=bradfitz
CC=golang-dev
https://golang.org/cl/4813047
2011-07-22 22:24:04 -07:00
Wei Guangjing
4e5e12e305 ld: fixes ldpe link with SXREF global values.
R=golang-dev, mattn.jp, rsc
CC=golang-dev
https://golang.org/cl/4794052
2011-07-22 21:21:08 -04:00
Russ Cox
b9b204d55d ld: detect all import cycles
Fixes #2052.

R=r
CC=golang-dev
https://golang.org/cl/4812053
2011-07-22 21:18:03 -04:00
Robert Griesemer
e62e595e7a godoc/zip.go: fix another zip file system bug
Don't report that a directory was found just because we found
the list index where the directory would be if it were there...

R=iant
CC=golang-dev
https://golang.org/cl/4812051
2011-07-22 15:21:50 -07:00
Robert Griesemer
fa497796f5 go/parser: report illegal label declarations at ':' rather than guessing the start
Also:
- Add parser.SpuriousError flag. If set, the parser reports all (including
  spurious) errors rather then at most one error per line.
- Add -e flag to gofmt and gotype: If set, gofmt and gotype report all
  (including spurious) errors rather than at most one error per line.
- Updated the respective documentation.

Fixes #2088.

R=rsc
CC=golang-dev
https://golang.org/cl/4803047
2011-07-22 09:55:37 -07:00
Rob Pike
3d552700ce goyacc: cleanups
- remove calls to print
- make units compile again
- make units.y closer to gofmt style

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4802052
2011-07-22 17:58:38 +10:00
Russ Cox
22853098a9 gc: select functions are no longer special
R=ken2
CC=golang-dev
https://golang.org/cl/4794049
2011-07-21 14:10:39 -04:00
Dmitriy Vyukov
6b2ec06587 runtime: faster select
Make selectsend() accept pointer to the element,
it makes it possible to make Scase fixed-size
and allocate/free Select, all Scase's and all SudoG at once.
As a consequence SudoG freelist die out.

benchmark                       old,ns/op  new,ns/op
BenchmarkSelectUncontended	     1080        558
BenchmarkSelectUncontended-2	      675        264
BenchmarkSelectUncontended-4	      459        205
BenchmarkSelectContended	     1086        560
BenchmarkSelectContended-2	     1775       1672
BenchmarkSelectContended-4	     2668       2149
(on Intel Q6600, 4 cores, 2.4GHz)

benchmark                       old ns/op    new ns/op    delta
BenchmarkSelectUncontended         517.00       326.00  -36.94%
BenchmarkSelectUncontended-2       281.00       166.00  -40.93%
BenchmarkSelectUncontended-4       250.00        83.10  -66.76%
BenchmarkSelectUncontended-8       107.00        47.40  -55.70%
BenchmarkSelectUncontended-16       67.80        41.30  -39.09%
BenchmarkSelectContended           513.00       325.00  -36.65%
BenchmarkSelectContended-2         699.00       628.00  -10.16%
BenchmarkSelectContended-4        1085.00      1092.00   +0.65%
BenchmarkSelectContended-8        3253.00      2477.00  -23.85%
BenchmarkSelectContended-16       5313.00      5116.00   -3.71%
(on Intel E5620, 8 HT cores, 2.4 GHz)

R=rsc, ken
CC=golang-dev
https://golang.org/cl/4811041
2011-07-21 13:57:13 -04:00
Gustavo Niemeyer
14eba969d8 ld: fix freebsd build reverting .interp move
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4794046
2011-07-21 03:48:56 -03:00
Robert Griesemer
4c03bf9c59 godoc: fix zip file directory lookup
Also: remove left-over println calls.

R=bradfitz
CC=golang-dev
https://golang.org/cl/4807042
2011-07-20 16:22:13 -07:00
Gustavo Niemeyer
ba2e3af177 ld: remove overlap of ELF sections on dynamic binaries
The dynamic ELF sections were pointing to the proper data,
but that data was already owned by the rodata and text sections.
Some ELF references explicitly prohibit multiple sections from
owning the same data, and strip behaves accordingly.

The data for these sections was moved out and their ranges are
now owned by their respective sections.  This change makes strip
happy both with and without -s being provided at link time.

A test was added in debug/elf to ensure there are no regressions
on this area in the future.

Fixes #1242.
Fixes #2022.

NOTE: Tested on Linux amd64/386/arm only.

R=rsc
CC=golang-dev
https://golang.org/cl/4808043
2011-07-20 12:47:02 -03:00
Robert Griesemer
8930ce2dc1 godoc: implement http.FileSystem for zip files
R=rsc, adg, bradfitz
CC=golang-dev
https://golang.org/cl/4750047
2011-07-19 08:22:20 -07:00
Wei Guangjing
9f636598ba cgo: windows amd64 port
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4725041
2011-07-19 10:47:33 -04:00
Tarmigan Casebolt
a0d3be1689 goinstall, dashboard: Google Code now supports git
R=golang-dev, adg, rsc, tarmigan+golang
CC=golang-dev
https://golang.org/cl/4760055
2011-07-19 16:58:18 +10:00
Rob Pike
423ab2333a 5l: fix arm linker bug introduced by 4742041
Should fix the arm build.

R=golang-dev, dsymonds, adg
CC=golang-dev
https://golang.org/cl/4777041
2011-07-19 15:44:25 +10:00
Russ Cox
92c6061b5c 5l: assume Linux binary, not Plan 9
R=bradfitz
CC=golang-dev
https://golang.org/cl/4767042
2011-07-18 12:30:10 -04:00
Russ Cox
caa5647408 ld: allow seek within write buffer
Reduces number of write+seek's from 88516 to 2080
when linking godoc with 6l.

Thanks to Alex Brainman for pointing out the
many small writes.

R=golang-dev, r, alex.brainman, robert.hencke
CC=golang-dev
https://golang.org/cl/4743043
2011-07-18 12:04:09 -04:00
Brad Fitzpatrick
e8689404a7 cgo: add missing semicolon in generated struct
This affected certain signatures needing padding
like:

//export Foo
func Foo() (int, C.long) { ... }

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4745047
2011-07-18 07:23:52 -07:00
Dave Cheney
c945d9c8a1 gc: fix silent sign truncation in pgen.c
Fixes #2076.

R=golang-dev, r, r, dsymonds, lucio.dere
CC=golang-dev
https://golang.org/cl/4744047
2011-07-18 21:09:28 +10:00
Rob Pike
9d55c282e3 5c: attempt to fix build by silencing warnings about unused variables.
The story is more complicated; this is just a bandaid.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4755047
2011-07-18 11:08:55 +10:00
Lucio De Re
8c5c3c504c cmd/5l/Makefile: directory prefix nit, "../5l/" is not needed.
R=golang-dev, r
CC=golang-dev, rsc
https://golang.org/cl/4755046
2011-07-18 08:46:47 +10:00
Lucio De Re
4c6280b0f1 6a, 6c, 6l: fix for Plan 9 build
6a/a.h:
. Dropped <u.h> and <libc.h>.
. Made definition of EOF conditional.

6a/a.y:
. Added <u.h> and <libc.h>.

6a/lex.c:
. Added <u.h> and <libc.h>.
. Dropped <ctype.h> (now in <u.h>).

6c/gc.h:
. Added varargck pragma for "lD".

6c/swt.c:
. Dropped unused "thestring" argument in Bprint() calls.

6l/Makefile:
. Dropped unneeded directory prefix.

6l/l.h:
. Dropped unneeded directory prefix.
. Added varargck pragma for "I" and "i".

6l/obj.c:
. Dropped unneeded assignment.
. Dropped unreachable goto statement.

6l/pass.c:
. Dropped assignments flagged as unused.

6l/prof.c:
. Replaced "#if 0" with "#ifdef NOTDEF".

6l/span.c:
. Dropped unused incrementation.
. Added USED() as required.
. Dropped unreachable "return" statement.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4747044
2011-07-15 11:58:39 -04:00
Lucio De Re
5ea4d73b17 5a, 5c, 5l: fix for Plan 9 build
5a/a.h:
. Removed <u.h> and <lib.h>.
. Made definition of EOF conditional.

5a/a.y:
. Added <u.h> and <lib.h>.

5a/lex.c:
. Added <u.h> and <lib.h>.
. Dropped <ctype.h> (now in <u.h>).

5c/peep.c:
. Removed unnecessary "return 0" statement.

5c/reg.c:
. Added compilation condition around unused code.

5c/swt.c:
. Removed unused "thestring" argument from Bprint() calls.

5l/asm.c:
. Added USED() statements as required.
. Adjusted a few format specifications.
. Added compilation condition around unused code.

5l/l.h:
. Dropped directory prefix from <../5l/5.out.h>.
. Added varargck pragma for "I" and "i".

5l/obj.c:
. Cascaded consecutive "if" statements.
. Dropped unnecessary incrementation and assignments.

5l/pass.c:
. Dropped unnecessary assignment.

5l/prof.c:
. #if 0 converted to #ifdef NOTDEF.

5l/span.c:
. Dropped unnecessary incrementation and assignments.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4752041
2011-07-15 11:58:28 -04:00
Lucio De Re
0490eb60bb 8l: nits
8l/Makefile:
. Dropped unnecessary prefix from "../8l/8.out.h"

8l/l.h:
. Dropped unnecessary prefix from "../8l/8.out.h"
. Dropped unused and inconsistent "I" vararg pragma.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/4754041
2011-07-15 11:51:59 -04:00
Luuk van Dijk
8cf8806d31 gc: some enhancements to printing debug info.
R=rsc
CC=golang-dev
https://golang.org/cl/4710046
2011-07-15 16:00:05 +02:00
Robert Griesemer
90564a9256 go/printer: changed max. number of newlines from 3 to 2
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go
(cd src/cmd/gofix/testdata; gofmt -w *.in *.out)
(cd src/pkg/go/printer; gotest -update)
gofmt -w misc src

runs all tests

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4715041
2011-07-14 14:39:40 -07:00
Russ Cox
58e19aa4cb go: require { } around else block
R=gri, ken, r
CC=golang-dev
https://golang.org/cl/4721044
2011-07-14 17:15:52 -04:00
Robert Griesemer
8d73781f8b godoc: fix build (add Makefile change)
R=bradfitz
CC=golang-dev
https://golang.org/cl/4733041
2011-07-14 11:48:23 -07:00
Robert Griesemer
df68a61c9e godoc: support for file systems stored in .zip files
Instead of serving files of the underlying OS file system,
a .zip file may be provided to godoc containing the files
to serve; for instance:

   godoc -http=:6060 -zip=go.zip

using a .zip file created from a clean tree as follows:

   zip -r go.zip $GOROOT

R=rsc
CC=golang-dev
https://golang.org/cl/4670053
2011-07-14 11:34:53 -07:00
Luuk van Dijk
e8ff9a624f gc: fix closure bug
Fixes #2056.

R=rsc
CC=golang-dev
https://golang.org/cl/4709042
2011-07-14 18:13:39 +02:00
Lucio De Re
3f2cc8ba7e cc: fixes for Plan 9 build
<ctype.h> has been moved into <u.h>, specifically to be able to
drop it from these modules.

Will someone check platforms other than UBUNTU/386, please?

R=bsiegert, rsc
CC=golang-dev
https://golang.org/cl/4648078
2011-07-13 16:01:29 -07:00
Brad Fitzpatrick
dcdaeebdfb docs: fix wrong it's -> its
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/4702046
2011-07-13 10:54:51 -07:00
David Anderson
f1df07bf6a 5l, 6l, 8l: Add a PT_LOAD PHDR entry for the PHDR.
Per the TIS ELF spec, if a PHDR entry is present in the
program header table, it must be part of the memory image of
the program. Failure to do this makes elflint complain, and
causes some tools that manipulate ELF to crash.

R=iant, rsc
CC=dave, golang-dev
https://golang.org/cl/4650067
2011-07-12 17:49:55 -07:00
Quan Yong Zhai
fe9991e8b2 runtime: replace runtime.mcpy with runtime.memmove
faster string operations, and more

tested on linux/386

runtime_test.BenchmarkSliceToString                    642          532  -17.13%
runtime_test.BenchmarkStringToSlice                    636          528  -16.98%
runtime_test.BenchmarkConcatString                    1109          897  -19.12%

R=r, iant, rsc
CC=golang-dev
https://golang.org/cl/4674042
2011-07-12 17:30:40 -07:00
Robert Hencke
67edf9cb87 gc: make size of struct{} and [0]byte 0 bytes
Fixes #1949.

R=iant, rsc
CC=golang-dev
https://golang.org/cl/4634124
2011-07-12 11:12:06 -07:00
Adam Langley
9f4c288c16 hash/crc32: add SSE4.2 support
Using the CRC32 instruction speeds up the Castagnoli computation by
about 20x on a modern Intel CPU.

R=rsc
CC=golang-dev
https://golang.org/cl/4650072
2011-07-12 09:29:24 -04:00
Alex Brainman
8ed9fc600c 6l: change default output name to 6.out.exe on windows
R=golang-dev, vcc.163
CC=golang-dev
https://golang.org/cl/4670049
2011-07-12 14:22:48 +10:00
Andrew Gerrand
5bcbcab311 sort: rename helpers: s/Sort// in sort.Sort[Float64s|Ints|Strings]
Includes 'sorthelpers' gofix and updates to tree.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4631098
2011-07-08 10:52:50 +10:00