]> Cypherpunks repositories - gostls13.git/commit
cmd/link: add -libgcc option
authorIan Lance Taylor <iant@golang.org>
Tue, 17 Nov 2015 02:11:35 +0000 (18:11 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 18 Nov 2015 02:04:10 +0000 (02:04 +0000)
commit8d2f60f8a8d060f9ffa4af378881cffba9f0af30
tree4cc7f1da4fb061d965fc8197241bc50dfefc222c
parent3bf61fb2e53afaaec4386376c4d6e677767cfff4
cmd/link: add -libgcc option

An internal link may need the C compiler support library, libgcc.a.  Add
a -libgcc option to set the name of the compiler support library.  If
-libgcc is not used, run the compiler to find it.  Permit -libgcc=none
to skip using libgcc at all and hope for the best.

Change cmd/dist to not copy libgcc into the distribution.  Add tests to
ensure that all the standard packages that use cgo can be linked in
internal mode without using libgcc.  This ensures that somebody with a
Go installation without a C compiler can build programs.

Change-Id: I8ba35fb87ab0dd20e5cc0166b5f4145b04ce52a4
Reviewed-on: https://go-review.googlesource.com/16993
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/dist/build.go
src/cmd/dist/test.go
src/cmd/link/doc.go
src/cmd/link/internal/ld/ar.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/pobj.go
src/go/build/deps_test.go