Skip to content
Advertisement

will cmake build type RelWithDebInfo strip symbol table?

I was building a shared library using cmake with RelWithDebInfo build type, the output .so file has no symbol table.

I inspect the output .so file with readelf -S myoutput.so | grep -i debug with gives me nothing.

If I change the build type to Debug, the symbol table is there.

I suppose RelWithDebInfo is equivalent to -O2 -g, which should be able to reserver debug symbol. There must be something wrong in my CMakeList.txt……but it’s a very large project I don’t have a clear where to look at, any idea or hint?

Advertisement

Answer

sorry, I’ve figured out the problem. I was using pybind11 for my project, and pybind11 internally strip unneeded symbols.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement