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

Discussion: Folly use of an OpenSSL pod that is built with bitcode turned on #485

Closed
davidmcraejr opened this issue Jul 10, 2019 · 37 comments

Comments

@davidmcraejr
Copy link

Thoughts on switching to using a pod that includes bitcode support for OpenSSL which is a dependency of Folly such as openssl-ios-bitcode

Side note: anyone know which repo Follys podspec originates from?

@priteshrnandgaonkar
Copy link
Contributor

Folly podspec's definition is here. The source code to which it refers to is this.

Let me try using openssl-ios-bitcode

@davidmcraejr
Copy link
Author

Thanks @priteshrnandgaonkar!

@matt-oakes
Copy link

This shouldn't have been closed. The OpenSSL-Universal pod contains a pre-compiled binary which does not support Bitcode. Therefore, if you want to build for real devices and have Flipper integrated, you can't have Bitcode enabled.

@CooCooCaCha
Copy link

Please reopen, this is still an issue. I cannot debug on-device with react-native right now.

@mikehardy
Copy link

Confirmed - this is starting to surface as support issues in other repositories - invertase/react-native-firebase#3384 - @priteshrnandgaonkar please reopen

@mikehardy
Copy link

For affected react-native people - @matt-oakes - I turned bitcode off in debug builds and it worked, and I kept it on for release mode builds and sent it to TestFlight, it seems to work fine, so there's a workaround for now that seems to work okay

@Benzer1406
Copy link

Turning off Bitcode in debug builds triggered a lot of Swift Code errors. Please reopen and provide a fix.

@unfrgivn
Copy link

unfrgivn commented May 18, 2020

@priteshrnandgaonkar I apologize for my ignorance on how React Native / Flipper / Folly are all tied together but this was just merged yesterday and possibly solves this issue without having to disable bitcode? krzyzanowskim/OpenSSL#83 into 1.0.2.20

The folly pod is locked to 1.0.2.19 so I did not patch the podspecs and test if it resolves the Xcode build issue or not.

mikehardy added a commit to mikehardy/flipper that referenced this issue May 18, 2020
Per comment in facebook#485 (comment) it appears that OpenSSL will have bitcode information in it now which should solve problems like those experienced in facebook#485 and it's connected issues
@mikehardy
Copy link

@unfrgivn I proposed this based on your comment, we'll see #1171

@priteshrnandgaonkar
Copy link
Contributor

I will check if updating the openssl dependency solves the bitcode issue.

@priteshrnandgaonkar
Copy link
Contributor

priteshrnandgaonkar commented May 19, 2020

I tried using the latest openssl dependency with bitcode set enabled and disabled, but, I got the following error. Seems like the latest binary doesn't have all the symbols.

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@priteshrnandgaonkar
Copy link
Contributor

priteshrnandgaonkar commented May 19, 2020

We depend on OpenSSL, unless we get the dependency of OpenSSL with bitcode enabled, Flipper, won't be able to support bitcode enabled in debug.

As @mikehardy pointed out, you can disable the bitcode for debug builds and enable it for Prod builds as Flipper is not part of the prod builds.

We would expect a fix regarding this from the community, as right now we are tied with this OpenSSL dependency which doesn't support bitcode.

I am happy to try other dependency for OpenSSL, just let me know, if you find a good one. I tried using openssl-ios-bitcode. It builds the OpenSSL binaries(with bitcode support) when one builds the apps. Due to this the fresh build time were really slow. That's why we didn't use it. But maybe we can use the build script of it to build the openssl with bitcode support and then use that binaries directly just like krzyzanowskim/OpenSSL.

@priteshrnandgaonkar priteshrnandgaonkar removed their assignment May 19, 2020
@stale
Copy link

stale bot commented Aug 22, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale label Aug 22, 2020
@chrisbobbe
Copy link

@Stale bot please go away—there's been recent activity on this in #1171.

@stale stale bot removed the Stale label Aug 26, 2020
@mweststrate
Copy link
Contributor

@Stale bot please go away—there's been recent activity on this in #1171.

🤯

@eggybot
Copy link

eggybot commented Aug 27, 2020

I can confirm that this issue still showing for RN v0.63.2, please note if I'm using a Simulator in Debug the result was success without any error. But if I test it in an actual iPhone device (model 7, 8, 11) this error exist.

@justinjoyn
Copy link

Running into this after I updated Xcode to v12.

ld: in /Users/user/Projects/example/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/user/Projects/example/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

On "react-native": "0.62.2"

@maxammann
Copy link

@justinjoyn I think that is not related. This issue is about missing bitcode in a specific openssl release

@Gurpreetgpsingh
Copy link

I tried using the latest openssl dependency with bitcode set enabled and disabled, but, I got the following error. Seems like the latest binary doesn't have all the symbols.

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Am also facing this issue in react native 0.63.3 and Xcode 11.3
Please let me know if anyone having any clue

@arun-es
Copy link

arun-es commented Oct 14, 2020

On Mojave, I am exploring upgrading Xcode to 11.7. If this works, I will update you.

@arun-es
Copy link

arun-es commented Oct 14, 2020

I can now confirm this works. It solved my problem.
https://stackoverflow.com/a/61013836/2940495

@mweststrate
Copy link
Contributor

mweststrate commented Oct 14, 2020 via email

@ghasemikasra39
Copy link

I am facing:

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

after upgrade to 0.63.3. Any solution?

@Gurpreetgpsingh
Copy link

I am facing:

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

after upgrade to 0.63.3. Any solution?

I updated Xcode from 11.3 to 11.7
then issue is fixed

@developius
Copy link

Upgrading to Xcode 11.7 fixed it for me too (RN v0.63.3).

@ghasemikasra39
Copy link

Upgrading to Xcode 12 fixed it for me

@mikehardy
Copy link

Upgrading to Xcode did nothing - what happened is they released a fix in their podspecs to similar to PR worked through here #1171 - it's resolved now via effort not magic ;-)

@paolorr
Copy link

paolorr commented Oct 16, 2020

Upgrading to Xcode did nothing - what happened is they released a fix in their podspecs to similar to PR worked through here #1171 - it's resolved now via effort not magic ;-)

@mikehardy I'm using Mohave 10.14.6 and XCode 11.0. Does this PR has to do with latest versions of XCode? Because with Flipper-Folly 2.3.0 I get the ___darwin_check_fd_set_overflow error but if I revert to 2.2.0 it works with Xcode 11.0

@mikehardy
Copy link

I don't know, given Apple requires you support their latest mobile operating system APIs, and the newer Xcode versions are required to do so, I can't imagine not using current stable Xcode, so I haven't tested 11 since 12 came out, and don't see the utility of doing so?

@skheirandish
Copy link

skheirandish commented Oct 16, 2020

Im having the same issue as of today. Using Catalina 10.15.7 on Xcode 11.3.1. with react-native: 0.62.2 Will update Xcode and post my findings in this comment.

Update: Yes, updating to new Xcode 11.7 did actually solve my problem. Thank you!

@lzhlewis2015
Copy link

I tried using the latest openssl dependency with bitcode set enabled and disabled, but, I got the following error. Seems like the latest binary doesn't have all the symbols.

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Am also facing this issue in react native 0.63.3 and Xcode 11.3
Please let me know if anyone having any clue

I also facing the same issue with you

@gu7araujo
Copy link

Only can solve the problem, who can update Xcode to 11.7?

@muz786
Copy link

muz786 commented Oct 20, 2020

@mikehardy Does this fix work for macOS Mojave Xcode 11.3? or i have to update to macOS Catalina and install 11.7?

@mikehardy
Copy link

I believe the general rule is that if you develop things for apple platforms you use the most up to date Xcode
I believe Xcode 12 is required to support iOS14 features, for instance, and some of them (like permissions they added/changed) are required if you touch them. Which is a long-ish way of saying I don't really know, I use up to date Xcode as a matter of course and forward-port to required changes in order to avoid unexpected app store rejections

@ronilitman
Copy link

@mweststrate Hi, any news regarding the new version that should solve this issue?
Thank you :)

@mikehardy
Copy link

It's released, this is not a problem anymore.

@numandev1
Copy link

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 a pull request may close this issue.