<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Verdana",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:653097558;
mso-list-type:hybrid;
mso-list-template-ids:1040336144 -1592598140 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:"\(%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">There’s now (as of a couple days ago) a python mobile-sig (<a href="https://mail.python.org/mailman/listinfo/mobile-sig">https://mail.python.org/mailman/listinfo/mobile-sig</a>).
While that group is much smaller than python-dev and probably not as knowledgeable about the Cpython source base, that’s where you’re going to find folks who have a vested interest in getting Python working on mobile platforms like Android. (And who would
be interested in hearing about your experiences, no matter whether they can help you or not.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">What you are doing (trying to run the entire C compiler toolchain on an Android machine, instead of using the cross-compilers that come in Google’s Android NDK
(native development kit)) is way outside the mainstream. (I.e., you’re not going to find very many people trying to do this here or anywhere.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">Since you compiled all the libraries that you are linking against, there is some possibility (likelihood) that the problem is in one of those libraries, not anywhere
in the CPython source. (Some other library was compiled without the necessary –dl flag.) The right way to track down this problem (no matter where it is) is to run under gdb and type “where” when the program crashes.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">The reason I suspect that the problem is in one of the libraries you compiled before building Python, rather than a problem in the CPython sources or build scripts,
is that I don’t have this problem when I cross-compile Python 3.4.2 on a Linux machine, then take the result and copy it over to the Android machine. I’ve posted instructions and patches for successfully performing this cross compilation (for Android KitKat
running on an x86) here: <a href="https://github.com/wandering-logic/android_x86_python-3.4">
https://github.com/wandering-logic/android_x86_python-3.4</a>.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">-Matt<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Cyd Haselton [mailto:chaselton@gmail.com]
<br>
<b>Sent:</b> Monday, February 02, 2015 3:25 PM<br>
<b>To:</b> Ryan Gonzalez<br>
<b>Cc:</b> Python-Dev<br>
<b>Subject:</b> Re: [Python-Dev] Import Fails in setup.py On Android<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">No traceback unfortunately...the fakechroot in the environment throws the error and
<a href="http://setup.py">setup.py</a> fails.<br>
<br>
I'll roll back that change...any idea where I could find info about the original method?<o:p></o:p></p>
<div>
<p class="MsoNormal">On February 2, 2015 3:17:54 PM CST, Ryan Gonzalez <<a href="mailto:rymg19@gmail.com">rymg19@gmail.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal">In reality, things just got broken even more. I don't know when that patch was created, but it's now very out of date: importlib._bootstrap has no load function. That's what the error you're getting is telling you. Since it isn't getting
to load anything, the issue seems "solved". Not really.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">What's the full traceback for the undefined reference exception?<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Feb 2, 2015 at 2:04 PM, Cyd Haselton <<a href="mailto:chaselton@gmail.com" target="_blank">chaselton@gmail.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal">Update: While waiting for replies I made the change referenced here:
<a href="https://bugs.python.org/review/5309/diff2/12811:12826/setup.py?context=3&column_width=80" target="_blank">
https://bugs.python.org/review/5309/diff2/12811:12826/setup.py?context=3&column_width=80</a><br>
<br>
specifically changing <br>
importlib. _bootstrap._SpecMethods(spec).load()<br>
to<br>
importlib._bootstrap.load(spec)<br>
<br>
I no longer get a terminating 'undefined reference to dlopen' error, but I do get 'importing extensions failed' errors for each extension...like this:<br>
<br>
*** WARNING: importing extension "_pickle" failed with <class 'AttributeError'>: 'module' object has no attribute 'load'<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On February 2, 2015 1:36:29 PM CST, Cyd Haselton <<a href="mailto:chaselton@gmail.com" target="_blank">chaselton@gmail.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">After fixing a segfault issue (many thanks Ryan) I'm back to the same issue I was having with Python 2.7.8; the newly built python throws an undefined reference to dlopen when running
<a href="http://setup.py" target="_blank">setup.py</a>...specifically when importing just-built extensions<br>
<br>
I've managed to narrow the problem down to the following line:<br>
<br>
importlib._bootstrap._SpecMethods(spec).load()<br>
<br>
Googling this brings up a few hits from <a href="http://bugs.python.org" target="_blank">
bugs.python.org</a> and not much else. I'm new to Python; any ideas what this does...or where I can read up on it for troubleshooting purposes?<o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.<o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com" target="_blank">
https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">Ryan<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated."<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">Personal reality distortion fields are immune to contradictory evidence. - srean<o:p></o:p></p>
<div>
<p class="MsoNormal">Check out my website: <a href="http://kirbyfan64.github.io/" target="_blank">http://kirbyfan64.github.io/</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.<o:p></o:p></p>
</div>
</div>
</body>
</html>