Skip to content

[RN][iOS] Fix symbol not found _jump_fcontext with use_frameworks! #42228

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

cipolleschi
Copy link
Contributor

@cipolleschi cipolleschi commented Jan 10, 2024

Summary:

While developing Xcode 15, Apple reimplemented the linker.
In Xcode 15.0, the linker was making old iOS (< 15) crash when they were built using Xcode 15.

To fix that, we make Apple create new compiler flags (-ld_classic) to have a backward compatible linker.

In Xcode 15.1, Apple fixed that behavior, so the flags should not be required anymore.
But now, if we pass -ld_classic to the linker and we have an app that is using use_framworks!, that app crashes at startup.

This change remove the flags if the Xcode that is used is 15.1 or greater.

Note: The previous change added the flags to Hermes as well. I tested this fix in a configuration where Hermes has the flags and React Native does not, and it works. So we are removing the flags only from React Native.

Changelog:

[Internal] - Do not add the -ld_classic flag if the app is built with Xcode 15.1 or greater.

Test Plan:

Tested locally that a new app with use_frameworks! is not crashing.
Tested on Firebase Testlab that a new app built with Xcode 15.2 and running on iOS <15 is not crashing at startup.

@cipolleschi cipolleschi changed the base branch from main to 0.72-stable January 10, 2024 13:23
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Jan 10, 2024
@cipolleschi cipolleschi marked this pull request as ready for review January 10, 2024 13:27
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,492,716 -8,276,890
android hermes armeabi-v7a 7810647 n/a
android hermes x86 8962844 n/a
android hermes x86_64 8824115 n/a
android jsc arm64-v8a 9,151,548 -11,014,019
android jsc armeabi-v7a 8341174 n/a
android jsc x86 9204829 n/a
android jsc x86_64 9463508 n/a

Base commit: 9525074
Branch: main

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner Pick Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants