public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andi Kleen <ak@muc.de>, akpm@osdl.org, <rth@redhat.com>,
	<linux-kernel@vger.kernel.org>, <jh@suse.cz>
Subject: Re: [PATCH] Use -fno-unit-at-a-time if gcc supports it
Date: Fri, 05 Sep 2003 17:17:00 +0200	[thread overview]
Message-ID: <ho65k76z9v.fsf@byrd.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0309050735570.25313-100000@home.osdl.org> (Linus Torvalds's message of "Fri, 5 Sep 2003 07:54:30 -0700 (PDT)")

[-- Attachment #1: Type: text/plain, Size: 1347 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

  reply	other threads:[~2003-09-05 15:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-05  0:47 [PATCH] Use -fno-unit-at-a-time if gcc supports it Andi Kleen
2003-09-05  1:05 ` Aaron Lehmann
2003-09-05  1:24   ` Andi Kleen
2003-09-05  5:37 ` Jan Hubicka
2003-09-05 17:27   ` Andi Kleen
2003-09-05 17:59     ` Jeff Garzik
2003-09-06  7:08     ` Jan Hubicka
2003-09-05 14:54 ` Linus Torvalds
2003-09-05 15:17   ` Andreas Jaeger [this message]
2003-09-05 16:16     ` Robert Love
2003-09-05 16:10       ` Andreas Jaeger
2003-09-06  7:06       ` Jan Hubicka
2003-09-05 17:19     ` Jakub Jelinek
2003-09-05 17:30     ` Andi Kleen
2003-09-08  9:48     ` Helge Hafting
     [not found] <sqnW.3zE.13@gated-at.bofh.it>
     [not found] ` <sqHd.3Yj.1@gated-at.bofh.it>
     [not found]   ` <srtA.53H.1@gated-at.bofh.it>
     [not found]     ` <sFmW.78P.13@gated-at.bofh.it>
2003-09-06  8:10       ` David Mosberger-Tang
2003-09-08 20:32         ` David Mosberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ho65k76z9v.fsf@byrd.suse.de \
    --to=aj@suse.de \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=jh@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@redhat.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox