Skip to content

Disable RTTI in C++ source#7

Closed
pcapriotti wants to merge 1 commit intobos:masterfrom
wireapp:master
Closed

Disable RTTI in C++ source#7
pcapriotti wants to merge 1 commit intobos:masterfrom
wireapp:master

Conversation

@pcapriotti
Copy link

This fixes a linker issue with libsnappy-1.1.9. Namely, RTTI has been disabled in 1.1.9 (see google/snappy@c98344f), but the haskell package is still compiling its C++ source file with RTTI enabled, which results in an unresolvable symbol (a typeinfo structure).

This PR migrates the cabal file to 2.2, and sets the cxx-sources and cxx-options field (just like #6) in order to disable RTTI.

More information

The libsnappy-1.1.9 shared object does not have any typeinfo symbols:

$ objdump -T /usr/lib/libsnappy.so | c++filt | grep typeinfo || echo "no matches"
no matches

Before this patch:

$ objdump -T dist-newstyle/build/x86_64-linux/ghc-8.10.4/snappy-0.2.0.2/build/libHSsnappy-0.2.0.2-inplace-ghc8.10.4.so | c++filt | grep typeinfo || echo "no matches"
0000000000000000      DO *UND*  0000000000000000              typeinfo for snappy::Source
0000000000008370  w   DO .rodata  000000000000000a  Base        typeinfo name for BSSource
0000000000009b90  w   DO .data.rel.ro 0000000000000018  Base        typeinfo for BSSource

After this patch:

$ objdump -T dist-newstyle/build/x86_64-linux/ghc-8.10.4/snappy-0.2.0.2/build/libHSsnappy-0.2.0.2-inplace-ghc8.10.4.so | c++filt | grep typeinfo || echo "no matches"
no matches

Also update to cabal 2.2, so that we can set the cxx-sources and cxx-options fields.
pcapriotti added a commit to wireapp/wire-server that referenced this pull request Sep 6, 2021
This selects a snappy branch containing a fix for a linker issue with
libsnappy-1.1.9. The fix is in this PR:
bos/snappy#7
pcapriotti added a commit to wireapp/wire-server that referenced this pull request Sep 6, 2021
This selects a snappy branch containing a fix for a linker issue with libsnappy-1.1.9. The fix is in this PR: bos/snappy#7
@wireapp wireapp closed this by deleting the head repository Apr 2, 2024
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.

2 participants