1
0
mirror of https://github.com/golang/go synced 2024-10-02 08:08:33 -06:00
Commit Graph

62 Commits

Author SHA1 Message Date
Yasuhiro Matsumoto
1042572528 src: Make.pkg don't create $(TARGDIR) with goinstall.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4548071
2011-05-30 12:35:55 +10:00
Andrew Gerrand
ca8a055f5c goinstall: support GOPATH; building and installing outside the Go tree
For example, with GOPATH set like so
        GOPATH=/home/adg/gocode
And after creating some subdirectories
        mkdir /home/adg/gocode/{bin,pkg,src}

I can use goinstall to install the github.com/nf/goto web server,
which depends on the github.com/nf/stat package, with
        goinstall github.com/nf/goto

This downloads and installs all dependencies (that aren't already
installed) like so
        /home/adg/gocode/bin/goto
        /home/adg/gocode/pkg/darwin_amd64/github.com/nf/stat.a
        /home/adg/gocode/src/github.com/nf/goto/...
        /home/adg/gocode/src/github.com/nf/stat/...

R=rsc, niemeyer
CC=golang-dev
https://golang.org/cl/4438043
2011-04-27 11:00:34 +10:00
Russ Cox
0ea7bf4867 src/pkg/Makefile: trim per-directory make output except on failure
Not committed to this but it sure makes
the output easier to skim.  With this CL:

$ make
install runtime
install sync/atomic
install sync
install unicode
install utf16
install syscall
install os
...
install ../cmd/govet
install ../cmd/goyacc
install ../cmd/hgpatch
$ make test
test archive/tar
test archive/zip
test asn1
test big
test bufio
...
test path
test path/filepath
TEST FAIL reflect
gotest
rm -f _test/reflect.a
6g -o _gotest_.6 deepequal.go type.go value.go
rm -f _test/reflect.a
gopack grc _test/reflect.a _gotest_.6
all_test.go:210: invalid type assertion: reflect.NewValue(tt.i).(*StructValue) (non-interface type reflect.Value on left)
all_test.go:217: cannot type switch on non-interface value v (type reflect.Value)
all_test.go:218: undefined: IntValue
all_test.go:221: cannot use 132 (type int) as type reflect.Value in function argument
all_test.go:223: cannot use 8 (type int) as type reflect.Value in function argument
all_test.go:225: cannot use 16 (type int) as type reflect.Value in function argument
all_test.go:227: cannot use 32 (type int) as type reflect.Value in function argument
all_test.go:229: cannot use 64 (type int) as type reflect.Value in function argument
all_test.go:231: undefined: UintValue
all_test.go:234: cannot use 132 (type int) as type reflect.Value in function argument
all_test.go:234: too many errors
gotest: "/Users/rsc/g/go/bin/6g -I _test -o _xtest_.6 all_test.go tostring_test.go" failed: exit status 1
make[1]: *** [test] Error 2
make: *** [reflect.test] Error 1

R=r, r2
CC=golang-dev
https://golang.org/cl/4343046
2011-04-06 15:06:28 -04:00
Ian Lance Taylor
60cfb63bd4 Make.pkg: increase test timeout to 120 seconds.
R=r, peterGo
CC=golang-dev
https://golang.org/cl/4344053
2011-04-02 22:23:34 -07:00
Ian Lance Taylor
554082d6b1 testing: add -test.timeout option.
Since Go code can deadlock, this lets a testsuite driver set a
time limit for the test to run.  This is simple but imperfect,
in that it only catches deadlocks in Go code, not in the
runtime scheduler.

R=r, rsc, iant2
CC=golang-dev
https://golang.org/cl/4326048
2011-03-31 15:27:51 -07:00
Rob Pike
d406f8f650 testing: set up structure for faster testing using the new -test.short flag.
New make target "testshort" runs "gotest -test.short" and is invoked
by run.bash, which is invoked by all.bash.

Use -test.short to make one package (crypto ecdsa) run much faster.
More changes to come.

Once this is in, I will update the long-running tests to use the new flag.

R=rsc
CC=golang-dev
https://golang.org/cl/4317043
2011-03-25 14:50:44 -07:00
Ian Lance Taylor
bc0469da33 Make.pkg: Always define _CGO_CFLAGS and friends.
Submitting TBR to fix Darwin build.

TBR=rsc
CC=golang-dev
https://golang.org/cl/4273096
2011-03-22 13:30:16 -07:00
Ian Lance Taylor
f91b37b962 Make.pkg: add support for SWIG, and add two SWIG examples
The SWIG examples are not yet built or tested by default.

R=r, rsc, iant2
CC=golang-dev
https://golang.org/cl/4287056
2011-03-22 13:05:51 -07:00
Russ Cox
59d2acd2d4 build: remove old cgo files
Cgo changed to write these files into _obj, but some
trees may still have the old ones in the source directory.
They need to be removed during make clean so that
a subsequent build will use the ones in _obj.

R=r, r2
CC=golang-dev
https://golang.org/cl/4254056
2011-03-06 17:04:24 -05:00
Russ Cox
2d404c4bff fix build (observed in wild, not on dashboard)
TBR=r
CC=golang-dev
https://golang.org/cl/4257054
2011-03-03 11:51:16 -05:00
Russ Cox
f104a198e4 fix build
TBR=rog
CC=golang-dev
https://golang.org/cl/4259046
2011-03-02 14:52:35 -05:00
Roger Peppe
9704d4ec3d cgo: put temporary source files in _obj.
Fixes #1572.
Initially I tried changing things so all object
files get put in _obj, but it's too much - everything
needs changing. Perhaps some other time.

R=rsc
CC=golang-dev
https://golang.org/cl/4237050
2011-03-02 14:22:33 -05:00
Russ Cox
820dc9ff1a runtime: fix signal stack bug
In CL 4188061 I changed malg to allocate the requested
number of bytes n, not n+StackGuard, so that the
allocations would use rounder numbers.

The allocation of the signal stack asks for 32k and
then used g->stackguard as the base, but g->stackguard
is StackGuard bytes above the base.  Previously, asking
for 32k meant getting 32k+StackGuard bytes, so using
g->stackguard as the base was safe.  Now, the actual base
must be computed, so that the signal handler does not
run StackGuard bytes past the top of the stack.

Was causing flakiness mainly in programs that use the
network, because they sometimes write to closed network
connections, causing SIGPIPEs.  Was also causing problems
in the doc/progs test.

Also fix Makefile so that changes to stack.h trigger rebuild.

R=bradfitzgo, r, r2
CC=golang-dev
https://golang.org/cl/4230044
2011-02-24 13:46:44 -08:00
Russ Cox
8b8d5e9e00 build: remove _gcc_main.c during make clean
R=r, r2
CC=golang-dev
https://golang.org/cl/4226043
2011-02-23 15:51:27 -05:00
Kyle Consalus
07cc8b9ad2 Make.pkg, doc: Replace references to "-benchmarks" and "-match" with "-test.bench" and "-test.run".
R=r
CC=golang-dev
https://golang.org/cl/4197041
2011-02-22 20:23:21 -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
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
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
Gustavo Niemeyer
4fd867b283 cgo: define CGO_CFLAGS and CGO_LDFLAGS in Go files
R=rsc, binet
CC=golang-dev
https://golang.org/cl/3921043
2011-02-01 08:44:18 -05:00
Russ Cox
c1fbe589a9 Make.pkg: use installed runtime.h for cgo
Fixes #1381.

R=r, r2
CC=golang-dev
https://golang.org/cl/3775050
2011-01-06 15:15:22 -05:00
Russ Cox
3832389036 fix cgo build
R=r
CC=golang-dev
https://golang.org/cl/3750041
2010-12-17 13:22:20 -08:00
Russ Cox
6c6d53052e cgo: handle references to symbols in shared libraries
Fixes #1334.

R=r
CC=golang-dev
https://golang.org/cl/3746041
2010-12-17 11:37:11 -08:00
Russ Cox
0cd3475386 misc/cgo/life: fix, add to build
#pragma dynexport is no longer needed for
this use of cgo, since the gcc and gc code are
now linked together into the same binary.
It may still be necessary later.

On the Mac, you cannot use the GOT to resolve
symbols that exist in the current binary, so 6l and 8l
translate the GOT-loading mov instructions into lea
instructions.

