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

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

Merged
merged 1 commit into from
Jan 25, 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.73-stable January 10, 2024 13:15
@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
Copy link

github-actions bot commented Jan 10, 2024

Warnings
⚠️

Can't find the E2E test log for ci/circleci: test_e2e_ios. Job link

Generated by 🚫 dangerJS against a2771ce

@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,499,782 -8,269,811
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 9,754,358 -10,411,204
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 7d8af3b
Branch: main

@blakef blakef merged commit 23f1dd6 into 0.73-stable Jan 25, 2024
64 of 67 checks passed
@blakef blakef deleted the cipolleschi/fix-linking-issue-xcode15_1 branch January 25, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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