Undefined symbols for architecture arm64 #251
Comments
As a note -- @miinos was experiencing same issue (with hermes enabled): #246 (comment) |
Hmm, it looks like this wasn't a new issue according to https://developer.apple.com/forums/thread/684441 and facebook/flipper#2600 From the Flipper issue, it seems like a Folly upgrade (?) triggered this somehow. The error here is on RCT-Folly though, not Flipper's, and we did upgrade Folly version in the 0.66 RCs. @swrobel: One thing to check: given the new app template was able to build successfully, I wonder if your Xcode DerivedData or any other build temp dir was out of sync (state with the old version). Could you try wiping your DerivedData completely, re-run |
@fkgozali I removed derived data, reinstalled pods, and the result is the same. |
hmm I see - have you tried generating a brand new app with 0.66.rc2, then building with Hermes in release flavor? I'm now curious if we get the same error in the fresh app |
Same issue with a fresh 0.66.rc2 app. hermes enabled. |
What's the correct way to do this? I used |
@swrobel |
You'll need to also change the |
FYI, I couldn't repro this using 0.66.rc2 on a fresh new app (via Could you share more about the exact repro steps (perhaps you built it via command line like |
@fkgozali I tried the following configurations:
These situations occur regardless of whether I build with the XCode UI or xcodebuild, and regardless of whether I'm building for release. I mentioned release builds earlier, but that's only because they were causing arm64 to be added to the targets. When I build for dev with an arm64 target, the same error occurs. There seems to be some interesting conversation going on in the flipper repo here about a similar folly build error. To note: this only happens when building on my Intel Macbook for an arm64 target. When building for the simulator (which I presume builds for an intel target on my intel macbook), the build succeeds with hermes enabled. Hope this helps! |
Yeah thanks for the extra context, we also figured out that it's |
The fix is landing. One thing to note is that I couldn't repro this on RNTester on main, even when building for arm64. I didn't dig deeper for why, because the priority is to make new app working properly. |
Even with Hermes enabled? |
No I didn't try that, because with the new app template, we didn't need Hermes to repro the issue. |
@fkgozali did the fix land? wanted to try out the new RC |
@filipac not yet - I'm landing it right now, but we had unrelated internal CI issue that prevented landing. Should be done later today. |
thanks! you're doing great job! |
Just a heads up that it's still not landing and it may take longer. Worst case, expect something early next week. |
Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See react-native-community/releases#251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca
Summary: Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this: ``` Undefined symbols for architecture arm64: "___cxa_increment_exception_refcount", referenced from: folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` See react-native-community/releases#251 Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`. Changelog: [Fixed][iOS] Unbreak Folly linker error Reviewed By: lunaleaps Differential Revision: D30950944 fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca
This was picked to RC 0.66: facebook/react-native@8b6d7fd Keeping this open until fully verified |
@swrobel, @filipac, @miinos: https://github.com/facebook/react-native/releases/tag/v0.66.0-rc.3 is available, so you can try it out and see if it solves the problem for you all. |
Fixed for me on the new rc. Thank you so much for your responsiveness, and for the quick fix! |
Yay! That’s great, I’ll close this issue then. Thanks for helping us with repro steps. |
I'm on the road right now but got an M1 timeslice in - confirmed for me as well on 0.66.0-rc.3, nice! |
Version
0.66.0-rc.2
Developer Environment
macOS 11.5.2 (Intel)
Xcode 12.5.1
Podfile.lock:
Issue and Reproduction Steps
0.66.0-rc2 is the first I've attempted upgrading my 0.64.2 project to, and I am consistently getting this error when building for Release with Hermes enabled:
Builds just fine for debugging on the iOS simulator, and for Android Release.
Related issue: facebook/folly#1655
The text was updated successfully, but these errors were encountered: