hvge / openssl-libs

A set of OpenSSL crypto libraries, precompiled for various platforms
0 stars 4 forks source link

iOS Bitcode support #1

Open ludekvlk opened 7 years ago

ludekvlk commented 7 years ago

Problem: WatchOS needs bitcode enabled. When trying to build with bitcode enabled (iOS and WatchOS) it fails on Build/Intermediates/ArchiveIntermediates/TEST/BuildProductsPath/Release-iphoneos/libcc7-ios.a(bn_ctx.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.

Solution: Add bitcode support for libcrypto.a in CC7. Here is some snippet: https://gist.github.com/steipete/ce09ba176a4b8ef66b2d

hvge commented 7 years ago

Thanks for your report. It's a good idea to have bitcode supported in cc7 & OpenSSL, but I have to investigate more into the problematic. The problem is that OpenSSL's big number arithmetic depends heavily on few hand written assembly routines, so enabling the bitcode means big loss in performance. It also has some security implications (check this article for details), so the solution needs to be carefully considered.

I personally don't like this technology, but if it's required for watchOS, then of course I'll add the support. It will be probably implemented in a separate platform specific target.