public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/29070] New: GDB fails to configure with Framework Python on macOS
@ 2022-04-17  6:17 spam_hole at shaw dot ca
  2022-04-18 13:36 ` [Bug python/29070] " tromey at sourceware dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: spam_hole at shaw dot ca @ 2022-04-17  6:17 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29070

            Bug ID: 29070
           Summary: GDB fails to configure with Framework Python on macOS
           Product: gdb
           Version: 11.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: spam_hole at shaw dot ca
  Target Milestone: ---

Created attachment 14067
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14067&action=edit
Patch which fixes framework builds on macOS

Configuring GDB with a framework build of Python on macOS (e.g. any of the
official Python.org installers) fails to use Python. For example, configuring
with
"--with-python=/Library/Frameworks/Python.framework/Versions/3.8/bin/python3"
fails due to the following error in config.log:

configure:11020: checking whether to use python
configure:11022: result:
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3
configure:11220: checking for python
configure:11238: gcc -o conftest -g -O2
-I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8
-I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 
conftest.c
-L/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/config-3.8-darwin
-lpython3.8 -ldl -framework CoreFoundation -Wl,-stack_size,1000000 -framework
CoreFoundation Python.framework/Versions/3.8/Python -lncurses -lm  >&5
clang: error: no such file or directory: 'Python.framework/Versions/3.8/Python'
configure:11238: $? = 1
configure: failed program was:
...
configure:11248: result: no
configure:11338: error: no usable python found at
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3

This occurs with the default Python too, but the error is ignored:

configure:11020: checking whether to use python
configure:11022: result: auto
configure:11071: checking for python
configure:11102: result:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
configure:11220: checking for python
configure:11238: gcc -o conftest -g -O2
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
conftest.c
-L/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
-lpython2.7 -ldl -framework CoreFoundation -u _PyMac_Error
Python.framework/Versions/2.7/Python -lncurses -lm  >&5
clang: error: no such file or directory: 'Python.framework/Versions/2.7/Python'
configure:11238: $? = 1
configure: failed program was:
...
configure:11248: result: no
configure:11334: WARNING: python is missing or unusable; some features may be
unavailable.

This is related to bug #19378
(https://sourceware.org/bugzilla/show_bug.cgi?id=19378) but is not a duplicate.
The attached patch fixes this issue. It is adapted from the patch for Python
issue #16848 (https://bugs.python.org/issue16848):
https://hg.python.org/cpython/rev/bab708624dc4/. All it does is ignore
LINKFORSHARED if PYTHONFRAMEWORK is set, which will be the case on macOS,
following the same logic that is in newer python-config.py scripts (dating back
to recent 2.7 releases). With this patch, pointing --with-python at a framework
build of Python works fine.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-28 13:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-17  6:17 [Bug python/29070] New: GDB fails to configure with Framework Python on macOS spam_hole at shaw dot ca
2022-04-18 13:36 ` [Bug python/29070] " tromey at sourceware dot org
2022-06-07 15:33 ` [Bug build/29070] " tromey at sourceware dot org
2023-03-26  1:55 ` chrisj at rtems dot org
2023-03-26  3:29 ` chrisj at rtems dot org
2023-08-28 13:52 ` tromey at sourceware dot org
2023-08-28 13:53 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).