This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [crosstool-ng] build failure with powerpc-unknown-linux-uclibc sample


Thomas, All,

On Tuesday 16 March 2010 14:36:06 Thomas Petazzoni wrote:
> Ok, so here is my understanding of the problem.
> On powerpc, libgcc uses the copysignl() function :
[--SNIP--]
> This libgcc_s.so library is linked with libc.so.0, but not with libm:
[--SNIP--]
> With glibc, this is not a problem since copysignl() is part of libc.
> But on uClibc, copysignl() is part of libm.

That's been my understanding as well.

> There are two fixes available :
> 
>  * Bernhard fix, which links libgcc with libm
>    http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00237.html
> 
>  * OpenWRT fix, which (from my understanding) adds copysignl() to the
>    main uClibc's libc
>    https://dev.openwrt.org/browser/trunk/toolchain/uClibc/patches-0.9.30.1/450-powerpc_copysignl.patch
> 
> However, none of them seems to be the good (tm) solution, since Joseph
> S. Myers (from CodeSourcery) says (at
> http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00291.html) :
> 
>    The bug here is that libgcc_s contains a reference to a libm function, not 
>    that it does not link to libm.  Linking libgcc against libm is a bad
>    idea and various code in libgcc specifically tries to avoid any
>    dependence on libm function.  You should fix the bug of the
>    reference to copysignl rather than making libgcc link with libm.

I've skimmed both the gcc trunk and 4.4 branch, and the only revision
that *seems* to make sense wrt the issue is rev. #143406
    svn log -r 143406 svn://gcc.gnu.org/svn/gcc
(unfortunately, retrieving history via the web page is horribly looooong,
so no pointer, sorry).

This is more than one year old, and appeared before the 4.4 branch was
created. So it seems there's no fix yet, and we'll have to work this
around with one of :

- build a static libgcc, as buildroot currently allows
- apply Bernhard's fix
- apply openWRT's fix

Anyhow, let's bug upstream to see if they have a (the?) solution.

> However, I have no idea where the reference to copysignl() is created
> in gcc code.

Neither do I :-( I guess we're still stuck to go with a workaround, as is
the not-so-uncommon case with gcc... :-(

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]