Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: 3rd party lib. dependency problem #21901

Closed
billyninja opened this issue Sep 15, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@billyninja
Copy link

commented Sep 15, 2017

Howdy, ladies and gentlemen! Hope you're doing great.

I'm having an dependency issue trying to cross-compile to android, while importing a 3rd party library (go-sdl2, I opened a issue there as well). A vanilla gomobile app build just fine targeting android/arm, also regular x86 build including go-sdl2 also works fine.

It is probably not issue of the gomobile toolchain, maybe the build steps get lost after a certain level of indirection?

My program include go-sdl2, which contains sdl/mouse.go, which include <SDL_syswm.h>, which include <X11/Xlib.h>. I don't have experience building C programs, so I beg pardon if it is a trivial mistake.

A quick spoiler of the build error.

...
pack r $WORK/golang.org/x/mobile/app.a $WORK/golang.org/x/mobile/app/_obj/_all.o # internal
# github.com/veandco/go-sdl2/sdl
In file included from ../../veandco/go-sdl2/sdl/mouse.go:9:
/usr/include/SDL2/SDL_syswm.h:72:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
1 error generated.

What version of Go are you using (go version)?

go1.9 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/joao/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build163224394=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config

What did you do?

[joao@joao-pc runegrid]$ gomobile clean -x

GOMOBILE=/home/joao/go/pkg/gomobile
rm -r -f "$GOMOBILE"

[joao@joao-pc runegrid]$ gomobile init -x -ndk ~/Android/Sdk/ndk-bundle

GOMOBILE=/home/joao/go/pkg/gomobile
rm -r -f "$GOMOBILE"
mkdir -p $GOMOBILE
WORK=/home/joao/go/pkg/gomobile/work-880765961
GOOS=android GOARCH=arm CC=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang CXX=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ CGO_CFLAGS=-target armv7a-none-linux-androideabi --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-15/arch-arm -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -I$GOMOBILE/include CGO_CPPFLAGS=-target armv7a-none-linux-androideabi --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-15/arch-arm -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -I$GOMOBILE/include CGO_LDFLAGS=-target armv7a-none-linux-androideabi --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-15/arch-arm -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -L$HOME/Android/Sdk/ndk-bundle/platforms/android-15/arch-arm/usr/lib -L$GOMOBILE/lib/arm CGO_ENABLED=1 GOARM=7 go install -gcflags=-shared -ldflags=-shared -pkgdir=$GOMOBILE/pkg_android_arm -x std
GOOS=android GOARCH=arm64 CC=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang CXX=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ CGO_CFLAGS=-target aarch64-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I$GOMOBILE/include CGO_CPPFLAGS=-target aarch64-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I$GOMOBILE/include CGO_LDFLAGS=-target aarch64-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -L$HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib -L$GOMOBILE/lib/arm64 CGO_ENABLED=1 go install -gcflags=-shared -ldflags=-shared -pkgdir=$GOMOBILE/pkg_android_arm64 -x std
GOOS=android GOARCH=386 CC=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang CXX=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ CGO_CFLAGS=-target i686-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-15/arch-x86 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64 -I$GOMOBILE/include CGO_CPPFLAGS=-target i686-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-15/arch-x86 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64 -I$GOMOBILE/include CGO_LDFLAGS=-target i686-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-15/arch-x86 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64 -L$HOME/Android/Sdk/ndk-bundle/platforms/android-15/arch-x86/usr/lib -L$GOMOBILE/lib/386 CGO_ENABLED=1 go install -gcflags=-shared -ldflags=-shared -pkgdir=$GOMOBILE/pkg_android_386 -x std
GOOS=android GOARCH=amd64 CC=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang CXX=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ CGO_CFLAGS=-target x86_64-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-x86_64 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/x86_64-4.9/prebuilt/linux-x86_64 -I$GOMOBILE/include CGO_CPPFLAGS=-target x86_64-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-x86_64 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/x86_64-4.9/prebuilt/linux-x86_64 -I$GOMOBILE/include CGO_LDFLAGS=-target x86_64-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-x86_64 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/x86_64-4.9/prebuilt/linux-x86_64 -L$HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/lib -L$GOMOBILE/lib/amd64 CGO_ENABLED=1 go install -gcflags=-shared -ldflags=-shared -pkgdir=$GOMOBILE/pkg_android_amd64 -x std
go version > $GOMOBILE/version
rm -r -f "$WORK"

[joao@joao-pc runegrid]$ gomobile build -x -target android/arm64

GOMOBILE=/home/joao/go/pkg/gomobile
WORK=/tmp/gomobile-work-488840518
mkdir -p $WORK/lib/arm64-v8a
GOOS=android GOARCH=arm64 CC=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang CXX=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ CGO_CFLAGS=-target aarch64-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I$GOMOBILE/include CGO_CPPFLAGS=-target aarch64-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I$GOMOBILE/include CGO_LDFLAGS=-target aarch64-none-linux-android --sysroot $HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain $HOME/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -L$HOME/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib -L$GOMOBILE/lib/arm64 CGO_ENABLED=1 go build -pkgdir=$GOMOBILE/pkg_android_arm64 -x -buildmode=c-shared -o $WORK/lib/arm64-v8a/librunegrid.so github.com/billyninja/runegrid
rm -r -f "$WORK"
gomobile: go build -pkgdir=/home/joao/go/pkg/gomobile/pkg_android_arm64 -x -buildmode=c-shared -o /tmp/gomobile-work-488840518/lib/arm64-v8a/librunegrid.so github.com/billyninja/runegrid failed: exit status 2
WORK=/tmp/go-build736509427
mkdir -p $WORK/github.com/veandco/go-sdl2/sdl/_obj/
mkdir -p $WORK/github.com/veandco/go-sdl2/
cd /home/joao/go/src/github.com/veandco/go-sdl2/sdl
pkg-config --cflags sdl2
mkdir -p $WORK/golang.org/x/mobile/event/key/_obj/
mkdir -p $WORK/golang.org/x/mobile/event/
mkdir -p $WORK/golang.org/x/mobile/app/internal/callfn/_obj/
mkdir -p $WORK/golang.org/x/mobile/app/internal/
cd /home/joao/go/src/golang.org/x/mobile/app/internal/callfn
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/mobile/app/internal/callfn.a -trimpath $WORK -shared -goversion go1.9 -p golang.org/x/mobile/app/internal/callfn -installsuffix shared -buildid ddcb52447c56a7800ce45ac4a8dbe7be65d8ab0d -D _/home/joao/go/src/golang.org/x/mobile/app/internal/callfn -I $WORK -I /home/joao/go/pkg/gomobile/pkg_android_arm64 -pack -asmhdr $WORK/golang.org/x/mobile/app/internal/callfn/_obj/go_asm.h ./callfn.go
mkdir -p $WORK/golang.org/x/mobile/event/lifecycle/_obj/
cd /home/joao/go/src/golang.org/x/mobile/event/key
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/mobile/event/key.a -trimpath $WORK -shared -goversion go1.9 -p golang.org/x/mobile/event/key -complete -installsuffix shared -buildid 01f33ca21a63397e2adee361e0e01bd9756bfc40 -D _/home/joao/go/src/golang.org/x/mobile/event/key -I $WORK -I /home/joao/go/pkg/gomobile/pkg_android_arm64 -pack ./code_string.go ./key.go
cd /home/joao/go/src/golang.org/x/mobile/event/lifecycle
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/mobile/event/lifecycle.a -trimpath $WORK -shared -goversion go1.9 -p golang.org/x/mobile/event/lifecycle -complete -installsuffix shared -buildid bf99e994e78f1deb73471d264df699f19074d230 -D _/home/joao/go/src/golang.org/x/mobile/event/lifecycle -I $WORK -I /home/joao/go/pkg/gomobile/pkg_android_arm64 -pack ./lifecycle.go
cd /home/joao/go/src/github.com/veandco/go-sdl2/sdl
pkg-config --libs sdl2
cd /home/joao/go/src/golang.org/x/mobile/app/internal/callfn
/usr/lib/go/pkg/tool/linux_amd64/asm -trimpath $WORK -I $WORK/golang.org/x/mobile/app/internal/callfn/_obj/ -I /usr/lib/go/pkg/include -D GOOS_android -D GOARCH_arm64 -shared -o $WORK/golang.org/x/mobile/app/internal/callfn/_obj/callfn_arm64.o ./callfn_arm64.s
cd /home/joao/go/src/github.com/veandco/go-sdl2/sdl
CGO_LDFLAGS="-target" "aarch64-none-linux-android" "--sysroot" "/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64" "-gcc-toolchain" "/home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64" "-L/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib" "-L/home/joao/go/pkg/gomobile/lib/arm64" "-lSDL2" /usr/lib/go/pkg/tool/linux_amd64/cgo -objdir $WORK/github.com/veandco/go-sdl2/sdl/_obj/ -importpath github.com/veandco/go-sdl2/sdl -exportheader=$WORK/github.com/veandco/go-sdl2/sdl/_obj/_cgo_install.h -- -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -D_REENTRANT -I/usr/include/SDL2 -I $WORK/github.com/veandco/go-sdl2/sdl/_obj/ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include audio.go blendmode.go clipboard.go cpuinfo.go endian.go error.go events.go filesystem.go gamecontroller.go gesture.go haptic.go hints.go joystick.go keyboard.go keycode.go loadso.go log.go mouse.go mutex.go pixels.go power.go rect.go render.go rwops.go scancode.go sdl.go surface.go sysrender.go system_android.go syswm.go timer.go touch.go version.go video.go
cd /home/joao/go/src/golang.org/x/mobile/app/internal/callfn
pack r $WORK/golang.org/x/mobile/app/internal/callfn.a $WORK/golang.org/x/mobile/app/internal/callfn/_obj/callfn_arm64.o # internal
mkdir -p $WORK/golang.org/x/mobile/event/paint/_obj/
cd /home/joao/go/src/golang.org/x/mobile/event/paint
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/mobile/event/paint.a -trimpath $WORK -shared -goversion go1.9 -p golang.org/x/mobile/event/paint -complete -installsuffix shared -buildid 173805b21b7e96874215f3ce6f321e3d94f9f5c7 -D _/home/joao/go/src/golang.org/x/mobile/event/paint -I $WORK -I /home/joao/go/pkg/gomobile/pkg_android_arm64 -pack ./paint.go
mkdir -p $WORK/golang.org/x/mobile/geom/_obj/
mkdir -p $WORK/golang.org/x/mobile/
cd /home/joao/go/src/golang.org/x/mobile/geom
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/mobile/geom.a -trimpath $WORK -shared -goversion go1.9 -p golang.org/x/mobile/geom -complete -installsuffix shared -buildid 5007f28c1ca9745cf973cb1206c0e152054c0b0c -D _/home/joao/go/src/golang.org/x/mobile/geom -I $WORK -I /home/joao/go/pkg/gomobile/pkg_android_arm64 -pack ./geom.go
mkdir -p $WORK/golang.org/x/mobile/event/touch/_obj/
cd /home/joao/go/src/golang.org/x/mobile/event/touch
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/mobile/event/touch.a -trimpath $WORK -shared -goversion go1.9 -p golang.org/x/mobile/event/touch -complete -installsuffix shared -buildid 048f9cfc2777d2b7918974b068d8fd8a6da7e8eb -D _/home/joao/go/src/golang.org/x/mobile/event/touch -I $WORK -I /home/joao/go/pkg/gomobile/pkg_android_arm64 -pack ./touch.go
mkdir -p $WORK/golang.org/x/mobile/gl/_obj/
cd /home/joao/go/src/golang.org/x/mobile/gl
CGO_LDFLAGS="-target" "aarch64-none-linux-android" "--sysroot" "/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64" "-gcc-toolchain" "/home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64" "-L/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib" "-L/home/joao/go/pkg/gomobile/lib/arm64" "-lGLESv2" /usr/lib/go/pkg/tool/linux_amd64/cgo -objdir $WORK/golang.org/x/mobile/gl/_obj/ -importpath golang.org/x/mobile/gl -exportheader=$WORK/golang.org/x/mobile/gl/_obj/_cgo_install.h -- -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I $WORK/golang.org/x/mobile/gl/_obj/ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -Dos_android -Dos_linux work.go
mkdir -p $WORK/golang.org/x/mobile/internal/mobileinit/_obj/
mkdir -p $WORK/golang.org/x/mobile/internal/
cd /home/joao/go/src/golang.org/x/mobile/internal/mobileinit
CGO_LDFLAGS="-target" "aarch64-none-linux-android" "--sysroot" "/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64" "-gcc-toolchain" "/home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64" "-L/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib" "-L/home/joao/go/pkg/gomobile/lib/arm64" "-landroid" "-llog" /usr/lib/go/pkg/tool/linux_amd64/cgo -objdir $WORK/golang.org/x/mobile/internal/mobileinit/_obj/ -importpath golang.org/x/mobile/internal/mobileinit -exportheader=$WORK/golang.org/x/mobile/internal/mobileinit/_obj/_cgo_install.h -- -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I $WORK/golang.org/x/mobile/internal/mobileinit/_obj/ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include ctx_android.go mobileinit.go mobileinit_android.go
mkdir -p $WORK/golang.org/x/mobile/event/size/_obj/
cd /home/joao/go/src/golang.org/x/mobile/event/size
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/mobile/event/size.a -trimpath $WORK -shared -goversion go1.9 -p golang.org/x/mobile/event/size -complete -installsuffix shared -buildid c1a86e39d39ab064c658dcf25bd3c8ff361b7d02 -D _/home/joao/go/src/golang.org/x/mobile/event/size -I $WORK -I /home/joao/go/pkg/gomobile/pkg_android_arm64 -pack ./size.go
cd $WORK
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -fdebug-prefix-map=a=b -c trivial.c
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -gno-record-gcc-switches -c trivial.c
cd $WORK/golang.org/x/mobile/gl/_obj
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/gl -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -Dos_android -Dos_linux -o ./_cgo_export.o -c _cgo_export.c
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/gl -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -Dos_android -Dos_linux -o ./work.cgo2.o -c work.cgo2.c
cd /home/joao/go/src/golang.org/x/mobile/gl
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I . -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I $WORK/golang.org/x/mobile/gl/_obj/ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -Dos_android -Dos_linux -o $WORK/golang.org/x/mobile/gl/_obj/work.o -c work.c
cd $WORK/golang.org/x/mobile/internal/mobileinit/_obj
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/internal/mobileinit -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -o ./_cgo_export.o -c _cgo_export.c
cd $WORK/golang.org/x/mobile/gl/_obj
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/gl -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -Dos_android -Dos_linux -o ./_cgo_main.o -c _cgo_main.c
cd $WORK/golang.org/x/mobile/internal/mobileinit/_obj
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/internal/mobileinit -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -o ./ctx_android.cgo2.o -c ctx_android.cgo2.c
cd /home/joao/go/src/golang.org/x/mobile/gl
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I . -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/golang.org/x/mobile/gl/_obj/_cgo_.o $WORK/golang.org/x/mobile/gl/_obj/_cgo_main.o $WORK/golang.org/x/mobile/gl/_obj/_cgo_export.o $WORK/golang.org/x/mobile/gl/_obj/work.cgo2.o $WORK/golang.org/x/mobile/gl/_obj/work.o -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -L/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib -L/home/joao/go/pkg/gomobile/lib/arm64 -lGLESv2 -pie
cd $WORK/golang.org/x/mobile/internal/mobileinit/_obj
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/internal/mobileinit -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -o ./mobileinit.cgo2.o -c mobileinit.cgo2.c
cd /home/joao/go/src/golang.org/x/mobile/gl
/usr/lib/go/pkg/tool/linux_amd64/cgo -dynpackage gl -dynimport $WORK/golang.org/x/mobile/gl/_obj/_cgo_.o -dynout $WORK/golang.org/x/mobile/gl/_obj/_cgo_import.go
cd $WORK
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -no-pie -c trivial.c
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -nopie -c trivial.c
cd /home/joao/go/src/golang.org/x/mobile/gl
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I . -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/golang.org/x/mobile/gl/_obj/_all.o $WORK/golang.org/x/mobile/gl/_obj/_cgo_export.o $WORK/golang.org/x/mobile/gl/_obj/work.cgo2.o $WORK/golang.org/x/mobile/gl/_obj/work.o -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -L/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib -L/home/joao/go/pkg/gomobile/lib/arm64 -Wl,-r -nostdlib -nopie -Wl,--build-id=none
cd $WORK/golang.org/x/mobile/internal/mobileinit/_obj
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/internal/mobileinit -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -o ./mobileinit_android.cgo2.o -c mobileinit_android.cgo2.c
cd /home/joao/go/src/golang.org/x/mobile/gl
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/mobile/gl.a -trimpath $WORK -shared -goversion go1.9 -p golang.org/x/mobile/gl -installsuffix shared -buildid 92311864ce8958c36469cdc56b5edbe54ca3abeb -D _/home/joao/go/src/golang.org/x/mobile/gl -I $WORK -I /home/joao/go/pkg/gomobile/pkg_android_arm64 -pack ./consts.go ./doc.go ./fn.go ./gl.go ./interface.go ./types_prod.go $WORK/golang.org/x/mobile/gl/_obj/_cgo_gotypes.go $WORK/golang.org/x/mobile/gl/_obj/work.cgo1.go $WORK/golang.org/x/mobile/gl/_obj/_cgo_import.go
cd $WORK/golang.org/x/mobile/internal/mobileinit/_obj
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/internal/mobileinit -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -o ./_cgo_main.o -c _cgo_main.c
cd /home/joao/go/src/golang.org/x/mobile/internal/mobileinit
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I . -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/_cgo_.o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/_cgo_main.o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/_cgo_export.o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/ctx_android.cgo2.o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/mobileinit.cgo2.o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/mobileinit_android.cgo2.o -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -L/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib -L/home/joao/go/pkg/gomobile/lib/arm64 -landroid -llog -pie
/usr/lib/go/pkg/tool/linux_amd64/cgo -dynpackage mobileinit -dynimport $WORK/golang.org/x/mobile/internal/mobileinit/_obj/_cgo_.o -dynout $WORK/golang.org/x/mobile/internal/mobileinit/_obj/_cgo_import.go
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I . -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/_all.o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/_cgo_export.o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/ctx_android.cgo2.o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/mobileinit.cgo2.o $WORK/golang.org/x/mobile/internal/mobileinit/_obj/mobileinit_android.cgo2.o -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -L/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib -L/home/joao/go/pkg/gomobile/lib/arm64 -Wl,-r -nostdlib -nopie -Wl,--build-id=none
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/mobile/internal/mobileinit.a -trimpath $WORK -shared -goversion go1.9 -p golang.org/x/mobile/internal/mobileinit -installsuffix shared -buildid 4da950f49d588c21d3fcf3b130f25402176d3b86 -D _/home/joao/go/src/golang.org/x/mobile/internal/mobileinit -I $WORK -I /home/joao/go/pkg/gomobile/pkg_android_arm64 -pack $WORK/golang.org/x/mobile/internal/mobileinit/_obj/_cgo_gotypes.go $WORK/golang.org/x/mobile/internal/mobileinit/_obj/ctx_android.cgo1.go $WORK/golang.org/x/mobile/internal/mobileinit/_obj/mobileinit.cgo1.go $WORK/golang.org/x/mobile/internal/mobileinit/_obj/mobileinit_android.cgo1.go $WORK/golang.org/x/mobile/internal/mobileinit/_obj/_cgo_import.go
pack r $WORK/golang.org/x/mobile/internal/mobileinit.a $WORK/golang.org/x/mobile/internal/mobileinit/_obj/_all.o # internal
cd /home/joao/go/src/golang.org/x/mobile/gl
pack r $WORK/golang.org/x/mobile/gl.a $WORK/golang.org/x/mobile/gl/_obj/_all.o # internal
mkdir -p $WORK/golang.org/x/mobile/app/_obj/
cd /home/joao/go/src/golang.org/x/mobile/app
CGO_LDFLAGS="-target" "aarch64-none-linux-android" "--sysroot" "/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64" "-gcc-toolchain" "/home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64" "-L/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib" "-L/home/joao/go/pkg/gomobile/lib/arm64" "-landroid" "-llog" "-lEGL" "-lGLESv2" /usr/lib/go/pkg/tool/linux_amd64/cgo -objdir $WORK/golang.org/x/mobile/app/_obj/ -importpath golang.org/x/mobile/app -exportheader=$WORK/golang.org/x/mobile/app/_obj/_cgo_install.h -- -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I $WORK/golang.org/x/mobile/app/_obj/ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include android.go
cd $WORK/golang.org/x/mobile/app/_obj
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/app -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -o ./_cgo_export.o -c _cgo_export.c
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/app -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -o ./android.cgo2.o -c android.cgo2.c
cd /home/joao/go/src/golang.org/x/mobile/app
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I . -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I $WORK/golang.org/x/mobile/app/_obj/ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -o $WORK/golang.org/x/mobile/app/_obj/android.o -c android.c
# golang.org/x/mobile/app
android.c:103:44: warning: incompatible pointer types assigning to 'void (*)(ANativeActivity *, int)' (aka 'void (*)(struct ANativeActivity *, int)') from 'void (ANativeActivity *, GoInt)' (aka 'void (struct ANativeActivity *, long long)') [-Wincompatible-pointer-types]
cd $WORK/golang.org/x/mobile/app/_obj
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I /home/joao/go/src/golang.org/x/mobile/app -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -I ./ -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -I/home/joao/go/pkg/gomobile/include -o ./_cgo_main.o -c _cgo_main.c
cd /home/joao/go/src/golang.org/x/mobile/app
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I . -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/golang.org/x/mobile/app/_obj/_cgo_.o $WORK/golang.org/x/mobile/app/_obj/_cgo_main.o $WORK/golang.org/x/mobile/app/_obj/_cgo_export.o $WORK/golang.org/x/mobile/app/_obj/android.cgo2.o $WORK/golang.org/x/mobile/app/_obj/android.o -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -L/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib -L/home/joao/go/pkg/gomobile/lib/arm64 -landroid -llog -lEGL -lGLESv2 -pie
/usr/lib/go/pkg/tool/linux_amd64/cgo -dynpackage app -dynimport $WORK/golang.org/x/mobile/app/_obj/_cgo_.o -dynout $WORK/golang.org/x/mobile/app/_obj/_cgo_import.go
/home/joao/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -I . -fPIC -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/golang.org/x/mobile/app/_obj/_all.o $WORK/golang.org/x/mobile/app/_obj/_cgo_export.o $WORK/golang.org/x/mobile/app/_obj/android.cgo2.o $WORK/golang.org/x/mobile/app/_obj/android.o -target aarch64-none-linux-android --sysroot /home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64 -gcc-toolchain /home/joao/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -L/home/joao/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/lib -L/home/joao/go/pkg/gomobile/lib/arm64 -Wl,-r -nostdlib -nopie -Wl,--build-id=none
/usr/lib/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/mobile/app.a -trimpath $WORK -shared -goversion go1.9 -p golang.org/x/mobile/app -installsuffix shared -buildid acb6c8544e3ea04c1a93e58986eb732508003718 -D _/home/joao/go/src/golang.org/x/mobile/app -I $WORK -I /home/joao/go/pkg/gomobile/pkg_android_arm64 -pack ./app.go ./doc.go $WORK/golang.org/x/mobile/app/_obj/_cgo_gotypes.go $WORK/golang.org/x/mobile/app/_obj/android.cgo1.go $WORK/golang.org/x/mobile/app/_obj/_cgo_import.go
pack r $WORK/golang.org/x/mobile/app.a $WORK/golang.org/x/mobile/app/_obj/_all.o # internal
# github.com/veandco/go-sdl2/sdl
In file included from ../../veandco/go-sdl2/sdl/mouse.go:9:
/usr/include/SDL2/SDL_syswm.h:72:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
1 error generated.

