python - 剥离基于 python 的项目构建的共享库的最简单方法是什么?

标签 python distutils

使用 distutilssetuptools 编译 Python C-API 项目时,会生成未剥离的 .so 可执行文件,该可执行文件在尺寸。 有没有一种方法可以轻松地剥离它们,而无需在可执行文件上手动调用 strip -s ?例如, setup.py 中有此选项吗?

最佳答案

在构建步骤之前设置(并导出)环境变量LDFLAGS=-s,即

export LDFLAGS=-s

关于python - 剥离基于 python 的项目构建的共享库的最简单方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51934716/

相关文章:

python - 使用一些数据文件为 PIP 制作一个 python 包

python - 在 Windows (VC90) 中使用 C 绑定(bind)构建 Python 包导致 LNK1181 fatal error

python - python中类方法的自解封

python - 当将 matplotlib 与 ipython notebook plt.show() 函数一起使用时不起作用

python - 我如何从 Python C 代码断言?

python - 从 Scons 控制 distutils

python 的日期时间机制

python - 错误: 'NameError: name ' terms_and_conditions' is not defined' when it is

python - 如何禁用充当链接django的按钮

python - 哪个是最pythonic : installing python modules via a package manager ( macports, apt)或通过pip/easy_install/setuptools