[New-bugs-announce] [issue44182] python-config.sh vs python-config.py inconsistency

Todd C. Miller report at bugs.python.org
Wed May 19 19:12:10 EDT 2021


New submission from Todd C. Miller <todd.miller at sudo.ws>:

There is an inconsistency between python-config.py and python-config.sh with the output of --ldflags.  The .sh version include -L$libdir but the .py version does not include the -L flag unless a non-shared version of Python is built.

As a result, on Darwin (macOS), where python-config.py is used it is not possible to use python-config to get the correct linker flags when "python-config --embed --ldflags" is run if Python is installed in a directory with a lib dir that is not in the compiler's default search path.

For example, if Python is installed in /usr/local/python, we see the following on Linux (using python-config.sh):

$ python3-config --ldflags --embed
 -L/usr/local/python/lib -lpython3.10 -lcrypt -lpthread -ldl  -lutil -lm -lm

But on macOS, using python-config.py:

$ python3-config --ldflags --embed
-lpython3.10 -lintl -ldl -framework CoreFoundation

There is no -L flag to tell the compiler where to find the python3.10 library, so an attempt to link with it will fail.

----------
components: Installation
messages: 393985
nosy: millert
priority: normal
severity: normal
status: open
title: python-config.sh vs python-config.py inconsistency
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44182>
_______________________________________


More information about the New-bugs-announce mailing list