This patch makes xen compiled with gcc option -funit-at-a-time if supported. This option is available for gcc 3.4 and upward, which reduces the .text binary size considerably. Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com> $ diffstat configmk.patch Config.mk | 6 ++++++ 1 files changed, 6 insertions(+) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt
2005-Jun-30 07:21 UTC
RE: [Xen-devel] [PATCH] compile with -funit-at-a-time option of gcc
> This patch makes xen compiled with gcc option > -funit-at-a-time if supported. This option is available for > gcc 3.4 and upward, which reduces the .text binary size considerably.I haven''t come across this option before. What does it actually do? Thanks, Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Jun-30 08:02 UTC
Re: [Xen-devel] [PATCH] compile with -funit-at-a-time option of gcc
On 30 Jun 2005, at 05:53, aq wrote:> This patch makes xen compiled with gcc option -funit-at-a-time if > supported. This option is available for gcc 3.4 and upward, which > reduces the .text binary size considerably.This option is the default for -O2 and above in gcc4 anyway. It might explain why I end up with a buggy Xen when I build with gcc4 (Linux has had a number of problems with -funit-at-a-time, because odf extra stack usage and code reordering). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Jun-30 08:04 UTC
Re: [Xen-devel] [PATCH] compile with -funit-at-a-time option of gcc
On 30 Jun 2005, at 08:21, Ian Pratt wrote:>> This patch makes xen compiled with gcc option >> -funit-at-a-time if supported. This option is available for >> gcc 3.4 and upward, which reduces the .text binary size considerably. > > I haven''t come across this option before. What does it actually do?Considers whole file at a time when doing optimisation. It''s the default on gcc4 with -O2 and above. We probably don;t want to enable it before a general move to gcc4 as it does break stuff (albeit stuff that was buggy/broken already ;-) ). Adding another skanky CFLAG that will be defaulted anyway in future, to get the benefit of maybe subtly breaking Xen, doesn;t sound like a big win to me. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Andi Kleen
2005-Jun-30 09:12 UTC
[Xen-devel] Re: [PATCH] compile with -funit-at-a-time option of gcc
Keir Fraser <Keir.Fraser@cl.cam.ac.uk> writes:> On 30 Jun 2005, at 08:21, Ian Pratt wrote: > > >> This patch makes xen compiled with gcc option > >> -funit-at-a-time if supported. This option is available for > >> gcc 3.4 and upward, which reduces the .text binary size considerably. > > > > I haven''t come across this option before. What does it actually do? > > Considers whole file at a time when doing optimisation. It''s theBasically it allows inlining even when a function is defined after the caller and makes the inliner more aggressive. Everything static with only one caller will be always inlined.> default on gcc4 with -O2 and above. We probably don;t want to enable > it before a general move to gcc4 as it does break stuff (albeit stuff > that was buggy/broken already ;-) ). Adding another skanky CFLAG that > will be defaulted anyway in future, to get the benefit of maybe subtly > breaking Xen, doesn;t sound like a big win to me.The main breakage that can usually happen with unit-at-a-time (short of broken inline asms) is that your stack frames grow too big because gcc before 4 is not very good at reusing the slots, but they add up with aggressive inlining. You can check for that with a simple objdump -S ... | grep sub.*[re]sp | sort ... and check for anything big enough that might overflow your kernel stack. The main kernel has a special check script for this too. -Andi _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel