-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Remove duplicated Yoga compile sources to prevent "duplicate symbols" errors when linking using -force_load #23823
Conversation
…rs when linking using -force_load
|
cc @SidharthGuglani & @davidaurelio too |
Thanks for the fix. I'll import this and ask for a review from the original authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was successfully merged by @tomduncalf in cecd307. When will my fix make it into a release? | Upcoming Releases |
… errors when linking using -force_load (#23823) Summary: This change fixes #23645. The issue is that the `YGMarker.cpp`, `YGValue.cpp`, `YGConfig.cpp` and `log.cpp` files are already included in the Yoga compilation unit, so including these files in React's compile sources too results in "duplicate symbols" errors when loading React Native with `-force_load` (which behaves slightly differently to `-ObjC` - according to a colleague, "ObjC will scan through each object file in each library and force linking of any object file that contains Objective C code, while force_load will link every object file in a particular staticlib (regardless of whether or not the object file contains Objective C code)"). These changes seemed to be introduced by a few commits: - D13819111 -> 43601f1 - D13439602 -> b5c66a3 - D14123390-> e8f95dc - D7530369 -> 95f625e Perhaps we need to check with the original authors/any C++ experts to confirm if this fix is correct - it compiles for me but I'm not sure what the original intention of these changes was. [iOS] [Fixed] - Remove duplicated Yoga compile sources to prevent "duplicate symbols" errors when linking using -force_load Pull Request resolved: #23823 Reviewed By: davidaurelio Differential Revision: D14387657 Pulled By: hramos fbshipit-source-id: d85221b6dc1a0377662624f4201b27222aed8219
Summary
This change fixes #23645.
The issue is that the
YGMarker.cpp
,YGValue.cpp
,YGConfig.cpp
andlog.cpp
files are already included in the Yoga compilation unit, so including these files in React's compile sources too results in "duplicate symbols" errors when loading React Native with-force_load
(which behaves slightly differently to-ObjC
- according to a colleague, "ObjC will scan through each object file in each library and force linking of any object file that contains Objective C code, while force_load will link every object file in a particular staticlib (regardless of whether or not the object file contains Objective C code)").These changes seemed to be introduced by a few PRs:
Perhaps we need to check with the original authors/any C++ experts to confirm if this fix is correct - it compiles for me but I'm not sure what the original intention of these changes was.
Changelog
[iOS] [Fixed] - Remove duplicated Yoga compile sources to prevent "duplicate symbols" errors when linking using -force_load
Test Plan
react-native init project compiles and links with
-force_load
flag as described in #23645