-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Milestone
Description
What version of Go are you using (go version)?
go version go1.11.4 linux/amd64
Android NDK 19.0.5160253-beta2
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GOARCH="amd64" GOBIN="/home/x/go/bin" GOCACHE="/home/x/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/x/go" GOPROXY="" GORACE="" GOROOT="/home/x/app/go" GOTMPDIR="" GOTOOLDIR="/home/x/app/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build212459853=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Run gomobile build to build an Android APK.
What did you expect to see?
Build command will build an APK named basic.apk.
What did you see instead?
x@xpc:~$ gomobile build -target=android golang.org/x/mobile/example/basic
gomobile: go build -buildmode=c-shared -o /tmp/gomobile-work-451339240/lib/armeabi-v7a/libbasic.so golang.org/x/mobile/example/basic failed: exit status 2
# runtime/cgo
clang80: error: argument unused during compilation: '-stdlib=libc++' [-Werror,-Wunused-command-line-argument]
gomobile build -target=android -x golang.org/x/mobile/example/basic Output
x@xpc:~$ gomobile build -target=android -x golang.org/x/mobile/example/basic GOMOBILE=/home/x/go/pkg/gomobile WORK=/tmp/gomobile-work-944186541 mkdir -p $WORK/lib/armeabi-v7a GOOS=android GOARCH=arm CC=$GOMOBILE/ndk-toolchains/arm/bin/arm-linux-androideabi-clang CXX=$GOMOBILE/ndk-toolchains/arm/bin/arm-linux-androideabi-clang++ CGO_ENABLED=1 GOARM=7 go build -x -buildmode=c-shared -o $WORK/lib/armeabi-v7a/libbasic.so golang.org/x/mobile/example/basic rm -r -f "$WORK" gomobile: go build -x -buildmode=c-shared -o /tmp/gomobile-work-944186541/lib/armeabi-v7a/libbasic.so golang.org/x/mobile/example/basic failed: exit status 2 WORK=/tmp/go-build950337788 mkdir -p $WORK/b041/ cd /home/x/app/go/src/runtime/cgo CGO_LDFLAGS='"-g" "-O2" "-llog"' /home/x/app/go/pkg/tool/linux_amd64/cgo -objdir $WORK/b041/ -importpath runtime/cgo -import_runtime_cgo=false -import_syscall=false -exportheader=$WORK/b041/_cgo_install.h -- -I $WORK/b041/ -g -O2 -Wall -Werror ./cgo.go # runtime/cgo clang80: error: argument unused during compilation: '-stdlib=libc++' [-Werror,-Wunused-command-line-argument]
unicameralontology, praveenraji2i, hoeg, artob and cbeuw