Here's my X11 lib in place:

[joao@joao-pc android]$ ls -lhs /usr/include/X11

total 1.1M
4.0K -rw-r--r-- 1 joao joao 2.3K Sep 23  2016 ap_keysym.h
4.0K -rw-r--r-- 1 joao joao 4.0K May  2  2015 CallbackI.h
4.0K -rw-r--r-- 1 joao joao 3.5K May  2  2015 Composite.h
8.0K -rw-r--r-- 1 joao joao 4.7K May  2  2015 CompositeP.h
4.0K -rw-r--r-- 1 joao joao 4.0K May  2  2015 ConstrainP.h
4.0K -rw-r--r-- 1 joao joao 2.6K May  2  2015 Constraint.h
4.0K -rw-r--r-- 1 joao joao 3.4K May  2  2015 ConvertI.h
4.0K -rw-r--r-- 1 joao joao 2.6K May  2  2015 Core.h
 12K -rw-r--r-- 1 joao joao 8.4K May  2  2015 CoreP.h
4.0K -rw-r--r-- 1 joao joao 1.4K May  2  2015 CreateI.h
4.0K -rw-r--r-- 1 joao joao 3.1K Feb 27  2017 cursorfont.h
4.0K -rw-r--r-- 1 joao joao 2.8K Sep 23  2016 DECkeysym.h
8.0K -rw-r--r-- 1 joao joao 4.2K May  2  2015 EventI.h
4.0K drwxr-xr-x 2 joao joao 4.0K Sep 13 22:49 extensions
4.0K drwxr-xr-x 2 joao joao 4.0K Jun 19 17:31 fonts
4.0K -rw-r--r-- 1 joao joao 2.2K May  2  2015 HookObjI.h
8.0K -rw-r--r-- 1 joao joao 6.0K Sep 23  2016 HPkeysym.h
4.0K drwxr-xr-x 2 joao joao 4.0K Jun  7  2014 ICE
4.0K -rw-r--r-- 1 joao joao  459 Feb 27  2017 ImUtil.h
 16K -rw-r--r-- 1 joao joao  13K May  2  2015 InitialI.h
 64K -rw-r--r-- 1 joao joao  62K May  2  2015 Intrinsic.h
8.0K -rw-r--r-- 1 joao joao 6.4K May  2  2015 IntrinsicI.h
 12K -rw-r--r-- 1 joao joao 9.5K May  2  2015 IntrinsicP.h
172K -rw-r--r-- 1 joao joao 172K Sep 23  2016 keysymdef.h
4.0K -rw-r--r-- 1 joao joao 2.8K Sep 23  2016 keysym.h
4.0K -rw-r--r-- 1 joao joao 2.6K May  2  2015 Object.h
8.0K -rw-r--r-- 1 joao joao 6.8K May  2  2015 ObjectP.h
8.0K -rw-r--r-- 1 joao joao 5.4K May  2  2015 PassivGraI.h
4.0K -rw-r--r-- 1 joao joao 2.6K May  2  2015 RectObj.h
8.0K -rw-r--r-- 1 joao joao 6.3K May  2  2015 RectObjP.h
4.0K -rw-r--r-- 1 joao joao 2.9K May  2  2015 ResConfigP.h
4.0K -rw-r--r-- 1 joao joao 3.7K May  2  2015 ResourceI.h
8.0K -rw-r--r-- 1 joao joao 5.1K May  2  2015 SelectionI.h
 20K -rw-r--r-- 1 joao joao  17K May  2  2015 Shell.h
