Reputation: 1662
When compiling a Python C-API project using distutils
or setuptools
, it results in unstripped .so
executables, which are considerably larger in size.
Is there a way to easily strip them without calling strip -s
manually on the executable? For example,
is there an option for this in setup.py
?
Upvotes: 2
Views: 212
Reputation: 6769
As @phd mentioned, you can skip the manual stripping step by specifying the LDFLAGS=-s
environment variable. If you want to automatically do this from setup.py
, simply add the following at the start:
import os
os.environ["LDFLAGS"] = "-s"
Upvotes: 0
Reputation: 94726
Set (and export) environment variable LDFLAGS=-s
before build steps, i.e.
export LDFLAGS=-s
Upvotes: 5