From b84795b4945bb0ca4d464ffff3cba37d2ff049c5 Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Fri, 13 Nov 2015 13:54:19 -0500 Subject: [PATCH] cmd/gomobile: avoid -buildmode for go install std Turns out that go install -buildmode=c-shared std does nothing. The go tool filters all non-main packages from c-shared builds, which for the standard library is all packages. This may be a bug in the go tool. I'm not sure yet. But either way, to make the gomobile tool work with Go 1.5, work around it here. Change-Id: Ica1e7eeb0f40a21a2c78b0c55bdc54f133a32ee5 Reviewed-on: https://go-review.googlesource.com/16912 Reviewed-by: Hyang-Ah Hana Kim --- cmd/gomobile/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gomobile/init.go b/cmd/gomobile/init.go index 9e2adcb..bd73997 100644 --- a/cmd/gomobile/init.go +++ b/cmd/gomobile/init.go @@ -145,7 +145,7 @@ func runInit(cmd *command) error { // Install standard libraries for cross compilers. start := time.Now() - if err := installStd(androidArmEnv, "-buildmode=c-shared"); err != nil { + if err := installStd(androidArmEnv, "-gcflags=-shared", "-ldflags=-shared"); err != nil { return err } if err := installDarwin(); err != nil {