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

3130 Commits

Author SHA1 Message Date
Russ Cox
aa87d78cf6 cmd/dist: encoding/gob is no longer required for cmd/go
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5650068
2012-02-12 23:15:07 -05:00
Russ Cox
7dd90621f8 gc: diagnose field+method of same name
Fixes #2828.

R=ken2
CC=golang-dev
https://golang.org/cl/5653065
2012-02-11 01:21:12 -05:00
Russ Cox
2aafad25b4 gc: print detail for typechecking loop error
R=ken2
CC=golang-dev
https://golang.org/cl/5654060
2012-02-11 01:04:33 -05:00
Russ Cox
2f3d695a61 gc: fix bug introduced earlier
Apparently l and $1 were the same register on Linux.
On the other systems, the compiler caught it.

R=ken2
CC=golang-dev
https://golang.org/cl/5654061
2012-02-11 01:04:24 -05:00
Russ Cox
337547d1c9 gc: make constant arith errors a little more friendly
Fixes #2804.

R=ken2
CC=golang-dev
https://golang.org/cl/5652067
2012-02-11 00:50:56 -05:00
Robert Griesemer
2233942e3c gofmt: fix error message in test
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5652066
2012-02-10 21:47:18 -08:00
Russ Cox
77aaa3555d gc: fix import of struct type in struct literal
Fixes #2716.

R=ken2
CC=golang-dev
https://golang.org/cl/5652065
2012-02-11 00:34:01 -05:00
Russ Cox
f91cc3bdbb gc: optimize interface ==, !=
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
2012-02-11 00:19:24 -05:00
Russ Cox
a7b83f2287 5g: fix out of registers bug
Same fix as 6g, tripped by the 6g test case.

R=ken2
CC=golang-dev
https://golang.org/cl/5651074
2012-02-11 00:04:37 -05:00
Mikio Hara
f842dc160b cmd/dist: clear execute bit from source file
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5651072
2012-02-11 13:23:44 +09:00
Russ Cox
896f0c61c8 gc: diagnose init loop involving func
Fixes #2295.

R=ken2
CC=golang-dev
https://golang.org/cl/5655057
2012-02-10 23:10:45 -05:00
Russ Cox
7ae1fe420e gc: eliminate duplicate ambiguous selector message
Also show actual expression in message when possible.

Fixes #2599.

R=ken2
CC=golang-dev
https://golang.org/cl/5654059
2012-02-10 22:46:56 -05:00
Russ Cox
5340510203 8g: fix opt bug
Was trying to optimize a duplicate float64 move
by registerizing an int64.

Fixes #2588.

R=ken2
CC=golang-dev
https://golang.org/cl/5645086
2012-02-10 22:32:02 -05:00
Russ Cox
ca5da31f83 6g: fix out of registers bug
Fix it twice: reuse registers more aggressively in cgen abop,
and also release R14 and R15, which are no longer m and g.

Fixes #2669.

R=ken2
CC=golang-dev
https://golang.org/cl/5655056
2012-02-10 22:19:34 -05:00
Gustavo Niemeyer
dbac863ed8 cmd/dist: reset version during bootstrap
Fixes #2927.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5651062
2012-02-10 22:26:36 -02:00
Luuk van Dijk
e0b2ce3401 cmd/gc: suspend safemode during typecheck of inlined bodies.
Should be obviously correct.  Includes minimal test case.
A future CL should clear up the logic around typecheckok and importpkg != nil someday.

R=rsc, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5652057
2012-02-10 22:50:55 +01:00
Robert Griesemer
f8cf82f6f2 go/printer: implement SourcePos mode
If a printer is configured with the SourcePos mode
set, it will emit //-line comments as necessary to
ensure that the result - if reparsed - reflects the
original source position information.

This change required a bit of reworking of the
output section in printer.go. Specifically:

- Introduced new Config mode 'SourcePos'.

- Introduced new position 'out' which tracks the
position of the generated output if it were read
in again. If there is a discrepancy between out
and the current AST/source position, a //line
comment is emitted to correct for it.

- Lazy emission of indentation so that //line
comments can be placed correctly. As a result,
the trimmer will have to do less work.

- Merged writeItem into writeString.

- Merged writeByteN into writeByte.

- Use a []byte instead of a byte.Buffer both in the
printer and in the trimmer (eliminates dependency).

Also: introduced explicit printer.Mode type (in
sync w/ parser.Mode, scanner.Mode, etc.)

Runs all tests. Applied gofmt to src, misc w/o changes.

Fixes #1047.
Fixes #2697.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5643066
2012-02-10 13:27:32 -08:00
Daniel Theophanes
ef1d2a32ea dist: prevent recusive loop on windows when fatal() is called.
Fixes #2931.

R=golang-dev, alex.brainman
CC=golang-dev, rsc
https://golang.org/cl/5651049
2012-02-09 23:10:27 -05:00
Brad Fitzpatrick
c15a42ed76 cmd/api: follow constant references
For gccgo. Also removes bunch of special cases.

Fixes #2906

R=golang-dev, remyoudompheng
CC=golang-dev
https://golang.org/cl/5644050
2012-02-10 10:05:26 +11:00
Gustavo Niemeyer
54f1e1b163 cmd/dist: fix GOROOT_FINAL
R=rsc, gustavo
CC=golang-dev
https://golang.org/cl/5642045
2012-02-09 20:47:12 -02:00
Alex Brainman
eaf640dbc4 cmd/dist: do not use HEAP_GENERATE_EXCEPTIONS flag
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5650048
2012-02-10 09:14:00 +11:00
Russ Cox
5c52404aca gc: implicit type bug fix in export data
TBR=lvd
CC=golang-dev
https://golang.org/cl/5644064
2012-02-09 00:26:08 -05:00
Rob Pike
00d0f8e320 cmd/go: rearrange help for 'go test'
Put the 'go test' flags into 'go help test', so 'go help testflags'
is about the flags for the compiled test binary.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5641060
2012-02-09 14:12:18 +11:00
Shenghou Ma
119917375b cmd/dist: redure max background tasks nr. when building on ARM
R=rsc
CC=golang-dev
https://golang.org/cl/5642063
2012-02-08 16:26:00 -05:00
Russ Cox
56ade2d8d5 cmd/go: let go tool invocation use stdin
Fixes #2921.

R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/5647057
2012-02-08 16:14:24 -05:00
Russ Cox
596840a905 cmd/dist: make 'make' quieter for developers
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5646055
2012-02-08 15:26:47 -05:00
Shenghou Ma
1127b22976 cmd/dist: pass correct -DGOARCH_$GOARCH flag to gcc.
R=rsc
CC=golang-dev
https://golang.org/cl/5643061
2012-02-08 14:36:38 -05:00
Robert Griesemer
467f8751f9 gofmt: replace defunct test.sh with a go test
R=r, rsc
CC=golang-dev
https://golang.org/cl/5639053
2012-02-08 08:47:02 -08:00
Dmitriy Vyukov
bd37349485 cmd/dist: fix copying of cmd/prof
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5642059
2012-02-08 20:15:17 +04:00
Russ Cox
136f12f51f cmd/dist: pass -m32 or -m64 to link too, not just compile
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5646053
2012-02-08 11:12:14 -05:00
Russ Cox
5b93fc9da6 runtime, pprof: add profiling of thread creation
Same idea as heap profile: how did each thread get created?
Low memory (256 bytes per OS thread), high reward for
programs that suddenly have many threads running.

Fixes #1477.

