Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enable Bitcode #553

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

Merged
merged 2 commits into from
Feb 26, 2016
Merged

Enable Bitcode #553

merged 2 commits into from
Feb 26, 2016

Conversation

pietbrauer
Copy link
Member

It may eventually, under certain circumstance work on my machine. It may also be a pretty naive attempt on solving this issue.

I tried to solve this while adding a tvOS target and at least the compiler did not complain anymore that bit code must be enabled (which it did before). It does not seem that lipo is stripping any symbols and OpenSSL can just be compiled using bitcode as describes by these fine gentleman here: https://gist.github.com/felix-schwarz/c61c0f7d9ab60f53ebb0

@pietbrauer
Copy link
Member Author

Somehow Creating_a_blame_with_options__should_follow_the_instructions_provided_by_the_GTBlameOptionsOldestCommitOID_key_Userstravisbuildlibgit2objectivegitObjectiveGitTestsGTBlameSpecm_61 get stuck on iOS 🤔

@phatblat
Copy link
Member

You can validate whether the output binaries contain bitcode with 'otool -l file | grep bitcode'

@pietbrauer
Copy link
Member Author

Did that, they all do 😊

@phatblat
Copy link
Member

Sweet! Either lipo changed or I was doing something wrong. Most likely the latter.

@pietbrauer
Copy link
Member Author

Most likely I miss something important 😀 Have to check again an integrate it into an actual app. When I did with tvOS I got the stupid umbrella header errors again.

@pietbrauer
Copy link
Member Author

I will wait for #555 and #554 to be merged before tackling it again, the tests are really unreliable at the moment. See the current master build, which was green in the PullRequest https://travis-ci.org/libgit2/objective-git/builds/111554295

@pietbrauer
Copy link
Member Author

@phatblat green 👍

@phatblat phatblat self-assigned this Feb 26, 2016
@phatblat
Copy link
Member

You did it! I'll look this over.

@phatblat
Copy link
Member

Just a note - due to the nature of the build scripts not rebuilding things, static libraries built from a commit before this change will cause one or more of the following linker errors due to not being built with bitcode.

ld: 'External/ios-openssl/lib/libssl.a(s2_meth.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 arm64
ld: 'External/libssh2-ios/lib/libssh2-ios.a(channel.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 arm64
ld: 'External/libgit2-ios/libgit2-ios.a(annotated_commit.c.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 arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

No surprise, but in case anyone runs across this in the future, just remove these files and rebuild.

rm External/ios-openssl/lib/libssl.a
rm External/libssh2-ios/lib/libssh2-ios.a
rm External/libgit2-ios/libgit2-ios.a

@phatblat
Copy link
Member

otool -l External/libssh2-ios/lib/libssh2-ios.a | grep bitcode | head -n 1
 sectname __bitcode
otool -l External/ios-openssl/lib/libssl.a | grep bitcode | head -n 1
 sectname __bitcode
otool -l External/ios-openssl/lib/libssl.a | grep bitcode | head -n 1
 sectname __bitcode
otool -l /Volumes/DerivedData/ObjectiveGitFramework-drtqacfhlqybdcdpqayztrrwneun/Build/Products/Debug-iphoneos/ObjectiveGit.framework/ObjectiveGit  | grep __LLVM | head -n 1
  segname __LLVM

Apparently, __LLVM is a better string to search for

phatblat added a commit that referenced this pull request Feb 26, 2016
@phatblat phatblat merged commit 3feac54 into master Feb 26, 2016
@pietbrauer pietbrauer deleted the piet/bitcode branch February 26, 2016 05:34
@pietbrauer pietbrauer mentioned this pull request Feb 26, 2016
@pietbrauer pietbrauer mentioned this pull request Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants