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 2012年06月06日 12:51 by marcusva, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg162405 - (view) | Author: Marcus von Appen (marcusva) | Date: 2012年06月06日 12:51 | |
If CPython is built and installed with additional CPPFLAGS and/or LDFLAGS on a posix platform, those flags are not passed to C extension modules, leaving users (in the worst case) lost without the ability to build and install C extension modules, if the flags are important for detecting include files or linking. Example: * Python shall be built with GNU pthreads (--with-pth) * The pth libs are not installed in any default location, CPP and LD know about, but somewhere else (e.g. /usr/local/lib/pth/ and /usr/local/include/pth/) * Appropriate CPPFLAGS="-I/usr/local/include/pth" and LDFLAGS="-L/usr/local/lib/pth" are defined in the environment for the build. Python gets built and installed. Result in /wherever/pythonX.X/config/Makefile: ... OPT= BASECFLAGS= -fno-strict-aliasing CFLAGS= $(BASECFLAGS) -pipe $(OPT) $(EXTRA_CFLAGS) ... CPPFLAGS= -I. -IInclude -I$(srcdir)/Include -I/usr/local/include/pth LDFLAGS= -L/usr/local/lib/pth ... Invocation of python-config --cflags: # python-config --cflags -I/whereever/include/pythonX.X -I/whereever/include/pythonX.X -fno-strict-aliasing -pipe Invocation of python-config --ldflags: # python-config --ldflags -L/whereever/lib/pythonX.X/config -lpth -lutil -lm -lpythonX.X So far, so problematic. Since Python.h incorporates pth.h, compiling something without defining the necessary CPPFLAGS manually will fail. Same for linking. The issue is *not* limited to --with-pth, but to any CPPFLAGS/LDFLAGS settings that are necessary to get CPython to work on the target platform. One might argue that CPPFLAGS should go to CFLAGS, but that contradicts the purpose of CPPFLAGS and CFLAGS. At least for posix-alike platforms (those for which _init_posix() is called in distutils/sysconfig.py), it is necessary that both, python-config as well as the distutils internals add the appropriate CPPFLAGS. It might be argued that one should use CFLAGS instead of CPPFLAGS for such important additional flags, but what shall be done with LDFLAGS then? |
|||
| msg224660 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014年08月03日 20:50 | |
Who is best placed to comment on build issues? |
|||
| msg386294 - (view) | Author: Steve Dower (steve.dower) * (Python committer) | Date: 2021年02月03日 18:16 | |
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils. If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:31 | admin | set | github: 59223 |
| 2021年02月03日 18:16:16 | steve.dower | set | status: open -> closed nosy: + steve.dower messages: + msg386294 resolution: out of date stage: resolved |
| 2019年04月26日 20:25:13 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2014年08月04日 20:17:05 | rpetrov | set | nosy:
+ rpetrov |
| 2014年08月03日 20:50:00 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg224660 versions: + Python 3.4, Python 3.5, - Python 2.6, Python 3.1, Python 3.2 |
| 2013年09月02日 10:26:14 | koobs | set | nosy:
+ koobs |
| 2012年06月06日 16:00:23 | jcea | set | nosy:
+ jcea |
| 2012年06月06日 12:51:42 | marcusva | create | |