On ELF systems, we could use the GOT for those
symbols, but for consistency 6l and 8l apply the
same translation.

The translation is sketchy in the extreme
(depending on the relocation being in a mov
instruction) but it verifies that the instruction
is a mov before rewriting it to lea.

Also makes typedefs global across files.

Fixes #1335.
Fixes #1345.

R=iant, r
CC=golang-dev
https://golang.org/cl/3650042
2010-12-17 09:51:55 -08:00
Russ Cox
14d677ecba cgo: new cgo
Very few changes here: the subtle ones are in Make.pkg.

Note that incredibly (and importantly) there are
no changes necessary to the test programs in misc/cgo.

R=iant
CC=golang-dev
https://golang.org/cl/3504041
2010-12-08 13:56:51 -05:00
Ian Lance Taylor
1fab0cd12a Makefiles: Don't define _64BIT now that 6c does it by default.
R=rsc
CC=golang-dev
https://golang.org/cl/3207041
2010-11-18 12:34:47 -08:00
Wei Guangjing
035696c59a debug/pe, cgo: add windows support
R=rsc, mattn
CC=golang-dev
https://golang.org/cl/1976045
2010-11-01 17:52:26 -04:00
Russ Cox
f481afae53 Make.pkg: remove .so before installing new one
On Linux, overwriting an mmap'ed file causes
all the MAP_PRIVATE pages to get refreshed
with the new content, even ones that have been
modified by the process that did the mmap.

One specific instance of this is that after the
dynamic linker has relocated a page from a .so,
overwriting the .so will un-relocate it, making
the next use of one of the no-longer-relocated
addresses incorrect and probably crash the
program.

Linux must go out of its way to break programs
in this way: the pages have already been copied
on write, so they're not shared with the file system
cache, and it trashes them anyway.  The manual
says the behavior when the file gets overwritten
is "undefined".  Removing before copy avoids the
undefined behavior.

R=iant
CC=golang-dev, msolo
https://golang.org/cl/2333045
2010-10-01 16:02:18 -04:00
Joe Poirier
1d62becbd8 build: generate, clean .exe files on Windows
R=rsc, brainman, vcc
CC=golang-dev
https://golang.org/cl/2165044
2010-09-09 01:42:55 -04:00
Jukka-Pekka Kekkonen
1cec72cff1 build: work with GNU Make 3.82
Fix building on GNU Make 3.82 (caused by mixed implicit and normal
rules).

The issue was introduced in changeset 6110:ca0beac3b543.

R=rsc
CC=golang-dev
https://golang.org/cl/2100044
2010-09-07 15:14:14 -04:00
Russ Cox
9f24d3686f Make.pkg: never use quietgcc
R=iant
CC=golang-dev
https://golang.org/cl/2033041
2010-08-26 20:21:34 -04:00
Russ Cox
d3a2dcf5a8 build: fix cgo with -j2
a b: c expands to multiple rules,
which then run in parallel.

R=r, iant
CC=golang-dev
https://golang.org/cl/2007047
2010-08-26 18:47:34 -04:00
Russ Cox
423e410258 gotest: allow make test of cgo packages (without make install)
R=r
CC=golang-dev, stevvooe
https://golang.org/cl/1995051
2010-08-25 18:00:42 -04:00
Russ Cox
aafe474ec9 build: $GOBIN defaults to $GOROOT/bin
R=r
CC=golang-dev
https://golang.org/cl/1982049
2010-08-24 20:00:33 -04:00
Russ Cox
9867ced972 cgo: use new command line syntax: -- separates cgo flags from gcc flags
Fixes #922.

R=r
CC=golang-dev
https://golang.org/cl/1664051
2010-07-15 09:41:21 -07:00
Russ Cox
489494cac3 cgo: use slash-free relative paths for .so references
The Makefile and cgo now rewrite / to _ when creating the path.
The .so for gosqlite.googlecode.com/hg/sqlite is named
cgo_gosqlite.googlecode.com_hg_sqlite.so, and then 6l and 8l
both include a default rpath of $GOROOT/pkg/$GOOS_$GOARCH.
This should make it easier to move binaries from one system
to another.

Fixes #857.

R=iant, r
CC=golang-dev
https://golang.org/cl/1700048
2010-06-30 23:31:27 -07:00
Ian Lance Taylor
b3901dc1d8 Add _cgo_export.[ch] targets so that make knows how they are
built.  Note that they are only built if a //export comment
appears, so other targets should only use them if there is
such a comment.

Fixes #723.

R=rsc
CC=golang-dev
https://golang.org/cl/1073041
2010-05-03 11:07:22 -07:00
Ian Lance Taylor
12e7ce95c6 Add //export to cgo.
The new //export comment marks a Go function as callable from
C.  The syntax is "//export NAME" where NAME is the name of
the function as seen from C.  If such a comment is seen, cgo
will generate two new files: _cgo_export.h and _cgo_export.c.
The _cgo_export.h file provides declarations which C code may
use to call Go functions.  The _cgo_export.c file contains
wrappers, and is to be compiled with gcc.

The changes to Make.pkg support using this from a Go Makefile,
though it could probably be more convenient.

R=rsc
CC=golang-dev
https://golang.org/cl/853042
2010-04-09 13:31:05 -07:00
Russ Cox
6962e2b754 make: use actual dependency for install
otherwise "make install" runs cp unconditionally

R=r
CC=golang-dev
https://golang.org/cl/802044
2010-03-30 10:44:51 -07:00
Rob Pike
14abacf108 Factor the Makefiles to make writing outside Makefiles easier.
R=rsc
CC=golang-dev
https://golang.org/cl/650042
2010-03-19 15:14:46 -07:00
Ian Lance Taylor
7c99dcbdf9 Install runtime.h and cgocall.h.
This permits cgo generated code to use these header files even
if the Go sources are not around.

R=rsc
CC=golang-dev
https://golang.org/cl/224045
2010-02-24 17:00:25 -08:00
Adam Langley
cbd3b2e8d5 Add 'bench' target to makefiles.
R=rsc, agl, r
CC=golang-dev
https://golang.org/cl/188043
2010-01-12 15:43:20 -08:00
Devon H. O'Dell
2eb9171dfb Fix missing explicit GOBIN in src/pkg/Makefile. Clean up creation of
QUOTED_GOBIN. Re-take of 181077; fixes copy-pasta that broke build.

Fixes #468

R=rsc
CC=golang-dev
https://golang.org/cl/183125
2010-01-06 07:47:56 -08:00
Russ Cox
32594bd43d rollback of https://golang.org/cl/181077
(broke build)

TBR=dho
https://golang.org/cl/181139
2010-01-05 16:54:27 -08:00
Devon H. O'Dell
e032ab9dc8 Fix missing explicit GOBIN in src/pkg/Makefile. Clean up creation of QUOTED_GOBIN
Fixes #468

R=rsc
CC=golang-dev
https://golang.org/cl/181077
2010-01-05 16:22:40 -08:00
Russ Cox
c276d87c6c cgo: interpret $CGOPKGDIR as absolute path if rooted
R=dho
CC=golang-dev
https://golang.org/cl/180099
2009-12-21 08:31:02 -08:00
Russ Cox
10e85dfee4 Make.pkg: fix cgo for TARG=a/b
R=dho, phf
CC=golang-dev
https://golang.org/cl/180082
2009-12-17 17:28:22 -08:00
Devon H. O'Dell
9277b02537 Allow cgo to accept multiple .go inputs for a package
Fixes #342.

R=rsc
CC=golang-dev
https://golang.org/cl/179062
2009-12-17 13:20:56 -08:00
Devon H. O'Dell
857d4cf1a9 Remove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src
This change removes the necessity to have GOBIN in $PATH,
and also doesn't assume that the build is being run from
$GOROOT/src. This is a minimal set of necessary changes
to get Go to build happily from the FreeBSD ports
collection.

R=rsc
CC=golang-dev
https://golang.org/cl/171044
2009-12-11 15:14:09 -08:00
Sergio Luis O. B. Correia
6fc820729e go: makes it build for the case $GOROOT has whitespaces
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.

this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.

Fixes #115.

R=rsc, dsymonds1
https://golang.org/cl/157067
2009-11-23 17:32:51 -08:00
Russ Cox
9bc6a404d5 cgo: allow .so in subdirectories
R=r
https://golang.org/cl/157103
2009-11-20 00:31:03 -08:00