mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willy TARREAU <willy@w.ods.org>
To: Matt Mackall <mpm@selenic.com>
Cc: Willy Tarreau <willy@w.ods.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [ANNOUNCE] 2.6.0-tiny1 tree for small systems
Date: Sat, 3 Jan 2004 17:50:51 +0100	[thread overview]
Message-ID: <20040103165051.GA2290@pcw.home.local> (raw)
In-Reply-To: <20040101014655.GD18208@waste.org>

Hi Matt,

On Wed, Dec 31, 2003 at 07:46:55PM -0600, Matt Mackall wrote:
> Ok, I added the ability to override the arch-default CFLAGS, but sadly
> I'm unable to reproduce your space savings here with gcc 3.3.2. The
> default -march=i586 seems to produce the smallest code for me.

Same results here. I was a bit stumped at first, but finally found the reason :
by changing CFLAGS, both you and me have implictly removed '-falign-functions=0',
which is what grows up the kernel image ! I really don't understand what happens
in the kernel, because on many other programs, i386 gives me smaller progs than
i586 for -Os optimization, and -falign-functions=0 is *always* smaller. In the
kernel, i386, i586 an c3 are identical, but -falign-functions=0 is bigger by
50 kB :

-Os -mpreferred-stack-boundary=2 -march=c3 -falign-functions=0 -falign-loops=0 -falign-jumps=0 :

   text    data     bss     dec     hex filename
1306682  111227   50896 1468805  166985 vmlinux


-Os -mpreferred-stack-boundary=2 -march=c3 -falign-loops=0 -falign-jumps=0 :

   text    data     bss     dec     hex filename
1256604  111227   50896 1418727  15a5e7 vmlinux

I have tested several values and found that the second compilation above is equivalent
to the default gcc setting of -falign-functions=1. And using 1 instead of 0 in
-falign-{loops,jumps,labels} makes not difference at all. So I would suggest
adding -falign-functions=1 everywhere.

BTW, I slightly changed your patch to be able to specify several options. I did
it the dirty way because I don't know how to split the string into several words :


--- ./arch/i386/Makefile	Sat Jan  3 15:10:26 2004
+++ a./rch/i386/Makefile	Sat Jan  3 15:43:12 2004
@@ -27,7 +27,7 @@
 align := $(subst -functions=0,,$(call check_gcc,-falign-functions=0,-malign-functions=0))
 
 ifdef CONFIG_TINY_CFLAGS
-cflags-y += $(CONFIG_TINY_CFLAGS_VAL)
+cflags-y += $(shell echo $(CONFIG_TINY_CFLAGS_VAL))
 else
 cflags-$(CONFIG_M386)		+= -march=i386
 cflags-$(CONFIG_M486)		+= -march=i486


Other than that, I've compiled 2.6.1-rc1-tiny1. It's slightly smaller than 2.6.0-tiny1
here. But I had to keep CONFIG_INETPEER=y, CONFIG_DNOTIFY=y, CONFIG_PTRACE=y,
and CONFIG_CPU_SUP_* otherwise it would not link. I can give you the error reports
and .config in case you're interested.

Cheers,
Willy


  reply	other threads:[~2004-01-03 16:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-27 21:56 Matt Mackall
2003-12-28 10:35 ` Willy Tarreau
2004-01-01  1:46   ` Matt Mackall
2004-01-03 16:50     ` Willy TARREAU [this message]
2004-01-03 19:11       ` Matt Mackall
2003-12-28 23:54 ` Mike Fedyk
2003-12-29  0:31   ` William Lee Irwin III

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=20040103165051.GA2290@pcw.home.local \
    --to=willy@w.ods.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    /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

Powered by JetHome