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/gl: Can't be compiled for iOS (gomoible bind -target ios) #16067

Closed
hajimehoshi opened this issue Jun 15, 2016 · 1 comment
Closed

Comments

@hajimehoshi
Copy link
Member

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

go version go1.6.2 darwin/amd64

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hajimehoshi/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

Run gomobile bind -target ios a lib using x/mobile/gl but fails:

gomobile: darwin-x86_64: go build -p=4 -pkgdir=/Users/hajimehoshi/go/pkg/gomobile/pkg_darwin_amd64 -tags="" -buildmode=c-archive -tags=ios -o /var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/gomobile-work-360738871/mobile-amd64.a /var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/gomobile-work-360738871/src/iosbin/main.go failed: exit status 2
# golang.org/x/mobile/gl
In file included from ../../../golang.org/x/mobile/gl/work.go:22:
./work.h:20:10: fatal error: 'OpenGL/gl3.h' file not found
#include <OpenGL/gl3.h>
         ^
1 error generated.

It looks like in x/mobile/gl, os_osx is always defined on darwin,amd64 and os_ios is not defined, while gomoible bind -target ios tries to compile a lib with darwin,arm, darwin,arm64 and darwin,amd64.

@gopherbot
Copy link

CL https://golang.org/cl/24140 mentions this issue.

@golang golang locked and limited conversation to collaborators Jun 15, 2017
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
Now `gomobile bind -target ios` tries to compile a lib with
`darwin/arm`, `darwin/arm64`, and `darwin/amd64`. In the last
case, a tag `ios` is always added. In `x/mobile/gl`, the last case
`darwin/arm64` was not considered well and causes a compile error.
This CL fixes this compile error.

Fixes golang/go#16067

Change-Id: I56be73f373d9985c067a07e5084fa6b9f1ef76a0
Reviewed-on: https://go-review.googlesource.com/24140
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
Now `gomobile bind -target ios` tries to compile a lib with
`darwin/arm`, `darwin/arm64`, and `darwin/amd64`. In the last
case, a tag `ios` is always added. In `x/mobile/gl`, the last case
`darwin/arm64` was not considered well and causes a compile error.
This CL fixes this compile error.

Fixes golang/go#16067

Change-Id: I56be73f373d9985c067a07e5084fa6b9f1ef76a0
Reviewed-on: https://go-review.googlesource.com/24140
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants