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.

Author millert
Recipients millert
Date 2021-05-19.23:12:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1621465930.28.0.548981352834.issue44182@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-05-19 23:12:10millertsetrecipients: + millert
2021-05-19 23:12:10millertsetmessageid: <1621465930.28.0.548981352834.issue44182@roundup.psfhosted.org>
2021-05-19 23:12:10millertlinkissue44182 messages
2021-05-19 23:12:10millertcreate