Build Question: How to Add -Wl, --option Before Objects In Setup.py?

Ned Deily nad at acm.org
Sat Nov 1 23:25:12 CET 2014


In article 
<CAHu5Praf_9rkGYw5yzP4Tqs3DZsx0qM70esUNukNoDCqzTmj2g at mail.gmail.com>,
 Cyd Haselton <chaselton at gmail.com> wrote:
> On Sat, Nov 1, 2014 at 1:47 PM, Cyd Haselton <chaselton at gmail.com> wrote:
[...]
> > Sure enough, nm -D libm.so shows that sincos is NOT available in that
> > library on my Android device. Now to figure out what to do about it.
[...]
> UPDATE:  After doing a bit of research it looks like it would be
> easier to build Python without sincos...is that possible?
> If not, I'll need to figure out how to get bionic libm sources with a
> proper Makefile (instead of Android's build system)

While sin() and/or cos() are primarily used in the expected places in 
the Python standard library (like the math module), sin() is also used 
in the implementation of type "complex" objects, code that is part of 
the core interpreter.  I see that there is an old, undocumented, and 
unsupported macro to disable building of complex number support.  But 
more hacking is needed to even get a somewhat working build with it 
these days and then, without complex support, many tests in the standard 
library fail and what you end up isn't really Python.  So, I think 
rather than hacking up Python, you should try to fix the broken 
platform.  There seem to be a number of project that claim to support 
Python on Android.  Perhaps they could be of help.

FWIW, the macro is "WITHOUT_COMPLEX":

./configure [...] CPPFLAGS='-DWITHOUT_COMPLEX'

and Lib/optparse.py would need to be patched to comment out its use of 
"complex".

Again, good luck!

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list