<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Anders,<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 18 Nov 2020, at 10:13, Anders Montonen <<a href="mailto:Anders.Montonen@iki.fi" class="">Anders.Montonen@iki.fi</a>> wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class=""><br class=""></div></div>It seems you’re running into this issue: <a href="https://bugs.python.org/issue3588" class="">https://bugs.python.org/issue3588</a></div></div></blockquote><div><br class=""></div>Thanks for pointing me to this - it inspired the following command-line interaction</div><div><br class=""></div><div>```</div>:- which python<br class="">/Library/Frameworks/Python.framework/Versions/2.7/bin/python<br class=""><br class="">rqmts-spec-level<br class="">:- /Library/Frameworks/Python.framework/Versions/2.7/bin/python<br class="">Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 19 2020, 20:48:48) <br class="">[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin<br class="">Type "help", "copyright", "credits" or "license" for more information.<br class="">>>> import distutils.sysconfig<br class="">>>> print(distutils.sysconfig.get_config_var('LINKFORSHARED'))<br class="">-u _PyMac_Error Python.framework/Versions/2.7/Python<br class="">>>> print(distutils.sysconfig.get_config_var('PYTHONFRAMEWORKDIR'))<br class="">Python.framework<br class="">>>> print(distutils.sysconfig.get_config_var('PYTHONFRAMEWORKPREFIX'))<br class="">/Library/Frameworks<br class="">>>> quit()<br class=""><br class="">:- which python3<br class="">/Library/Frameworks/Python.framework/Versions/3.8/bin/python3<br class=""><br class="">rqmts-spec-level<br class="">:- /Library/Frameworks/Python.framework/Versions/3.8/bin/python3<br class="">Python 3.8.6 (v3.8.6:db455296be, Sep 23 2020, 13:31:39) <br class="">[Clang 6.0 (clang-600.0.57)] on darwin<br class="">Type "help", "copyright", "credits" or "license" for more information.<br class="">>>> import distutils.sysconfig<br class="">>>> print(distutils.sysconfig.get_config_var('PYTHONFRAMEWORKDIR'))<br class="">Python.framework<br class="">>>> print(distutils.sysconfig.get_config_var('LINKFORSHARED'))<br class="">-Wl,-stack_size,1000000 -framework CoreFoundation Python.framework/Versions/3.8/Python<br class="">>>> print(distutils.sysconfig.get_config_var('PYTHONFRAMEWORKPREFIX'))<br class="">/Library/Frameworks<br class="">>>> quit()<br class="">```<br class=""><div class=""><div><br class=""></div><div>The issue does seem that LINKFORSHARED is mis-configured for 2.7, but looks Ok for 3.8</div><div><br class=""></div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">GDB uses this script to duplicate the functionality of python-config: <a href="https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/python/python-config.py" class="">https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/python/python-config.py</a></div><div class="">It was patched upstream (in 2013!) to deal with this: <a href="https://hg.python.org/cpython/rev/bab708624dc4/" class="">https://hg.python.org/cpython/rev/bab708624dc4/</a> (current version: </div></div></div></blockquote><div><br class=""></div>This patch leads to the following:</div><div>```</div><div>:- /Library/Frameworks/Python.framework/Versions/2.7/bin/python<br class="">Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 19 2020, 20:48:48) <br class="">[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin<br class="">Type "help", "copyright", "credits" or "license" for more information.<br class="">>>> import distutils.sysconfig<br class="">>>> print(distutils.sysconfig.get_config_var('PYTHONFRAMEWORK'))<br class="">Python<br class="">>>> print(distutils.sysconfig.get_config_var('Py_ENABLE_SHARED'))<br class="">0<br class="">>>> print(distutils.sysconfig.get_config_var('LIBPL'))<br class="">/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config<br class=""></div><div>```</div><div><br class=""></div><div><br class=""></div><div>I got this all to work on this machine when it was OS X Mojave, and then broke it when some tool I installed with `brew`</div><div>decided it needed its own version of python2.7</div><div><br class=""></div><div>Upgrading to Catalina did not fix this, but I know that people have built RTEMS on Catalina.</div><div><br class=""></div><div>Perhaps I should try to re-install 2.7 from <a href="http://Python.org" class="">Python.org</a> ?</div><div><br class=""></div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><a href="https://hg.python.org/cpython/file/2.7/Misc/python-config.in" class="">https://hg.python.org/cpython/file/2.7/Misc/python-config.in</a>)</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Anders Montonen</div></div></div></blockquote></div><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">--------------------------------------------------------------------<br class="">Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204<br class="">Lero@TCD, Head of Software Foundations & Verification Research Group<br class="">School of Computer Science and Statistics,<br class="">Room G.39, O'Reilly Institute, Trinity College, University of Dublin<br class=""> <a href="http://www.scss.tcd.ie/Andrew.Butterfield/" class="">http://www.scss.tcd.ie/Andrew.Butterfield/</a><br class="">--------------------------------------------------------------------</div>
</div>
<br class=""></div></body></html>