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

106 Commits

Author SHA1 Message Date
Ian Lance Taylor
3197be4807 cmd/dist, cmd/ld: GO_EXTLINK_ENABLED=0 defaults to -linkmode=internal
Change build system to set GO_EXTLINK_ENABLED=0 by default for
OS X 10.6, since the system linker has a bug and can not
handle the object files generated by 6l.

Fixes #5130.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8183043
2013-03-29 16:33:35 -07:00
Rob Pike
36ed57931b make.bash: delete vestigial TODO, now resolved
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7789050
2013-03-16 14:53:12 -07:00
Rob Pike
4ce79096b6 go/types: delete from main repo; part of move to go.exp
See also https://golang.org/cl/7656044

R=golang-dev, gri, rsc
CC=golang-dev
https://golang.org/cl/7625048
2013-03-12 13:55:58 -07:00
Rob Pike
a25486e4b1 make.bash,bat: add -tags gotypes to the build
This installs type checking into go vet.
(To be removed before releasing Go 1.1)

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7528044
2013-03-06 13:16:43 -08:00
Russ Cox
6d888f1e1b build: clang support
This works with at least one version of clang
that existed at one moment in time.
No guarantees about clangs past or future.

To try:
        CC=clang all.bash

It does not work with the Xcode clang,
because that clang fails at printing a useful answer
to:
        clang -print-libgcc-file-name
The clang that works prints a full path name for
that command, not just "libgcc.a".

Fixes #4713.

R=iant, minux.ma
CC=golang-dev
https://golang.org/cl/7323068
2013-02-15 13:37:43 -08:00
Elias Naur
fe14ee52cc cmd/6c, cmd/6g: add flag to support large-model code generation
Added the -pic flag to 6c and 6g to avoid assembler instructions that
cannot use RIP-relative adressing. This is needed to support the -shared mode
in 6l.

See also:
https://golang.org/cl/6926049
https://golang.org/cl/6822078

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7064048
2013-02-01 08:35:33 -08:00
Dave Cheney
3167c12eb2 cmd/dist: support building on debian/kFreeBSD
The debian/kFreeBSD project uses the FreeBSD kernel and the debian userspace. From our point of view, this is freebsd not linux as GOOS talks about the kernel syscall interface, not the userspace (although cgo alters that). As debian/kFreeBSD is experimental at this time, I do not think it is worth the effort of duplicating all the freebsd specific code so this is proposal represents a reasonable workaround.

Currently cgo is not supported, make.bash will detect this and disable cgo automatically during the build.

dfc@debian:~/go/src$ uname -a
GNU/kFreeBSD debian 8.1-1-686 #0 Sat Jul 21 17:02:04 UTC 2012 i686 i386 Intel(R) Core(TM) i5-2415M CPU @ 2.30GHz GNU/kFreeBSD
dfc@debian:~/go/src$ ../bin/go version
go version devel +d05272f402ec Sat Dec 01 15:15:14 2012 -0800

Tested with GOOS=freebsd GOARCH=386

R=golang-dev
CC=golang-dev
https://golang.org/cl/6868046
2012-12-04 08:27:30 +11:00
Alex Brainman
7fbef930a6 build: do more during windows build
- use GO_GCFLAGS and GO_LDFLAGS if supplied
- build misc\dashboard\builder and misc\goplay
- run tests in test\bench\go1
- check api compatibility

R=golang-dev, r, kardianos, bradfitz
CC=golang-dev
https://golang.org/cl/5847063
2012-03-20 14:04:20 +11:00
David Symonds
fa6d3ab6be build: update comment about GO_LDFLAGS.
(5l/6l/8l aren't involved in building packages)

R=golang-dev, robert.hencke
CC=golang-dev
https://golang.org/cl/5798071
2012-03-13 12:52:15 +11:00
Shenghou Ma
72801291d6 build: build correct cmd/dist matching GOHOSTARCH
Fix for issue 3210 comment #1.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/5794057
2012-03-13 03:34:22 +08:00
Russ Cox
318465b52a make.bash: fix old builds
Fixes #3222.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5761044
2012-03-07 11:38:05 -05:00
Gustavo Niemeyer
7e19e53391 build: add GO_ prefix to LDFLAGS and GCFLAGS
Build environments will often define stock LDFLAGS
that are not compatible with the gc ld, causing
non-obvious failures midway through the build.

R=golang-dev, rsc, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/5724044
2012-03-02 02:45:01 -03:00
Russ Cox
b03a5f66e8 cmd/go: fixes
* Install tools into tool dir always
  (Fixes issue 3049.  Fixes issue 2868.  Fixes issue 2925.)
* Make packages depend on compiler, linker (Fixes issue 3036.)
* Do not recompile packages across roots (Fixes issue 3149.)
* Allow use of binary-only packages (Fixes issue 2775.)
* Avoid duplicate cgo dependencies (Fixes issue 3001.)
* Show less in go get -x.  (Fixes issue 2926.)
* Do not force repo root for existing checkout (Fixes issue 2969.)
* Show full syntax error list always (Fixes issue 2811.)
* Clean arguments before processing (Fixes issue 3034.)
* Add flags for compiler, linker arguments (Fixes issue 2996.)
* Pass flags in make.bash (Fixes issue 3091.)
* Unify build flags, defined in one place.
* Clean up error messages (Fixes issue 3075.  Fixes issue 2923.)
* Support local import paths (Fixes issue 3118.)
* Allow top-level package outside $GOPATH (Fixes issue 3009.)

In addition to these fixes, all commands now take a list of
go files as a way to specify a single package, just as go build and
go run always have.  This means you can:

        go list -json x.go
        go fix x.go
        go vet x.go
        go test x_test.go

Preliminary tests in test.bash.
Mainly testing things that the ordinary build does not.
I don't mind if the script doesn't run on Windows.

I expect that gccgo support is now broken, and I hope that
people will feel free to file issues and/or send CLs to fix it.  :-)

R=golang-dev, dsymonds, r, rogpeppe
CC=golang-dev
https://golang.org/cl/5708054
2012-03-01 12:12:22 -05:00
Russ Cox
2506fd43d4 build: add make.bash --no-clean option
Makes it possible to run

GOARCH=amd64 make.bash
GOARCH=386 make.bash --no-clean

to avoid deleting some of the work done by the first one.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5673056
2012-02-15 11:48:17 -05:00
David Symonds
0ab3ea9738 build: create the correct $GOTOOLDIR.
Before this, make.bash --dist-tool would fail,
because $GOROOT/bin/tool was being mkdir'd
instead of $GOROOT/pkg/tool/linux_amd64.

R=rsc
CC=golang-dev
https://golang.org/cl/5666046
2012-02-15 09:06:24 +11:00
Russ Cox
982e6c44a0 build: set $PATH during make.bash
Should fix build breakage.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5656050
2012-02-13 22:46:50 -05:00
Russ Cox
7b848c6964 cmd/dist: cross-compiling fixes
This CL makes it possible to run make.bash with
GOOS and GOARCH set to something other than
the native host GOOS and GOARCH.

As part of the CL, the tool directory moves from bin/tool/
to pkg/tool/goos_goarch where goos and goarch are
the values for the host system (running the build), not
the target.  pkg/ is not technically appropriate, but C objects
are there now tool (pkg/obj/) so this puts all the generated
binaries in one place (rm -rf $GOROOT/pkg cleans everything).
Including goos_goarch in the name allows different systems
to share a single $GOROOT on a shared file system.

Fixes #2920.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5645093
2012-02-13 22:31:51 -05:00
Russ Cox
b5d81e5ed5 build: reject make.bash on Windows
Also, echo cmd/dist during bootstrap build
Makes that phase look like all the others.

