On Monday, April 1, 2019 at 6:30:23 PM UTC+2, Tristian Azuara wrote:
>
> Hi Elias, thank you for the quick reply, I see, you're correct it does 
> support the archs for ios, I had not tried it for ios, because the 
> documentation just mentions that you can specify specific instruction sets 
> when binding for android:
>
> $ gomobile bind --help
>
>
> By default, -target=android builds shared libraries for all supported
>>
>> instruction sets (arm, arm64, 386, amd64). A subset of instruction sets
>>
>> can be selected by specifying target type with the architecture name. 
>>> E.g.,
>>
>> -target=android/arm,android/386.
>>
>>
>>> For -target ios, gomobile must be run on an OS X machine with Xcode
>>
>> installed. The generated Objective-C types can be prefixed with the 
>>> -prefix
>>
>> flag.
>>
>>
> There's no mention that you can filter out instruction sets for iOS but I 
> just tested using it and it works!, thank you for pointing that out.
>
> Now, regarding the bitcode part basically, because it's added 
> automatically; any libraries that don't have BITCODE enabled don't link 
> properly, here's some sample output:
>
> GO111MODULE=off gomobile bind -v -target=ios/arm,ios/arm64,ios/amd64 
> -tags=ios example.com/mobile
> runtime/cgo
> golang.org/x/mobile/internal/mobileinit
> os/user
> net
> example.com/pycore
> example.com/jscore
> # example.com/pycore
> ld: warning: ignoring file pycore/libpython-scriptengine.a, file was built 
> for archive which is not the architecture being linked (armv7): 
> pycore/libpython-scriptengine.a
> ld: warning: object file (/Users/tristian/go/src/
> example.com/pycore/libpython-scriptengine-ios.a(python-scriptengine-ios.o)) 
> was built for newer iOS version (9.3) than being linked (7.0)
> ld: '/Users/tristian/go/src/
> example.com/pycore/libpython-scriptengine-ios.a(python-scriptengine-ios.o)' 
> does not contain bitcode. You must rebuild it with bitcode enabled (Xcode 
> setting ENABLE_BITCODE), obtain an updated library from the vendor, or 
> disable bitcode for this target. for architecture armv7
> clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
> # example.com/jscore
> ld: warning: ignoring file jscore/libscriptengine-ios-x86_64.a, file was 
> built for archive which is not the architecture being linked (armv7): 
> jscore/libscriptengine-ios-x86_64.a
> ld: warning: object file (/Users/tristian/go/src/
> example.com/jscore/libscriptengine-ios-arm.a(test_lib_for_ios.o)) was 
> built for newer iOS version (10.2) than being linked (7.0)
> ld: '/Users/tristian/go/src/
> example.com/jscore/libscriptengine-ios-arm.a(test_lib_for_ios.o)' does 
> not contain bitcode. You must rebuild it with bitcode enabled (Xcode 
> setting ENABLE_BITCODE), obtain an updated library from the vendor, or 
> disable bitcode for this target. for architecture armv7
> clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
> gomobile: darwin-arm: go build -tags ios ios -v -buildmode=c-archive -o 
> /var/folders/g1/v3hz1sm92nv7wbzpg3dx_h_h0000gp/T/gomobile-work-974051835/mobile-arm.a
>  
> gobind failed: exit status 2
>
> make: *** [Mobile.framework] Error 1
>
> This would force us to recompile libpython-scriptengine-ios.a or any 
> other libraries that don't have bitcode support
>
> When I comment out -fembed-bitcode I no longer see that error.
>
>

One thing you should be able to do is disable bitcode in the Xcode project 
settings (suggested as "disable bitcode for this target"). If that doesn't 
work, please file an issue. 

 - elias

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to