Issue 1692592: Stripping debugging symbols from compiled C extensions (original) (raw)

Just for the record: stripping symbols does not reduce memory footprint. It does (only) reduce storage requirements.

One problem with implementing the feature is to make it work portably on all systems. Adding -s to the linker command line is most likely not portable, i.e. some systems may not support that. Python currently ignores the concept of stripping entirely (not just for extension modules, but also for the interpreter itself, partially due to the problem that adding that further complicates portability.

On Linux, this problem is commonly solved by distributors performing the stripping as part of the packaging utilities. E.g. for Debian, just add dh_strip into the debian/rules file, and the packaging will strip all binaries according to the Debian policy.