classification
Title: bad library order returned by python-config.in
Type: behavior Stage: patch review
Components: Build, Demos and Tools, Library (Lib) Versions: Python 3.5, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barry, dmalcolm, doko, logan, ned.deily, python-dev, taylor
Priority: normal Keywords: patch

Created on 2013-05-29 16:45 by taylor, last changed 2014-10-02 11:50 by doko. This issue is now closed.

Files
File name Uploaded Description Edit
xx taylor, 2013-05-29 16:45 Patch (unified diff format) of Misc/python-config.in against 3.3.1
fix-undef-ref.patch logan, 2014-10-01 19:21 Revised patch file for python-config. review
Messages (4)
msg190319 - (view) Author: David Taylor (taylor) Date: 2013-05-29 16:45
Misc/python-config.in returns a bad library order when given the --ldflags or --libs arguments.  A library should be listed *BEFORE* those libraries that it depends upon.  The python library depends upon all the other libraries listed, but it is listed last -- it should be first.

When linking with shared libraries, you can generally get away with the current behaviour.  When linking with static libraries, it fails
msg228107 - (view) Author: logan (logan) * Date: 2014-10-01 19:21
It seems that this is still reproducible with Python 3.5 (dev) by running:

$ gcc test.c `python3-config --includes --ldflags`

cpython-install/lib/python3.5/config-3.5m/libpython3.5m.a(pytime.o): In function `_PyTime_ObjectToTime_t':
cpython-build/../cpython/Python/pytime.c:371: undefined reference to `ceil'
cpython-build/../cpython/Python/pytime.c:373: undefined reference to `floor'
... skipped ...

I have slightly revised the patch to include Misc/python-config.sh.in as well.  Please have a look.  Thanks.
msg228141 - (view) Author: Roundup Robot (python-dev) Date: 2014-10-02 00:03
New changeset 6316475af62d by doko in branch '2.7':
- Issue #18096: Fix library order returned by python-config.
https://hg.python.org/cpython/rev/6316475af62d

New changeset b826ba76d1ce by doko in branch '3.4':
- Issue #18096: Fix library order returned by python-config.
https://hg.python.org/cpython/rev/b826ba76d1ce

New changeset 8db7fcf6c67d by doko in branch 'default':
- Issue #18096: Fix library order returned by python-config.
https://hg.python.org/cpython/rev/8db7fcf6c67d
msg228221 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2014-10-02 11:50
fixed in 2.7, 3.4 and 3.5
History
Date User Action Args
2014-10-02 11:50:01dokosetstatus: open -> closed
resolution: fixed
messages: + msg228221

versions: + Python 2.7, - Python 3.3
2014-10-02 00:03:15python-devsetnosy: + python-dev
messages: + msg228141
2014-10-01 19:21:43logansetfiles: + fix-undef-ref.patch
versions: + Python 3.5
nosy: + logan

messages: + msg228107

keywords: + patch
2013-10-14 19:06:00pitrousetnosy: + doko, dmalcolm
stage: patch review

components: + Build, Demos and Tools
versions: + Python 3.4
2013-10-14 14:26:09georg.brandlsetnosy: + barry, ned.deily
2013-05-29 16:45:24taylorcreate