-
Notifications
You must be signed in to change notification settings - Fork 7.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to enable RTTI without modify leveldb/CMakeList.txt #731
Comments
Does your other third party library need to dynamically determine the type of the leveldb objects in include/leveldb, or for other objects? If not the you should be OK to leave RTTI disabled for leveldb, but enable it for other code. However, if you really do need RTTI enabled for leveldb then I think you will need to modify CMakeLists.txt as it is hard-coded to be disabled. I'm not a CMake expert, so there may be some environment variable that can modify CMAKE_CXX_FLAGS. |
It seems leveldb::Comparator does not work when RTTI disabled for leveldb and mycode is rtti enabled: https://stackoverflow.com/questions/57670944/undefined-symbols-for-architecture-x86-64-typeinfo-for-leveldbcomparator, is there any way to fix this issue while leaving my code rtti enabled? |
Separating the comparator into its own cpp file and compiling with the -fno-rtti flag worked best for me. |
@luguoxiang
My only way is to enable rtti for leveldb. What did you do in the end? |
I went back to use leveled 1.22 which seems enabled rtti by default. |
The addition of -fno-rtti between 1.22 and 1.23 is an ABI change and should include an soname bump as well. As susnux mentions above, this breaks the Ceph build, in my case in Fedora F35/rawhide. see #927 |
this also prevents leveldb 1.23 to be used in python via plyvel, see e.g. wbolster/plyvel#114 |
needed for ceph and plyvel and possibly other consumers Arch Linux also enables it google/leveldb#731 Reported-by: Louis Sautier <sbraz@gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
I use cmake to build leveldb with my project,
It seems leveldb disable RTTI (-f no-rtti) by default, there is some other third party library in my project which requires RTTI, is there any way to enable RTTI without modify leveldb/CMakeList.txt?
The text was updated successfully, but these errors were encountered: