Message55053
It would be nice to automatically strip debugging symbols from compiled library files (such as .so files) if a C extension module is not build in debug mode. This could somehow reduce memory footprint and storage requirements for extension modules.
Distutils already does this for cygwin and emx compilers with the following code in cygwinccompiler.py and emxccompiler.py:
# who wants symbols and a many times larger output file
# should explicitly switch the debug mode on
# otherwise we let dllwrap/ld strip the output file
# (On my machine: 10KB < stripped_file < ??100KB
# unstripped_file = stripped_file + XXX KB
# ( XXX=254 for a typical python extension))
if not debug:
extra_preargs.append("-s")
This code should be somehow integrated into base compiler classes such as UnixCCompiler. I've added the following at the beginning of UnixCCompiler.link function:
if not debug:
if extra_preargs is None:
extra_preargs = []
extra_preargs.append("-s")
This works for me with gcc under Linux (Debian Sarge). I does not provide a patch, since this could be the best solution for this. |
|
Date |
User |
Action |
Args |
2007-08-23 16:12:40 | admin | link | issue1692592 messages |
2007-08-23 16:12:40 | admin | create | |
|