Skip to content

fix: add missing SanitizeLeak.cpp to RCT-Folly podspec#2943

Draft
Saadnajmi wants to merge 1 commit intomicrosoft:mainfrom
Saadnajmi:fix/folly-sanitizeleak-dynamic-frameworks
Draft

fix: add missing SanitizeLeak.cpp to RCT-Folly podspec#2943
Saadnajmi wants to merge 1 commit intomicrosoft:mainfrom
Saadnajmi:fix/folly-sanitizeleak-dynamic-frameworks

Conversation

@Saadnajmi
Copy link
Copy Markdown
Collaborator

Summary

  • Add folly/memory/SanitizeLeak.cpp to the RCT-Folly.podspec source_files list

The file exists in the Folly source tree (fetched by CocoaPods from the Folly repo) but was never compiled because it wasn't listed in the podspec. It provides implementations for annotate_object_leaked_impl, annotate_object_collected_impl, and annotate_object_count_leaked_uncollected_impl — symbols declared in SanitizeLeak.h and referenced from small_vector.h.

With static libraries this is benign (linker skips unreferenced symbols), but with USE_FRAMEWORKS=dynamic the linker must resolve every symbol, causing:

Undefined symbols for architecture x86_64:
  "folly::detail::annotate_object_leaked_impl(void const*)", referenced from: ...
  "folly::detail::annotate_object_collected_impl(void const*)", referenced from: ...
ld: symbol(s) not found for architecture x86_64

This is also an upstream bug (facebook/react-native) — their test_ios_rntester_dynamic_frameworks job is marked continue-on-error: true for this same reason.

Test plan

  • RNTester builds with USE_FRAMEWORKS=dynamic on iOS simulator (previously failed at link time)
  • RNTester static library builds remain unaffected

🤖 Generated with Claude Code

The Folly `SanitizeLeak.cpp` file provides implementations for
`annotate_object_leaked_impl`, `annotate_object_collected_impl`,
and `annotate_object_count_leaked_uncollected_impl`. These symbols
are declared in `SanitizeLeak.h` and referenced by
`small_vector.h`, but the .cpp was not listed in the podspec's
source_files.

With static libraries this is benign — the linker skips unreferenced
symbols. With `USE_FRAMEWORKS=dynamic` the linker must resolve every
symbol, causing an "undefined symbols for architecture x86_64" error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Saadnajmi Saadnajmi requested a review from a team as a code owner April 22, 2026 22:34
@Saadnajmi Saadnajmi marked this pull request as draft April 22, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant