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: Linker failure when creating main binary with python-config --libs
Type: compile error Stage: resolved
Components: Interpreter Core Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, vstinner
Priority: high Keywords:

Created on 2019-06-06 19:55 by christian.heimes, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg344864 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-06-06 19:55
With 3.8 it is no longer possible to compile a custom Python interpreter with linker flags from python-config. The config helper omits the main Python library:

$ python3.8-config --ldflags
 -L/usr/lib64  -lcrypt -lpthread -ldl  -lutil -lm -lm

$ gcc  -L/usr/lib64  -lcrypt -lpthread -ldl  -lutil -lm -lm -o custompython custompython.o
/usr/bin/ld: custompython.o: in function `main':
custompython.c:10: undefined reference to `Py_BytesMain'
collect2: error: ld returned 1 exit status
msg344866 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-06-06 19:59
python-3.8.pc also omits -lpython3.8:

$ pkg-config python-3.8 --libs
msg344869 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-06-06 20:21
memo to me: read the **whole** what's new document.

https://docs.python.org/3.8/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build
msg344872 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-06-06 20:32
It is a deliberate change but matbe it is not well documented? Should we
update the C API doc?
History
Date User Action Args
2022-04-11 14:59:16adminsetgithub: 81364
2019-06-06 20:32:08vstinnersetmessages: + msg344872
2019-06-06 20:21:00christian.heimessetstatus: open -> closed
resolution: not a bug
messages: + msg344869

stage: needs patch -> resolved
2019-06-06 19:59:47christian.heimessetmessages: + msg344866
2019-06-06 19:55:36christian.heimescreate