Where can I get the documents explaining arguments of "go build" flags?

541 views
Skip to first unread message

Nan Xiao

unread,
Jul 20, 2016, 1:31:45 AM7/20/16
to golang-nuts
Hi all,

In Compile packages and dependencies document, I find there are -gcflags, -ldflags, etc.
I want to know what arguments can be passed into these build flags, and the detail meanings
of the arguments, such as: the detailed explanation of "-gcflags "-N -l"", but I can't find related documents.

Could anyone can tell me where I can find related documents?

Thanks very much in advance!

Best Regards
Nan Xiao

Dave Cheney

unread,
Jul 20, 2016, 2:54:26 AM7/20/16
to golang-nuts
-gcflags are passed to go tool compile, -ldflags are passed to go tool link.

Ian Lance Taylor

unread,
Jul 20, 2016, 9:34:17 AM7/20/16
to Dave Cheney, golang-nuts
On Tue, Jul 19, 2016 at 11:54 PM, Dave Cheney <da...@cheney.net> wrote:
> -gcflags are passed to go tool compile, -ldflags are passed to go tool link.

And you can see the docs for those at https://golang.org/cmd/compile
and https://golang.org/cmd/link .

Ian

Nan Xiao

unread,
Jul 21, 2016, 1:44:00 AM7/21/16
to golang-nuts, da...@cheney.net, golang-nuts
Hi Ian & Dave,

Thanks very much!
Reply all
Reply to author
Forward
0 new messages