classification
Title: pkg-config file misses flags for static linking
Type: behavior Stage:
Components: Build Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, doko, pitrou
Priority: normal Keywords:

Created on 2018-05-07 10:55 by pitrou, last changed 2018-05-07 12:14 by pitrou.

Messages (4)
msg316258 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2018-05-07 10:55
Our pkg-config misses flags for static linking with libpythonXX.a, such as "-lpthread -lutil -lrt" on Windows.  For dynamic linking, this is not a problem since libpythonXX.so links explicitly against those system libraries.
msg316259 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2018-05-07 10:58
$ PKG_CONFIG_PATH=`pwd`/Misc pkg-config --static python
$ PKG_CONFIG_PATH=`pwd`/Misc pkg-config --libs python
-L/home/antoine/cpython/37/usr/lib -lpython3.7m
$ PKG_CONFIG_PATH=`pwd`/Misc pkg-config --libs-only-l python
-lpython3.7m
$ PKG_CONFIG_PATH=`pwd`/Misc pkg-config --libs-only-other python
$
msg316260 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2018-05-07 10:59
(correction: in the first message, I meant "on Linux" not "on Windows". Of course :-))
msg316263 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2018-05-07 12:14
Note that both implementations of python-config give the right information:

$ ./python python-config.py --libs
-lpython3.7m -lpthread -ldl -lutil -lm
$ sh python-config --libs
-lpython3.7m -lpthread -ldl  -lutil -lm
History
Date User Action Args
2018-05-07 12:14:11pitrousetmessages: + msg316263
2018-05-07 10:59:00pitrousetmessages: + msg316260
2018-05-07 10:58:33pitrousetmessages: + msg316259
2018-05-07 10:55:52pitroucreate