gcc 4.1.2 miscompiles uClibc 0.9.32

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Thu Sep 15 16:59:41 UTC 2011


On Sep 15, 2011 6:17 PM, "Denys Vlasenko" <vda.linux at googlemail.com> wrote:
>
> On Thu, Sep 15, 2011 at 5:06 PM, Rich Felker <dalias at aerifal.cx> wrote:
> > On Thu, Sep 15, 2011 at 05:01:16PM +0200, Denys Vlasenko wrote:
> >> > which results in a "call 0" and a segfault at exit
> >> > if you do not happen to link in stdio.
> >> >
> >> > Presumably gcc believes _stdio_term to be a non-zero constant.
> >>
> >> Yes, it does. Apparently C standard says function address is never
NULL.
> >>
> >> > Setting -O0 produces a sane exit.os and a usable library.
> >>
> >> I committed a fix which uses:
> >> [...]
> >
> > Have you read my reply? I believe it's a better approach to handling
> > this kind of issue, but I'm not sure if you'd agree.
>
> Both approaches look good to me.
> I just reused the trick we already were using in other parts of uclibc
code.

IIRC this will be fixed in gcc-4.7


More information about the uClibc mailing list