R=golang-dev, r, dvyukov
CC=golang-dev
https://golang.org/cl/5639059
2012-02-08 10:33:54 -05:00
Jamie Gennis
fff732ea2c 6g,8g: make constant propagation inlining-friendly.
This changes makes constant propagation compare 'from' values using node
pointers rather than symbol names when checking to see whether a set
operation is redundant. When a function is inlined multiple times in a
calling function its arguments will share symbol names even though the values
are different. Prior to this fix the bug409 test would hit a case with 6g
where an LEAQ instruction was incorrectly eliminated from the second inlined
function call. 8g appears to have had the same bug, but the test did not fail
there.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5646044
2012-02-08 10:25:13 -05:00
Brad Fitzpatrick
878608bd29 cmd/go: connect os.Stdin for go run
Fixes #2875

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5641052
2012-02-08 16:30:28 +11:00
Russ Cox
3f6a517db6 cmd/dist: respect $CC, as quietgcc.bash used to
R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/5641051
2012-02-08 00:22:38 -05:00
Rob Pike
9af4b01654 5l: attempt to fix arm build
TBR=rsc

R=golang-dev
CC=golang-dev
https://golang.org/cl/5647049
2012-02-08 15:12:56 +11:00
Brad Fitzpatrick
f23a6dba5e cmd/api: compare multiple contexts
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5626045
2012-02-07 18:13:11 -08:00
Nigel Tao
5e381d3a9a image: delete the image.Repeated type.
R=r
CC=golang-dev
https://golang.org/cl/5636045
2012-02-08 11:41:47 +11:00
Robert Griesemer
3d6b368514 go/printer, gofmt: don't print incorrect programs
Be careful when printing line comments with incorrect
position information. Maintain additional state
impliedSemi: when set, a comment containing a newline
would imply a semicolon and thus placement must be
delayed.

Precompute state information pertaining to the next
comment for faster checks (the printer is marginally
faster now despite additional checks for each comment).

No effect on existing src, misc sources.

Fixes #1505.

R=rsc
CC=golang-dev
https://golang.org/cl/5598054
2012-02-07 15:19:52 -08:00
Russ Cox
e3755434b8 5l, 6l, 8l: implement -X flag
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5643050
2012-02-07 16:46:33 -05:00
Gustavo Niemeyer
c2fe6634db cmd/dist: prevent race on VERSION creation
Commands such as "dist version > VERSION" will cause
the shell to create an empty VERSION file and set dist's
stdout to its fd. dist in turn looks at VERSION and uses
its content if available, which is empty at this point.

Fix that by ignoring VERSION if it's empty.

Also prevent cmdversion from running findgoversion a
second time. It was already loaded by init.

R=adg, gustavo, rsc
CC=golang-dev
https://golang.org/cl/5639044
2012-02-07 00:38:15 -02:00
Robert Griesemer
4151183e94 fix build: wrong godoc code submitted before
R=r
CC=golang-dev
https://golang.org/cl/5644044
2012-02-06 17:54:20 -08:00
Robert Griesemer
668418d122 go/token: remove dependency on encoding/gob
R=dsymonds
CC=golang-dev
https://golang.org/cl/5636053
2012-02-06 17:41:19 -08:00
Rémy Oudompheng
0d07600de3 cgo: print line numbers in fatal errors when relevant.
Signatures of fatalf and error_ helpers have been matched for
consistency.
Fixes #1800.

R=rsc
CC=golang-dev, remy
https://golang.org/cl/5593049
2012-02-06 20:38:54 +01:00
Russ Cox
fec7fa8b9d build: delete make paraphernalia
As a convenience to people working on the tools,
leave Makefiles that invoke the go dist tool appropriately.
They are not used during the build.

R=golang-dev, bradfitz, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5636050
2012-02-06 13:34:25 -05:00
Russ Cox
e335ec98b5 cmd/dist: ignore file names beginning with . or _
This is the same heuristic that build.ScanDir uses.
It avoids considering 'resource fork' files on OS X;
the resource for x.go is ._x.go.

R=gri
CC=golang-dev
https://golang.org/cl/5616073
2012-02-06 13:33:22 -05:00
Rémy Oudompheng
842c906e2e runtime: delete UpdateMemStats, replace with ReadMemStats(&stats).
Unexports runtime.MemStats and rename MemStatsType to MemStats.
The new accessor requires passing a pointer to a user-allocated
MemStats structure.

Fixes #2572.

R=bradfitz, rsc, bradfitz, gustavo
CC=golang-dev, remy
https://golang.org/cl/5616072
2012-02-06 19:16:26 +01:00
Shenghou Ma
6392b43a15 8a, 8l: implement support for RDTSC instruction.
Also modify runtime/asm_386.s to use it.

R=rsc
CC=golang-dev
https://golang.org/cl/5634043
2012-02-06 12:49:28 -05:00
Anthony Martin
7ac03695f8 build: remove unnecessary pragmas
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5629055
2012-02-06 12:45:23 -05:00
Sanjay Menakuru
39611ec880 cmd/go: fixed panic on go clean -n and go clean -x.
also made generated scripts act more like running go clean itself

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/5624049
2012-02-06 12:40:59 -05:00
Russ Cox
74ee51ee92 cmd/gc: disallow switch _ := v.(type)
Fixes #2827.

R=ken2
CC=golang-dev
https://golang.org/cl/5638045
2012-02-06 12:35:29 -05:00
Jeff Hodges
eac86fd3f0 cmd/go: pass env CGO_CFLAGS to cgo
Passing the CGO_CFLAGS to cgo is required to make alternative include
directories work when building a cgo project.

R=rsc
CC=golang-dev
https://golang.org/cl/5635048
2012-02-06 11:26:15 -05:00
Luuk van Dijk
0b9f090861 cmd/gc: another special (%hhS) case for method names.
Fixes #2877

R=rsc
CC=golang-dev
https://golang.org/cl/5637047
2012-02-06 16:38:59 +01:00
Luuk van Dijk
5efd5624cc cmd/gc: fix codegen reordering for expressions involving && and ||
Fixes #2821.

R=rsc
CC=golang-dev
https://golang.org/cl/5606061
2012-02-06 15:41:01 +01:00
Luuk van Dijk
419c53af30 gc: don't print implicit type on struct literal in export
As pointed out in the discussion around 2678.

R=rsc
CC=golang-dev
https://golang.org/cl/5534077
2012-02-06 12:19:59 +01:00
Kyle Lemons
cb0de68a08 cmd/go: build: print import errors when invoked on files
This fix makes the goFilesPackage helper function print the errors from
      package imports and exit similar to how the packagesForBuild function does.

      Without this change, when invoking "go build *.go" with, for example,
      an old import path, the following stack trace is generated:

      panic: runtime error: invalid memory address or nil pointer dereference

      goroutine 1 [running]:
      go/build.(*Tree).PkgDir(...)
              /opt/go/src/pkg/go/build/path.go:52 +0xfb
      main.(*builder).action(...)
              /opt/go/src/cmd/go/build.go:327 +0xb8
      main.(*builder).action(...)
              /opt/go/src/cmd/go/build.go:335 +0x208
      main.runBuild(...)
              /opt/go/src/cmd/go/build.go:129 +0x386
      main.main()
              /opt/go/src/cmd/go/main.go:126 +0x2d8

Fixes #2865.

R=rsc, dvyukov, r
CC=golang-dev
https://golang.org/cl/5624052
2012-02-06 14:10:03 +11:00
Alex Brainman
c06bd52a2e cmd/dist: fix bug in bsubst
R=golang-dev, r, dsymonds, akumar
CC=golang-dev
https://golang.org/cl/5624054
2012-02-05 15:16:39 +11:00
Gustavo Niemeyer
1d69b12445 cmd/dist: add GOBIN to env's output
clean.bash depends on it being set.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5630056
2012-02-05 00:35:08 -02:00
Russ Cox
57b7bbe988 cmd/dist: fix memory bug (fix builders?)
Thanks, Valgrind!

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5630050
2012-02-04 02:15:53 -05:00
Russ Cox
a19ab9d1cc cmd/dist: fix arm build
5l does not use the whole set of ld files
like the other linkers do.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5629052
2012-02-04 02:01:58 -05:00
Russ Cox
650e8de0a5 cmd/dist: more build fixes
Flush stdout before writing to stderr, to avoid
reordering output.

Allow amd64 from uname -m (FreeBSD).

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5629051
2012-02-04 01:46:46 -05:00
Russ Cox
68576506d6 cmd/dist: add BSD gohostos cases
Should fix FreeBSD build.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5629050
2012-02-04 01:39:29 -05:00
Russ Cox
b8b2253ac7 cmd/dist: fix build
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5630049
2012-02-04 01:23:54 -05:00
Russ Cox
4c1abd6c64 build: dist-based build for windows
R=golang-dev, bradfitz, iant, alex.brainman, go.peter.90
CC=golang-dev
https://golang.org/cl/5630047
2012-02-04 00:48:31 -05:00
Mikio Hara
67b277c3b9 cmd/dist: fix build on openbsd
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5608060
2012-02-04 13:27:12 +09:00
Russ Cox
c6c00ed482 cmd/dist: generate files for package runtime
goc2c moves here.
parallel builds like old makefiles (-j4).
add clean command.
add banner command.
implement Go version check.
real argument parsing (same as 6g etc)

Windows changes will be a separate CL.

R=golang-dev, bradfitz, iant
CC=golang-dev
https://golang.org/cl/5622058
2012-02-03 18:16:42 -05:00
Rob Pike
2783691522 docs: replace references to gofix etc. with tool invocations
R=rsc
CC=golang-dev
https://golang.org/cl/5630045
2012-02-04 07:49:51 +11:00
Rob Pike
1f565e7d20 tools: update references to "x" to be "go tool x"
For instance, don't talk about gofix, talk about the
fix tool or "go tool fix".

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5608053
2012-02-04 07:03:20 +11:00
Robert Griesemer
f6f5ce87cd godoc: fix identifier search
Thanks to Andrey Mirtchovski for tracking this down.

This was broken by CL 5528077 which removed the InsertSemis
flag from go/scanner - as a result, semicolons are now always
inserted and the respective indexer code checked for the
wrong token.

Replaced the code by a direct identifier test.

R=rsc
CC=golang-dev
https://golang.org/cl/5606065
2012-02-03 09:20:53 -08:00
Robert Griesemer
bd41831f66 godoc: diagnostic for empty FS tree
R=adg
CC=golang-dev
https://golang.org/cl/5615055
2012-02-03 08:33:29 -08:00
Russ Cox
0f78ee574b 5a, 6a, 8a, cc: check in y.tab.[ch]
This enables builds on systems without Bison/yacc.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5622050
2012-02-03 10:53:51 -05:00
Russ Cox
d53cdd1775 gc: check in y.tab.[ch], yerr.h, builtin.c.
This enables builds on systems without Bison/yacc.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5622051
2012-02-03 10:53:31 -05:00
Gustavo Niemeyer
7207898fe4 cmd/go: add support for release tags via git branches
R=rsc, remyoudompheng, gustavo, dsymonds
CC=golang-dev
https://golang.org/cl/5617057
2012-02-03 03:03:13 -02:00
Russ Cox
b3750ff52d build: rename $GOROOT/bin/go-tool to $GOROOT/bin/tool.
The go- is redundant now that the directory is required
to be inside $GOROOT.  Rob LGTMed the idea.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5618044
2012-02-02 23:32:41 -05:00
Nigel Tao
9de9c95787 vet: add a check for untagged struct literals.
R=rsc, dsymonds
CC=golang-dev, gri
https://golang.org/cl/5622045
2012-02-03 14:33:41 +11:00
Gustavo Niemeyer
20f4385af0 os: turn FileStat.Sys into a method on FileInfo
This reduces the overhead necessary to work with OS-specific
file details, hides the implementation of FileStat, and
preserves the implementation-specific nature of Sys.

Expressions such as:

  stat.(*os.FileInfo).Sys.(*syscall.Stat_t).Uid
  fi1.(*os.FileStat).SameFile(fi2.(*os.FileStat))

Are now spelled as::

  stat.Sys().(*syscall.Stat_t).Uid
  os.SameFile(fi1, fi2)

R=cw, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5448079
2012-02-03 00:16:18 -02:00
Russ Cox
3dd1e5be54 cmd/dist: new command
dist is short for distribution.  This is the new Go distribution tool.

The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.

It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.

This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap).  I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.

This tool is not nearly as nice as the go tool.  There are many
special cases that turn into simple if statements or tables in
the code.  Please forgive that.  C does not enjoy the benefits
that we designed into Go.

I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments.  Make thinks it is invoking

        quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c

but bash (quietgcc is a bash script) thinks it is being invoked as

        quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c

which obviously does not have the desired effect.  Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.

It is big for a single CL, and for that I apologize.  I can cut it into
separate CLs along file boundaries if people would prefer that.

R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
2012-02-02 19:41:39 -05:00
Rémy Oudompheng
e489ab8ecc cmd/go: fix error message on non-existing tools.
R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5617053
2012-02-02 23:52:30 +01:00
Anthony Martin
4b6cd239c5 gc: describe debugging flags
The change to -m is the only one necessary
to close the issue.  The others are useful
to know about when debugging but shouldn't
be in the usage message since they may go
away or change at any time.

Fixes #2802.

R=lvd, rsc
CC=golang-dev
https://golang.org/cl/5606046
2012-02-02 14:02:54 -08:00
Nigel Tao
df7f34dd2b vet: fix comment typo.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/5620049
2012-02-02 17:53:28 +11:00
Andrew Gerrand
40b7e814e5 godoc: update metadata in appinit.go
R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/5619050
2012-02-02 15:18:33 +11:00
Robert Griesemer
f3f5239d1e all packages: fix various typos
Detected semi-automatically. There are probably more.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5620046
2012-02-01 16:19:36 -08:00
Gustavo Niemeyer
9fb24b9448 cmd/go: fix including of _cgo_export.h
This will add the temporary object directory into the lookup
path so that cgo-exported function declarations may be
included from C files.

This was previously applied by CL 5600043, and apparently
removed by mistake on CL 5598045.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5610054
2012-02-01 16:07:32 -02:00
Sameer Ajmani
702151a200 godoc: fix redirect loop for URL "/".
R=golang-dev, bradfitz, rsc, adg
CC=golang-dev
https://golang.org/cl/5606045
2012-02-01 09:43:22 -05:00
Anthony Martin
e280035fc1 gc, cc: avoid using the wrong library when building the compilers
This can happen on Plan 9 if we we're building
with the 32-bit and 64-bit host compilers, one
after the other.

R=rsc
CC=golang-dev
https://golang.org/cl/5599053
2012-02-01 04:14:37 -08:00
Anthony Martin
6273d6e713 build: move the "-c" flag into HOST_CFLAGS
On Plan 9 this flag is used to discover
constant expressions in "if" statements.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5601060
2012-01-31 19:31:30 -08:00
Anthony Martin
8039683cef gc: use octal escapes in mkopnames
Plan 9's tr(1) doesn't accept the C-style escapes
for tab and newline characters.  I was going to use
the \xFF hexadecimal escapes but GNU tr(1) doesn't
accept those.  It seems octal is the least common
denominator.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5576079
2012-01-31 18:15:42 -08:00
Russ Cox
42526e2187 cmd/go: improvements
Print all the syntax errors.  Fixes issue 2811.

Change Windows binary removal strategy.
This should keep the temporary files closer to
the binaries they are for, which will make it
more likely that the rename is not cross-device
and also make it easier to clean them up.
Fixes #2604 (as much as we can).

The standard build does not use the go command
to install the go command anymore, so issue 2604
is less of a concern than it originally was.
(It uses the go_bootstrap command to install
the go command.)

Buffer 'go list' output.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5604048
2012-01-31 18:44:20 -05:00
Russ Cox
0f1056667f cmd/go: improvements
Do not treat $GOROOT/src/pkg, $GOROOT/src/cmd,
$GOPATH/src as package directories (only subdirectories
of those can be package directories).  Fixes issue 2602.

Accept additional compiler and linker arguments during
cgo from $CGO_CFLAGS and $CGO_LDFLAGS, as the
Makefiles used to do.

Show failed pkg-config output.  Fixes issue 2785.

Use different (perhaps better) git commands.  Fixes issue 2109.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5605045
2012-01-31 17:40:36 -05:00
Rémy Oudompheng
e818536500 go: record location of failed imports for error reporting.
Fixes #2664.

R=rsc
CC=golang-dev, remy
https://golang.org/cl/5593047
2012-01-31 23:37:01 +01:00
Russ Cox
33f3afa7af gc: diagnose \ in import path
R=ken2
CC=golang-dev
https://golang.org/cl/5609044
2012-01-31 17:29:59 -05:00
Russ Cox
64a73b0355 cmd/go: improvements
Print build errors to stderr during 'go run'.
Stream test output during 'go test' (no args).  Fixes issue 2731.
Add go test -i to install test dependencies.  Fixes issue 2685.
Fix data race in exitStatus.  Fixes issue 2709.
Fix tool paths.  Fixes issue 2817.

R=golang-dev, bradfitz, n13m3y3r, r
CC=golang-dev
https://golang.org/cl/5591045
2012-01-31 15:08:20 -05:00
Rémy Oudompheng
d7172084d0 cmd/go: fix handling of gccgo standard library.
The previous logic was mainly non-working. It only needs to
ensure that the go tool doesn't try to build the standard
library with gccgo.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5580051
2012-01-31 19:41:38 +01:00
Robert Griesemer
3c6bebf5a7 go/doc: enable AllMethods flag (and fix logic)
- enable AllMethods flag (default: not set)
- fix logic determining which methods to show
- added respective test case in testdata/e.go for AllMethods = false
- added test case set for AllMethods = true

The critical changes/files to look at are:
- testdata/e{0,1,2}.golden: T4.M should only show up as method of T5 in e2.golden
- reader.go: always include top-level methods, and negate former logic for embedded methods
  (rewrote as a switch for better comprehensability)

Fixes #2791.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5576057
2012-01-31 09:48:10 -08:00
Shenghou Ma
2d64bab1de 5l: optimize the common case in patch()
If p->to.sym->text is non-nil, then no need to search for sym->value.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5601046
2012-01-31 10:59:34 -05:00
Shenghou Ma
94b796133b 5l: make -v option output less nonessential clutter
5l -v is for benchmarking various parts of the loader, but this code in
        obj.c will clutter the output. I only comment them out, because this is
        on par with 8l/6l.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5600046
2012-01-31 10:59:29 -05:00
Russ Cox
9a15c2186c build: move goapi, quietgcc, cgo, gotype, ebnflint into go-tool
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5552054
2012-01-31 10:38:07 -05:00
Joel Sing
6f428f0979 cmd/go: clean test directories as they complete
A go build currently generates around 400MB of test output prior to
cleaning up. With this change we use a maximum of ~15MB.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5588044
2012-01-31 10:37:21 -05:00
Wei Guangjing
f8e9bbe475 cmd/ld: fix gdbscript
R=golang-dev, lvd
CC=golang-dev
https://golang.org/cl/5601058
2012-01-31 10:32:24 -05:00
Russ Cox
2050a9e478 build: remove Make.pkg, Make.tool
Consequently, remove many package Makefiles,
and shorten the few that remain.

gomake becomes 'go tool make'.

Turn off test phases of run.bash that do not work,
flagged with $BROKEN.  Future CLs will restore these,
but this seemed like a big enough CL already.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
2012-01-30 23:43:46 -05:00
Russ Cox
00e9a54dad go: improvements
Add 'go clean'.
Make 'go build' write to pkgname, not a.out.
Make 'go test -c' write to pkgname.test, not test.out.
Make 'go install' write alternate binaries to .../bin/goos_goarch/.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5600048
2012-01-30 23:42:41 -05:00