Skip to content

Commit a5e2042

Browse files
authored
Compile folly's SanitizeLeak.cpp in Fantom's tester
## Summary: Fantom's tester doesn't link when it's built with AddressSanitizer. Under `-fsanitize=address`, folly headers like `small_vector.h` and `Singleton.h` call `folly::detail::annotate_object_leaked_impl` and `annotate_object_collected_impl`, and only `folly/memory/SanitizeLeak.cpp` defines them. Fantom's folly build compiles `SanitizeAddress.cpp` and `SanitizeThread.cpp` but not that file, so the link fails on both symbols. This adds `folly/memory/SanitizeLeak.cpp` to `folly_runtime_SRC`, which the `RCT-Folly` podspec already compiles. Without ASan the file only defines those functions, nothing calls them. Fixes #59668 ## Changelog: [INTERNAL] [FIXED] - Fix Fantom tester link under AddressSanitizer by compiling folly's SanitizeLeak.cpp ## Test Plan: I couldn't run the full Fantom build here, so I checked the link against folly v2024.11.18.00 (the version Fantom pins) with clang and `-fsanitize=address`. A small program using `folly::small_vector`, linked with the `folly_runtime` sources it needs, fails with undefined `annotate_object_leaked_impl` / `annotate_object_collected_impl`. Adding `SanitizeLeak.cpp` makes it link and run. Differential Revision: D128600166 Pull Request resolved: #59674
1 parent 4d536fa commit a5e2042

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎private/react-native-fantom/tester/third-party/folly/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ SET(folly_runtime_SRC
4848
folly/lang/SafeAssert.cpp
4949
folly/lang/ToAscii.cpp
5050
folly/memory/SanitizeAddress.cpp
51+
folly/memory/SanitizeLeak.cpp
5152
folly/memory/detail/MallocImpl.cpp
5253
folly/net/NetOps.cpp
5354
folly/portability/SysUio.cpp

0 commit comments

Comments
 (0)