I understand that setup.py
uses the same CFLAGS
that were used to build Python. I have a single C extension of ours that is segfaulting. I need to build it without -O2
because -O2
is optimizing out some values and code so that the core files are not sufficient to pin down the problem.
I just need to modify setup.py
so that -O2
is not used.
I've read distutils
documentation, in particular distutils.ccompiler
and distutils.unixccompiler
and see how to add flags and libs and includes, but not how to modify the default GCC flags.
Specifically, this is for a legacy product on Python 2.5.1 with a bunch of backports (Fedora 8, yes, I know...). No, I cannot change the OS or Python version and I cannot, without great problems, recompile Python. I just need to build a one off of the C extension for one customer whose environment is the only one segfaulting.