From f0bc4914525edf79c92e7fbeceb4c5ee06d8e294 Mon Sep 17 00:00:00 2001 From: Tom Duncalf Date: Mon, 11 Mar 2019 10:00:43 -0700 Subject: [PATCH] Remove duplicated Yoga compile sources to prevent "duplicate symbols" errors when linking using -force_load (#23823) Summary: This change fixes https://github.com/facebook/react-native/issues/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 -> https://github.com/facebook/react-native/commit/43601f1a1735c59c90a73ba2dc127ec4dcfa4fa6 - D13439602 -> https://github.com/facebook/react-native/commit/b5c66a3fbe869daf56b1b29d0a69efa2d83e30ce - D14123390-> https://github.com/facebook/react-native/commit/e8f95dc7a1a630d9e90d3e044a0ccf6c9d76f651 - D7530369 -> https://github.com/facebook/react-native/commit/95f625e151c7abbb05efcd14404c8aa9583faa83 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: https://github.com/facebook/react-native/pull/23823 Reviewed By: davidaurelio Differential Revision: D14387657 Pulled By: hramos fbshipit-source-id: d85221b6dc1a0377662624f4201b27222aed8219 --- React/React.xcodeproj/project.pbxproj | 6 ------ 1 file changed, 6 deletions(-) diff --git a/React/React.xcodeproj/project.pbxproj b/React/React.xcodeproj/project.pbxproj index 2fc11518236..28fcfe85b17 100644 --- a/React/React.xcodeproj/project.pbxproj +++ b/React/React.xcodeproj/project.pbxproj @@ -985,7 +985,6 @@ 59EDBCC61FDF4E55003573DE /* (null) in Copy Headers */ = {isa = PBXBuildFile; }; 59EDBCC71FDF4E55003573DE /* RCTScrollView.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA31FDF4E0C003573DE /* RCTScrollView.h */; }; 59EDBCC81FDF4E55003573DE /* RCTScrollViewManager.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 59EDBCA51FDF4E0C003573DE /* RCTScrollViewManager.h */; }; - 5CE2080220772F7D009A43B3 /* YGConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CE2080020772F7C009A43B3 /* YGConfig.cpp */; }; 5CE2080320772F7D009A43B3 /* YGConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE2080120772F7C009A43B3 /* YGConfig.h */; }; 657734841EE834C900A0E9EA /* RCTInspectorDevServerHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 657734821EE834C900A0E9EA /* RCTInspectorDevServerHelper.h */; }; 657734851EE834C900A0E9EA /* RCTInspectorDevServerHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 657734831EE834C900A0E9EA /* RCTInspectorDevServerHelper.mm */; }; @@ -1047,13 +1046,11 @@ A2440AA21DF8D854006E7BFC /* RCTReloadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; }; A2440AA31DF8D854006E7BFC /* RCTReloadCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = A2440AA11DF8D854006E7BFC /* RCTReloadCommand.m */; }; A2440AA41DF8D865006E7BFC /* RCTReloadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A2440AA01DF8D854006E7BFC /* RCTReloadCommand.h */; }; - AC4A6AF921FB4EA900FBEC39 /* YGMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */; }; AC4A6AFA21FB4EBF00FBEC39 /* YGMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */; }; AC4A6AFB21FB4ECA00FBEC39 /* YGMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC4A6AF821FB4EA900FBEC39 /* YGMarker.cpp */; }; AC52CEDE21FB3FF9003C6BEC /* instrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = AC52CEDD21FB3FF9003C6BEC /* instrumentation.h */; }; AC52CEDF21FB401D003C6BEC /* instrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = AC52CEDD21FB3FF9003C6BEC /* instrumentation.h */; }; AC52CEE021FB403B003C6BEC /* instrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = AC52CEDD21FB3FF9003C6BEC /* instrumentation.h */; }; - AC6B69E321B1467C00B2B68A /* YGValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AC6B69E121B1467C00B2B68A /* YGValue.cpp */; }; AC6B69E421B1467C00B2B68A /* YGValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6B69E221B1467C00B2B68A /* YGValue.h */; }; AC6B69E521B1469A00B2B68A /* YGValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6B69E221B1467C00B2B68A /* YGValue.h */; }; AC6B69E621B146A500B2B68A /* YGValue.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = AC6B69E221B1467C00B2B68A /* YGValue.h */; }; @@ -4427,7 +4424,6 @@ 352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */, 66CD94B71F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */, 008341F61D1DB34400876D9A /* RCTJSStackFrame.m in Sources */, - AC4A6AF921FB4EA900FBEC39 /* YGMarker.cpp in Sources */, 13134C961E296B2A00B9F3CB /* RCTObjcExecutor.mm in Sources */, 59D031FB1F8353D3008361F0 /* RCTSafeAreaViewManager.m in Sources */, 83CBBACC1A6023D300E9B192 /* RCTConvert.m in Sources */, @@ -4459,7 +4455,6 @@ 13134C8E1E296B2A00B9F3CB /* RCTMessageThread.mm in Sources */, 599FAA381FB274980058CCF6 /* RCTSurface.mm in Sources */, 59D031EF1F8353D3008361F0 /* RCTSafeAreaShadowView.m in Sources */, - AC6B69E321B1467C00B2B68A /* YGValue.cpp in Sources */, 3D1E68DB1CABD13900DD7465 /* RCTDisplayLink.m in Sources */, 14F3620E1AABD06A001CE568 /* RCTSwitchManager.m in Sources */, 13B080201A69489C00A75B9A /* RCTActivityIndicatorViewManager.m in Sources */, @@ -4516,7 +4511,6 @@ 13A1F71E1A75392D00D3D453 /* RCTKeyCommands.m in Sources */, 83CBBA531A601E3B00E9B192 /* RCTUtils.m in Sources */, 130443C61E401A8C00D93A67 /* RCTConvert+Transform.m in Sources */, - 5CE2080220772F7D009A43B3 /* YGConfig.cpp in Sources */, 191E3EC11C29DC3800C180A6 /* RCTRefreshControl.m in Sources */, 3DCE532B1FEAB23100613583 /* RCTDatePickerManager.m in Sources */, 13C156051AB1A2840079392D /* RCTWebView.m in Sources */,