Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 30 Jul 2012 11:14:46 +1000
From: James Bond <jamesbond3142@...il.com>
To: musl@...ts.openwall.com
Subject: Re: bootstrap-linux patches for cross compilation to arm

On Sun, Jul 29, 2012 at 6:37 AM, Rich Felker <dalias@...ifal.cx> wrote:

> Are you sure this is how the workaround is working? Adding -lc is most
> likely to take place at the beginning, not the end. Default libs
> provided by the compiler come last.
>

If I put that the beginning it won't work. I'm not sure how it works (the
previous explanation is just my guess - I should have said so earlier) but
it does solve problem - by doing this the compilation works and thus
libiberty configure detects *printf and uses musl's version correctly.


> This is stupid; there's no reason for the division to raise signals or
> generate exceptions. Integer division by zero results in undefined
> behavior, so libgcc can just do nothing special when it happens. Or it
> could just execute an instruction that will raise a synchronous signal
> (like an illegal opcode) rather than making library calls.
>
> Floating point division by zero has well-defined results and raises a
> floating point exception on implementations that support floating
> point exceptions, but ARM EABI does not support them, and therefore
> there's nothing special to be done (and even if there were, it would
> not involve signals or C++ exceptions, just raising flags).
>
> It would be really nice to fix this issue at the gcc level since it's
> significantly bloating applications with code that do not, and should
> not, need.
>

Agreed.

A few people have been hit by this problem, I found at least two here:
- earlier problem (2009) with proposed hack
http://gcc.gnu.org/ml/gcc-help/2009-10/msg00332.html
- more recent problem (2012) with proposed patches
http://comments.gmane.org/gmane.comp.gcc.help/41025

The patch involves disabling exception in libgcc's libunwind. However I'm
not qualified to judge the correctness or suitability of these patches for
general purpose as they are targetting bare metal, while for our case we
are targetting musl.

BTW - Re-run bootstrap with the latest musl git master (as of yesterday)
and all seems to work fine.

cheers
James

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.