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 sandipshah
Recipients ned.deily, ronaldoussoren, sandipshah
Date 2022-01-03.19:36:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1641238565.78.0.970913311215.issue46248@roundup.psfhosted.org>
In-reply-to
Content
macOS Monterey 12.1
Python 3.10.1

Trying to compile libplist, libimobiledevice, libimobiledevice_glue generates the error
"Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable."

The fix is change the following lines (570-571) in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/_sysconfigdata__darwin_darwin.py

from:
'LINKFORSHARED': '-Wl,-stack_size,1000000  -framework CoreFoundation '
                  'Python.framework/Versions/3.10/Python',
to:
'LINKFORSHARED': '-Wl,-stack_size,1000000  -framework CoreFoundation '
                  '/Library/Frameworks/Python.framework/Versions/3.10/Python',

Also, change the following line (110) in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/config-3.10-darwin

from:
LINKFORSHARED=  -Wl,-stack_size,1000000  -framework CoreFoundation $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
to:
LINKFORSHARED=  -Wl,-stack_size,1000000  -framework CoreFoundation $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)

It seems the problem got created from - https://bugs.python.org/issue15298 - and most likely it exists in all the versions of Python (it exists in the native Python 2.7.18 that comes with macOS too.

Thanks.
History
Date User Action Args
2022-01-03 19:36:05sandipshahsetrecipients: + sandipshah, ronaldoussoren, ned.deily
2022-01-03 19:36:05sandipshahsetmessageid: <1641238565.78.0.970913311215.issue46248@roundup.psfhosted.org>
2022-01-03 19:36:05sandipshahlinkissue46248 messages
2022-01-03 19:36:05sandipshahcreate