Fixes #2908.

R=golang-dev, alex.brainman, bradfitz
CC=golang-dev
https://golang.org/cl/5655065
2012-02-12 23:14:37 -05: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
Russ Cox
1c290fda50 build: add make.bash --dist-tool
R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/5634048
2012-02-06 13:48:43 -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
8290536864 build: use cmd/dist
R=bradfitz, ality, r, r, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5615058
2012-02-04 00:54:08 -05: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
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
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
Rob Pike
2d6c011674 make.bash: don't remove hgpatch
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5598046
2012-01-30 10:15:43 -08:00
Rob Pike
79dc34413e cmd/go: first piece of tool rearrangement
1) create go-tool dir in make.bash
2) clean up stale binaries in make.bash
3) add 'tool' command to go
4) convert goyacc->yacc as a first test tool
Since goyacc stands alone, it's a safe trial.

R=rsc
CC=golang-dev
https://golang.org/cl/5576061
2012-01-29 09:19:05 -08:00
Russ Cox
ed936a3f22 cmd/go: implement go get + bug fixes
Move error information into Package struct, so that
a package can be returned even if a dependency failed
to load or did not exist.  This makes it possible to run
'go fix' or 'go fmt' on packages with broken dependencies
or missing imports.  It also enables go get -fix.
The new go list -e flag lets go list process those package
errors as normal data.

Change p.Doc to be first sentence of package doc, not
entire package doc.  Makes go list -json or
go list -f '{{.ImportPath}} {{.Doc}}' much more reasonable.

The go tool now depends on http, which means also
net and crypto/tls, both of which use cgo.  Trying to
make the build scripts that build the go tool understand
and handle cgo is too much work.  Instead, we build
a stripped down version of the go tool, compiled as go_bootstrap,
that substitutes an error stub for the usual HTTP code.
The buildscript builds go_bootstrap, go_bootstrap builds
the standard packages and commands, including the full
including-HTTP-support go tool, and then go_bootstrap
gets deleted.

Also handle the case where the buildscript needs updating
during all.bash: if it fails but a go command can be found on
the current $PATH, try to regenerate it.  This gracefully
handles situations like adding a new file to a package
used by the go tool.

R=r, adg
CC=golang-dev
https://golang.org/cl/5553059
2012-01-23 15:16:51 -05:00
Shenghou Ma
fec7aa952f doc: update out-of-date comments about runtime/cgo
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5532100
2012-01-19 17:13:33 -05:00
Shenghou Ma
c5f8433261 buildscripts: move to buildscript directory
Fixes #2717.

R=r, rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5545069
2012-01-17 11:18:15 -05:00
Russ Cox
146a703cd1 cmd/go: add -v flag to build and install
The -v flag prints the names of packages as they are built/installed.

Use -v in make.bash/run.bash to avoid a silent pause during
the build while Go code is being compiled.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5532055
2012-01-09 16:44:01 -08:00
Alex Brainman
b682da32b3 make.bash: remove old dregs
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5522043
2012-01-05 14:17:32 +11:00
Russ Cox
0509727b0d build: fixes for Windows
* work around a linker/cgo bug
* do not run deps.bash on Windows unless we need it
  (cuts a full minute off the build time)
* add windows to the list of cgo-enabled targets

The gopack problem is issue 2601.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/5504062
2011-12-21 15:57:47 -05:00
Russ Cox
8f5f347e2c cmd/go: many improvements
* correct dependency calculations
* comment meaning of action fields
* new alias "std" like "all" but standard packages only
* add -o flag to 'go build'
* set up for parallel build (still serial)
* understand that import "C" depends on cgo, runtime/cgo

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5502055
2011-12-21 07:47:12 -05:00
Russ Cox
a63262b6c0 build: fix for freebsd, openbsd
TBR=r
CC=golang-dev
https://golang.org/cl/5505052
2011-12-20 20:37:58 -05:00
Russ Cox
41a6165c03 build: use go command during build
If something goes wrong, it should suffice to set
USE_GO_TOOL=false in env.bash to fall back to the
makefiles.  I will delete the makefiles in January.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5502047
2011-12-20 16:50:13 -05:00
Russ Cox
55889409f8 runtime: separate out auto-generated files, take 2
This is like the ill-fated CL 5493063 except that
I have written a shell script (autogen.sh) instead of
thinking I could possibly write a correct Makefile.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5496075
2011-12-19 15:51:13 -05:00
Russ Cox
86dcc431e9 runtime: hg revert -r 6ec0a5c12d75
That was the last build that was close to working.
I will try that change again next week.
Make is being very subtle today.

At the reverted-to CL, the ARM traceback appears
to be broken.  I'll look into that next week too.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5492063
2011-12-16 18:50:40 -05:00
Russ Cox
bd9243da22 runtime: separate out auto-generated files
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5493063
2011-12-16 17:04:32 -05:00
Bobby Powers
90c5070000 build: fix check for selinux's allow_execstack on Fedora 16
Fedora 16 mounts selinux at /sys/fs/selinux, instead of the
traditional /selinux.  Check both locations for the selinux
filesystem in make.bash

Fixes #2448.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5373077
2011-11-11 16:41:37 -05:00
Russ Cox
12ece77c14 build: stop on failed deps.bash
Apparently some versions of bash do the ||exit implicitly
when in set -e mode, but others do not.  ???

R=gri
CC=golang-dev
https://golang.org/cl/5285043
2011-10-14 15:54:36 -04:00
Christopher Wedgwood
604bd70085 make.bash: more robustly detect gold 2.20
On recent Debian systems the gold 2.20 check triggers though
Debian doesn't have version 2.20 but rather has:

        GNU gold (GNU Binutils for Debian 2.21.52.20110606) 1.11
                                                ^^^^

R=rsc, iant
CC=golang-dev
https://golang.org/cl/5252055
2011-10-13 12:25:25 -04:00
Alex Brainman
37dca9d417 make.bash: remove old bash version of gotest on Windows
The file is called gotest.exe now.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4444090
2011-05-04 11:16:55 +10:00
Russ Cox
eedfc445a3 build: diagnose Ubuntu's buggy copy of gold
R=iant, dsymonds
CC=golang-dev
https://golang.org/cl/4300041
2011-03-18 18:23:00 -04:00
Dave Cheney
432b4f309b build: convert src/cmd to use make directly and simplify src/make.bash
R=adg, bsiegert, rsc
CC=golang-dev
https://golang.org/cl/4221047
2011-03-01 09:20:32 +11:00
Dave Cheney
a1d95deaaa build: remove unused nacl conditional from make.bash
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4217042
2011-02-24 15:56:53 +11:00
Russ Cox
d9f1ddbee1 make.bash: stricter selinux test
SELinux can be installed but not turned on.
Don't complain unless it is actually turned on.

https://bugzilla.redhat.com/show_bug.cgi?id=652987#c20

R=agl
CC=golang-dev
https://golang.org/cl/3979044
2011-01-25 10:19:39 -05:00
Russ Cox
3a2ba994b6 build: add a few missing --no-print-directory
Reported by W. Michael Petullo <mike@flyn.org>

Fixes #1269.

R=r, r2
CC=golang-dev
https://golang.org/cl/3618041
2010-12-13 15:50:57 -05:00
Russ Cox
5a8f2ba727 fix build: more libcgo references
R=r
CC=golang-dev
https://golang.org/cl/3448043
2010-12-08 14:36:45 -05:00
Andrew Gerrand
6e87a0abc9 build: only print "You need to add foo to PATH" when needed
Fixes #1223.

R=bradfitz
CC=golang-dev
https://golang.org/cl/2701041
2010-10-25 16:38:48 +11:00