-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/go: Cross compiling Go c archives for iOS does not generate bitcode #12682
Comments
The Go toolchain doesn't generate LLVM bitcode. LLVM bitcode format is unstable, so pretty much you've |
I figured as much with the new Go toolchain. That might turn into a major problem going forward though, assuming Go wants to support mobile development on iOS (which is I assume the intent of https://github.com/golang/mobile/). Bitcode is part of the new app thining, and submission to the App Store for WatchOS apps must already be in bitcode. It's currently optional for iOS apps, but maybe it will be required for iOS 10 next year. I would bet that it is at most 2 years away. Apple has a long history of architecture transitions and they are typically quite aggressive as well. PS: What do you mean by the "gc toolchain"? |
LLVM still lacks essential features to support the Go runtime (i.e. stack
map, write barriers?). Perhaps the write barrier thing isn't too big as we
can emulate it, but we cannot emulate stack map without also implement our
own stack -- then much of the benefit of LLVM is gone.)
If bitcode is required, then iOS development might need to use an
alternative toolchain (e.g. llgo), until we figure out a way to support a
LLVM backend (probably won't happen because gc has always been using its
own backend and it allows much faster evolution as we don't need to wait
before required features are implemented in 3rdparty software)
The gc toolchain refers to the toolchain in this GitHub repository.
|
Got it, thanks. |
Even if setting
CC
andCXX
to include-fembed-bitcode
while building against the iPhoneOS SDK, the resulting static library does not contain bitcode.I made a sample test project here: https://github.com/swisspol/Go-Bridge
The text was updated successfully, but these errors were encountered: