Skip to content

fbcode_builder: force snappy to build with RTTI#459

Open
afrind wants to merge 1 commit into
facebook:mainfrom
afrind:export-D106941114
Open

fbcode_builder: force snappy to build with RTTI#459
afrind wants to merge 1 commit into
facebook:mainfrom
afrind:export-D106941114

Conversation

@afrind
Copy link
Copy Markdown
Contributor

@afrind afrind commented May 31, 2026

Summary:
folly's Compression.cpp dynamic_casts snappy::Source / snappy::Sink, which requires their typeinfo symbols. The snappy revision pinned in our manifest (27ab5f7f...) hardcodes -fno-rtti in CMAKE_CXX_FLAGS and even strips any -frtti we try to inject, so libsnappy.so ships without typeinfo for those polymorphic bases. Any downstream that actually pulls in folly's Snappy codec (proxygen, mvfst, folly's own compression_compression_test which is gated behind BUILD_SLOW_TESTS) fails to link with:

undefined reference to `typeinfo for snappy::Source'

Override via CMAKE_CXX_FLAGS_<CONFIG>, which CMake appends after CMAKE_CXX_FLAGS and snappy doesn't touch — the trailing -frtti wins over the earlier -fno-rtti in gcc.

Differential Revision: D106941114

Summary:
folly's `Compression.cpp` `dynamic_cast`s `snappy::Source` / `snappy::Sink`, which requires their typeinfo symbols. The snappy revision pinned in our manifest (`27ab5f7f...`) hardcodes `-fno-rtti` in `CMAKE_CXX_FLAGS` and even strips any `-frtti` we try to inject, so `libsnappy.so` ships without typeinfo for those polymorphic bases. Any downstream that actually pulls in folly's Snappy codec (proxygen, mvfst, folly's own `compression_compression_test` which is gated behind `BUILD_SLOW_TESTS`) fails to link with:

  undefined reference to `typeinfo for snappy::Source'

Override via `CMAKE_CXX_FLAGS_<CONFIG>`, which CMake appends after `CMAKE_CXX_FLAGS` and snappy doesn't touch — the trailing `-frtti` wins over the earlier `-fno-rtti` in gcc.

Differential Revision: D106941114
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 31, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 31, 2026

@afrind has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106941114.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant