Message337468
When a C extension is built by distutils, distutils.sysconfig.customize_compiler() is used to configure compiler flags. Extract of the code:
(cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
...
if 'CFLAGS' in os.environ:
cflags = opt + ' ' + os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
if 'CPPFLAGS' in os.environ:
cpp = cpp + ' ' + os.environ['CPPFLAGS']
cflags = cflags + ' ' + os.environ['CPPFLAGS']
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
...
If the CFLAGS environment variable is set, the 'CFLAGS' configuration variable is overriden with the 'OPT' configuration variable: cflags = opt + ...
This bug has been fixed since 2013 in Fedora and RHEL by this patch:
https://src.fedoraproject.org/rpms/python2/blob/master/f/00168-distutils-cflags.patch
RHEL bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=849994
I converted that patch to a pull request. |
|
Date |
User |
Action |
Args |
2019-03-08 12:23:45 | vstinner | set | recipients:
+ vstinner |
2019-03-08 12:23:45 | vstinner | set | messageid: <1552047825.38.0.133209322208.issue36235@roundup.psfhosted.org> |
2019-03-08 12:23:45 | vstinner | link | issue36235 messages |
2019-03-08 12:23:45 | vstinner | create | |
|