Re: [PATCH] Use -fno-unit-at-a-time if gcc supports it

From: Jakub Jelinek
Date: Fri Sep 05 2003 - 12:21:18 EST


On Fri, Sep 05, 2003 at 05:17:00PM +0200, Andreas Jaeger wrote:
> Linus Torvalds <torvalds@xxxxxxxx> writes:
>
> > On Fri, 5 Sep 2003, Andi Kleen wrote:
> >>
> >> Unfortunately the kernel doesn't compile with unit-at-a-time currently,
> >> it cannot tolerate the reordering of functions in relation to inline
> >> assembly.
> >
> > What is the problem exactly? Is it the exception table getting unordered?
> > We _could_ just sort it at boot-time (or, even better, at build time after
> > the final link) instead...
>
> The problem is that unit-at-a-time sees all functions used and finds
> some static functions/variables that are not called anywhere and
> therefore drops them, making a smaller binary. Since GCC does not
> look into inline assembler, anything referenced from inline assembler
> only, will be treated as not used and therefore removed.
>
> You have to options:
> - use attribute ((used)) (implemented since GCC 3.2) to tell GCC that
> a function/variable should never be removed

To be precise, implemented since GCC 3.2 for functions and since GCC 3.3
for variables.

Jakub
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/