4.0K -rw-r--r-- 1 joao joao  212 May  2  2015 ShellI.h
 16K -rw-r--r-- 1 joao joao  13K May  2  2015 ShellP.h
4.0K drwxr-xr-x 2 joao joao 4.0K Oct 21  2013 SM
 32K -rw-r--r-- 1 joao joao  30K May  2  2015 StringDefs.h
4.0K -rw-r--r-- 1 joao joao 4.0K Sep 23  2016 Sunkeysym.h
8.0K -rw-r--r-- 1 joao joao 4.2K May  2  2015 ThreadsI.h
 20K -rw-r--r-- 1 joao joao  17K May  2  2015 TranslateI.h
4.0K -rw-r--r-- 1 joao joao 2.4K May  2  2015 VarargsI.h
4.0K -rw-r--r-- 1 joao joao 2.8K May  2  2015 Vendor.h
4.0K -rw-r--r-- 1 joao joao 3.5K May  2  2015 VendorP.h
8.0K -rw-r--r-- 1 joao joao 4.5K Sep 23  2016 Xalloca.h
4.0K -rw-r--r-- 1 joao joao 2.9K Sep 23  2016 Xarch.h
4.0K -rw-r--r-- 1 joao joao 2.5K Sep 23  2016 Xatom.h
4.0K -rw-r--r-- 1 joao joao 3.8K Oct 21  2013 Xauth.h
4.0K drwxr-xr-x 2 joao joao 4.0K May  2  2015 Xaw
 24K -rw-r--r-- 1 joao joao  21K Feb 27  2017 Xcms.h
4.0K drwxr-xr-x 2 joao joao 4.0K Jun  3  2014 Xcursor
4.0K -rw-r--r-- 1 joao joao 2.4K Sep 23  2016 Xdefs.h
8.0K -rw-r--r-- 1 joao joao 6.3K Mar 23  2015 Xdmcp.h
 16K -rw-r--r-- 1 joao joao  13K Sep 23  2016 XF86keysym.h
4.0K drwxr-xr-x 2 joao joao 4.0K Jun  6  2014 Xft
8.0K -rw-r--r-- 1 joao joao 7.7K Sep 23  2016 Xfuncproto.h
4.0K -rw-r--r-- 1 joao joao 2.3K Sep 23  2016 Xfuncs.h
 20K -rw-r--r-- 1 joao joao  20K Sep 23  2016 X.h
 32K -rw-r--r-- 1 joao joao  31K Feb 27  2017 XKBlib.h
4.0K -rw-r--r-- 1 joao joao 1.6K Feb 27  2017 XlibConf.h

100K -rw-r--r-- 1 joao joao  98K Feb 27  2017 Xlib.h

 40K -rw-r--r-- 1 joao joao  40K Feb 27  2017 Xlibint.h
4.0K -rw-r--r-- 1 joao joao  506 Feb 27  2017 Xlib-xcb.h
4.0K -rw-r--r-- 1 joao joao 1.3K Feb 27  2017 Xlocale.h
8.0K -rw-r--r-- 1 joao joao 5.1K Sep 23  2016 Xmd.h
4.0K drwxr-xr-x 2 joao joao 4.0K Sep 13  2013 Xmu
4.0K -rw-r--r-- 1 joao joao 3.1K Sep 23  2016 Xosdefs.h
8.0K -rw-r--r-- 1 joao joao 4.3K Sep 23  2016 Xos.h
 36K -rw-r--r-- 1 joao joao  33K Sep 23  2016 Xos_r.h
 16K -rw-r--r-- 1 joao joao  16K Dec 15  2016 xpm.h
8.0K -rw-r--r-- 1 joao joao 7.6K Sep 23  2016 Xpoll.h
 56K -rw-r--r-- 1 joao joao  56K Sep 23  2016 Xproto.h
4.0K -rw-r--r-- 1 joao joao 2.8K Sep 23  2016 Xprotostr.h
8.0K -rw-r--r-- 1 joao joao 5.9K Feb 27  2017 Xregion.h
 12K -rw-r--r-- 1 joao joao  11K Feb 27  2017 Xresource.h
4.0K -rw-r--r-- 1 joao joao 1.7K Jan  3  2015 xshmfence.h
 16K -rw-r--r-- 1 joao joao  13K Sep 23  2016 Xthreads.h
4.0K -rw-r--r-- 1 joao joao 2.9K May  2  2015 Xtos.h
4.0K drwxr-xr-x 2 joao joao 4.0K Sep 13 22:49 Xtrans
 24K -rw-r--r-- 1 joao joao  21K Feb 27  2017 Xutil.h
4.0K -rw-r--r-- 1 joao joao 1.9K Sep 23  2016 Xw32defs.h
4.0K -rw-r--r-- 1 joao joao 3.9K Sep 23  2016 XWDFile.h
4.0K -rw-r--r-- 1 joao joao 3.3K Sep 23  2016 Xwindows.h
4.0K -rw-r--r-- 1 joao joao 2.3K Sep 23  2016 Xwinsock.h

And my env variables.

[joao@joao-pc runegrid]$ printenv

LC_MEASUREMENT=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
XDG_MENU_PREFIX=gnome-
LANG=en_US.UTF-8
GDM_LANG=en_US.UTF-8
HISTCONTROL=ignoredups:erasedups
YAOURT_COLORS=nb=1:pkg=1:ver=1;32:lver=1;45:installed=1;42:grp=1;34:od=1;41;5:votes=1;44:dsc=0:other=1;35
DISPLAY=:1
COLORTERM=truecolor
USERNAME=joao
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
XDG_VTNR=2
GIO_LAUNCHED_DESKTOP_FILE_PID=1313
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
XDG_SESSION_ID=c2
USER=joao
DESKTOP_SESSION=gnome
GOPATH=/home/joao/go
QT_QPA_PLATFORMTHEME=qt5ct
PWD=/home/joao/go/src/github.com/billyninja/runegrid
HOME=/home/joao
JOURNAL_STREAM=8:15319
XDG_SESSION_TYPE=x11
TERMINATOR_DBUS_NAME=net.tenshu.Terminator20x1a6021154d881d
XDG_SESSION_DESKTOP=gnome
GJS_DEBUG_OUTPUT=stderr
LC_NUMERIC=en_US.UTF-8
TERMINATOR_DBUS_PATH=/net/tenshu/Terminator2
MAIL=/var/spool/mail/joao
WINDOWPATH=2
TERM=xterm-256color
SHELL=/bin/bash
VTE_VERSION=4803
XDG_CURRENT_DESKTOP=GNOME
GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/terminator.desktop
XDG_SEAT=seat0
SHLVL=1
PROMPT_COMMAND=echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"
history -a; history -c; history -r
GDMSESSION=gnome
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=joao
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/run/user/1000/gdm/Xauthority
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/bin:/home/joao/go/bin
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
SESSION_MANAGER=local/joao-pc:@/tmp/.ICE-unix/907,unix/joao-pc:/tmp/.ICE-unix/907
LC_TIME=en_US.UTF-8
_=/usr/bin/printenv

What did you expect to see?

The runegrid.apk outputed correctly

What did you see instead?

...
pack r $WORK/golang.org/x/mobile/app.a $WORK/golang.org/x/mobile/app/_obj/_all.o # internal
# github.com/veandco/go-sdl2/sdl
In file included from ../../veandco/go-sdl2/sdl/mouse.go:9:
/usr/include/SDL2/SDL_syswm.h:72:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
1 error generated.

All the best!

@AlexRouSg

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2017

The proper place to ask for help would be https://github.com/golang/go/wiki/Questions, the issue tracker is only for bugs.

You are linking against the linux's SDL instead of the android version. You first need to figure out how to compile SDL with the NDK and then how to get gomobile to use that version instead of the system's. Why are you using both of them together btw.

https://www.libsdl.org/download-2.0.php
https://golang.org/cmd/cgo/

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2018

This seems to be a problem building SDL for Android. Please use the golang-nuts mailing list if you need further help.

@eliasnaur eliasnaur closed this Mar 14, 2018

@golang golang locked and limited conversation to collaborators Mar 14, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.