-
Notifications
You must be signed in to change notification settings - Fork 18k
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/cmd/gomobile: brackets expression not supported on this target #43331
Comments
Have you tried with Go 1.15? 1.13 is no longer supported. |
I'm seeing the same issue with go1.16beta1 (dropped this week) on the new M1 Mac. However, when I build go from source from commit a508840 (last week), it works fine. |
Is this problem reproducible even with a small iOS project on a supported version of Go? If so, can you please share a complete sequence of steps to trigger the problem, and include the full output? (If it's large, you can paste it elsewhere and link to it, or place it in a <details> tag.) CC @cherrymui, @hajimehoshi. |
That error is due to the C compiler targeting the wrong architecture. It would be good to know how the Go toolchain and C toolchain are invoked. (I'm not familiar with gomobile to tell.) @ebilling if you are on an M1, it may be due to x86 environment "slips" in, which causes the C compiler being invoked as an x86 binary (instead of ARM64 binary), which targets x86 by default. It may be helpful to run commands under |
I believe it does, see https://github.com/golang/mobile/blob/e6ae53a27f4fd7cfa2943f2ae47b96cba8eb01c9/cmd/gomobile/env.go#L170-L172. The original issue had |
According to the discussion above, I think the issue can be closed as nonreproducible and outdated. (feel free to reopen it if the problem remains) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I don't believe this issue is related to Go itself, but instead to the gomobile package.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I installed gomobile using the following commands:
After which, i attempted to build a project using
gomobile bind -target ios
, however when I do i see a bunch of these messages spat out.gcc_arm64.S:27:16: error: brackets expression not supported on this target stp x19, x20, [sp, #-16]!
I think this may be an old issue that was closed back in go1.5: #11339
I'm not seeing the darwin_arm or darwin_arm64 directories in my $GOROOT/pkg directory, and i think I'm supposed to be.
What did you expect to see?
The iOS Framework compiled successfully.
What did you see instead?
The above errors.
The text was updated successfully, but these errors were encountered: