This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Distutils drops -fno-strict-aliasing when CFLAGS are set
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: BASECFLAGS are not passed to module build line
View: 969718
Assigned To: tarek Nosy List: eric.araujo, skrah, tarek
Priority: high Keywords:

Created on 2011-01-06 21:21 by skrah, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg125591 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2011-01-06 21:21
When CFLAGS are set, distutils drops -fno-strict-aliasing (among other
flags):


$ python2.7 setup.py build
...
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./src -I/usr/local/include -I/usr/local/include/python2.7 -c src/gmpy.c -o build/temp.linux-x86_64-2.7/src/gmpy.o
...

$ CFLAGS="-fomit-frame-pointer" python2.7 setup.py build
...
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fomit-frame-pointer -fPIC -I./src -I/usr/local/include -I/usr/local/include/python2.7 -c src/gmpy.c -o build/temp.linux-x86_64-2.7/src/gmpy.o
src/gmpy.c: In function ‘_cmp_to_object’:
src/gmpy.c:4692: warning: dereferencing type-punned pointer will break strict-aliasing rules
...

I'm not sure if this is intentional. The documentation says:

"Compiler flags can also be supplied through setting the CFLAGS
environment variable. If set, the contents of CFLAGS will be added
to the compiler flags specified in the Setup file."

To me, this sounds as if they should be appended to the regular flags.
msg127849 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-04 01:12
Thanks for the report.  It came up on the debian-python ML recently too, and is actually already reported.  Following up on the other report.
History
Date User Action Args
2022-04-11 14:57:10adminsetgithub: 55056
2011-02-04 01:12:14eric.araujosetstatus: open -> closed
nosy: tarek, eric.araujo, skrah
messages: + msg127849

superseder: BASECFLAGS are not passed to module build line
resolution: duplicate
stage: resolved
2011-01-06 21:21:42skrahcreate