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: Xcode 8.3 bitcode_strip can't build with Go Mobile Binding #19861

Closed
hwchong opened this issue Apr 6, 2017 · 10 comments

Comments

Projects
None yet
10 participants
@hwchong
Copy link

commented Apr 6, 2017

Please answer these questions before submitting your issue. Thanks!

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

go version go1.8 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/honweng/Documents/Code/Go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8s/75c7bbxj0zx0xtlfvv2yc2tr0000gn/T/go-build482274973=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

Followed the instructions on here:
https://github.com/golang/go/wiki/Mobile#building-and-deploying-to-ios-1

Built using Xcode 8.3

What did you expect to see?

A succesful build.

What did you see instead?

Build fails with error:

PBXCp FooBar/Hello.framework /Users/honweng/Library/Developer/Xcode/DerivedData/FooBar-gnwbvbargozrzgaffidrdhuynwab/Build/Products/Debug-iphoneos/FooBar.app/Frameworks/Hello.framework
cd /Users/honweng/Desktop/FooBar
export PATH="/Applications/Xcode8.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode8.3.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -exclude Headers -exclude PrivateHeaders -exclude Modules -exclude *.tbd -bitcode-strip all -bitcode-strip-tool /Applications/Xcode8.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip -resolve-src-symlinks /Users/honweng/Desktop/FooBar/FooBar/Hello.framework /Users/honweng/Library/Developer/Xcode/DerivedData/FooBar-gnwbvbargozrzgaffidrdhuynwab/Build/Products/Debug-iphoneos/FooBar.app/Frameworks

/Applications/Xcode8.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip /Users/honweng/Desktop/FooBar/FooBar/Hello.framework/Versions/A/Hello -r -o /Users/honweng/Library/Developer/Xcode/DerivedData/FooBar-gnwbvbargozrzgaffidrdhuynwab/Build/Products/Debug-iphoneos/FooBar.app/Frameworks/Hello.framework/Versions/A/Hello
/Applications/Xcode8.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip: string table not at the end of the file (can't be processed) in file: /Users/honweng/Desktop/FooBar/FooBar/Hello.framework/Versions/A/Hello(go.o) (for architecture armv7)
error: bitcode_strip /Users/honweng/Desktop/FooBar/FooBar/Hello.framework/Versions/A/Hello: /Applications/Xcode8.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip exited with 1

@gopherbot gopherbot added this to the Unreleased milestone Apr 6, 2017

@bradfitz bradfitz added the mobile label Jul 20, 2017

@remirobert

This comment has been minimized.

Copy link

commented Aug 13, 2017

same issue. Works on simulator, but not on the real device.

@petethepig

This comment has been minimized.

Copy link

commented Sep 8, 2017

pasted_image_9_7_17__7_46_pm
Disabling bitcode worked for me

@khoango

This comment has been minimized.

Copy link

commented Sep 14, 2017

I face with same issue. Xcode version 8.3.3, golang 1.9.
Old version compile with golang 1.8 is ok

I set Bitcode same @petethepig but still error

--> update

I down to go 1.8.3, reinit gomobile, build and it work.

@remirobert

This comment has been minimized.

Copy link

commented Sep 14, 2017

@khoango I managed to fixed that for go 1.8, but I have the same issue for the 1.9

@dzwicker

This comment has been minimized.

Copy link

commented Oct 4, 2017

Hi, the setting for bitcode is gone in xcode 9!

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2018

Is this a problem still? I regularly run gomobile bind apps from Xcode 9.2. The bitcode setting is not gone.

@solua

This comment has been minimized.

Copy link

commented Mar 19, 2018

It's ok with golang 9.4 and latest gomobile version

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2018

Thank you.

@eliasnaur eliasnaur closed this Mar 19, 2018

@crossle

This comment has been minimized.

Copy link

commented Apr 3, 2018

error: bitcode_strip xxx.framework/Versions/A/Goutils: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip exited with 1
Xcode 9.3

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2018

This issue is closed. Please open a new issue with detailed instructions to reproduce your error. Also, please make sure bitcode is disabled for your project.

@golang golang locked and limited conversation to collaborators Apr 3, 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.