Skip to content

Commit 79baca6

Browse files
Kudofacebook-github-bot
authored andcommitted
Fix RCT-Folly build error when use_frameworks! and hermes are both enabled (#34030)
Summary: This PR is fixing the build errors on iOS when `use_frameworks!` and `:hermes_enabled` are both enabled. There are two errors: - fmt/compile.h include not found: This PR adds fmt in header search paths. - undefined symbols `_jump_fcontext` and `_make_fcontext` from boost. the two symbols are actually not be unused. because to generate the shared library in dynamic framework mode, LTO (Link-Time-Optimization) is not as powerful as generating a single executable. ## Changelog [iOS] [Fixed] - Fix RCT-Folly build error when use_frameworks! and hermes are both enabled Pull Request resolved: #34030 Test Plan: - CI passed - ``` $ npx react-native init RN069 --version next # edit RN069/ios/Podfile to enable use_frameworks! and hermes_enabled # patch node_modules/react-native from both #34011 and this prs' patch $ pod install $ yarn ios ``` Reviewed By: cortinico Differential Revision: D37284084 Pulled By: dmitryrykun fbshipit-source-id: 923fa03d7844d1d227880919c8b2c8614c848d59
1 parent e5c5dcd commit 79baca6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

third-party-podspecs/RCT-Folly.podspec

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ Pod::Spec.new do |spec|
7575
spec.libraries = "c++abi" # NOTE Apple-only: Keep c++abi here due to https://github.com/react-native-community/releases/issues/251
7676
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
7777
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
78-
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/libevent/include/\"" }
78+
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/libevent/include/\" \"$(PODS_ROOT)/fmt/include\"",
79+
# In dynamic framework (use_frameworks!) mode, ignore the unused and undefined boost symbols when generating the library.
80+
"OTHER_LDFLAGS" => "\"-Wl,-U,_jump_fcontext\" \"-Wl,-U,_make_fcontext\""
81+
}
7982

8083
# TODO: The boost spec should really be selecting these files so that dependents of Folly can also access the required headers.
8184
spec.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"" }

0 commit comments

Comments
 (0)