lkml.org 
[lkml]   [2003]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Use -fno-unit-at-a-time if gcc supports it
From
Date
Linus Torvalds <torvalds@osdl.org> 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
- use -fno-unit-at-a-time.

Since unit-at-a-time has better inlining heuristics the better way is
to add the used attribute - but that takes some time. The short-term
solution would be to add the compiler flag,

Andreas
--
Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:48    [W:1.313 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site