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

Ned Deily nad at acm.org
Sun Nov 2 16:38:22 EST 2014


In article 
<CAHu5PrYQ3xEgtd-7aHzMDBWk32NPRfxZ24DFdM1oJ-wnmyj8jQ at mail.gmail.com>,
 Cyd Haselton <chaselton at gmail.com> wrote:
> Just checking: is sincos() the same as sin() and cos()? Nm output for
> my toolchain's libm does show sin() and cos() just not sincos()

See, this is what you get when you ask for free help: bad info.  sincos 
isn't the same, as a little of googling informs me.  But, as the thread 
starting here indicates: 

https://sourceware.org/ml/binutils/2010-04/msg00219.html

gcc can do an optimization that turns a pair of sin() and cos() calls 
with the same arguments into a single call to sincos().  And there is 
such a pair in Python's complexobject.c.  As the thread explains, there 
are some platforms where sin() and cos() are implemented but not 
sincos().  As suggested in the thread, one approach is to give options 
to gcc to avoid the optimizations:

    CFLAGS='-fno-builtin-sin -fno-builtin-cos'

That does seem to result in a libpython with no references to sincos.

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list