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.
Created on 2010年06月18日 20:12 by matteo.vescovi, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg108136 - (view) | Author: Matteo Vescovi (matteo.vescovi) | Date: 2010年06月18日 20:12 | |
Hi, It seems like distutils passes an invalid "-Wstrict-prototypes" flag when compiling a C++ extension module on Linux (tested on Debian lenny and sid). running build running build_py creating build creating build/lib.linux-i686-2.6 copying presage.py -> build/lib.linux-i686-2.6 running build_ext building '_presage' extension creating build/temp.linux-i686-2.6 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -O2 -g -Wall -O2 -fPIC -I../../src/lib -I/usr/include/python2.6 -c presage_wrap.cpp -o build/temp.linux-i686-2.6/presage_wrap.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/local/lib -Wl,--as-needed -g -O2 -g -Wall -O2 build/temp.linux-i686-2.6/presage_wrap.o -L../../src/lib/.libs -lpresage -o build/lib.linux-i686-2.6/_presage.so running build_scripts creating build/scripts-2.6 copying and adjusting presage_python_demo -> build/scripts-2.6 changing mode of build/scripts-2.6/presage_python_demo from 644 to 755 I did a bit of digging on this one. It looks like distutils reuses whatever flags python was built with. matt@burrow:/usr/lib/python2.5/distutils$ python2.5 Python 2.5.2 (r252:60911, Jan 24 2010, 14:53:14) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sysconfig >>> sysconfig.get_config_var("CFLAGS") '-fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes' >>> In /usr/lib/python2.5/distutils/unixcompiler.py I found this comment: # XXX Things not currently handled: # * optimization/debug/warning flags; we just use whatever's in Python's # Makefile and live with it. Is this adequate? If not, we might # have to have a bunch of subclasses GNUCCompiler, SGICCompiler, # SunCCompiler, and I suspect down that road lies madness. It would be nice is distutils was smart enough to recognize that a c++ module was being built and to strip the unneeded flags. Please consider this as a wishlist request, as this causes only a warning, not a failure. Cheers, - Matteo |
|||
| msg108183 - (view) | Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) | Date: 2010年06月19日 14:27 | |
It's a duplicate of issue #1222585. The patch in that issue will also make distutils not reuse flags Python was built with. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:02 | admin | set | github: 53277 |
| 2018年05月15日 21:30:37 | eitan.adler | set | nosy:
+ eitan.adler |
| 2010年09月07日 13:32:50 | eric.araujo | set | nosy:
+ eric.araujo superseder: C++ compilation support for distutils stage: resolved |
| 2010年08月07日 21:32:14 | terry.reedy | set | status: open -> closed resolution: duplicate versions: + Python 3.2, - Python 2.6 |
| 2010年06月19日 14:27:39 | Arfrever | set | nosy:
+ Arfrever messages: + msg108183 |
| 2010年06月18日 20:46:54 | tarek | set | priority: normal -> low versions: - Python 2.5 |
| 2010年06月18日 20:12:31 | matteo.vescovi | create | |