mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>,
	sam@ravnborg.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Make gcc -align options .config-settable
Date: Sun, 17 Oct 2004 02:38:08 +0200	[thread overview]
Message-ID: <20041017003808.GE15006@mars.ravnborg.org> (raw)
In-Reply-To: <20041001151751.3917d9d5.akpm@osdl.org>

On Fri, Oct 01, 2004 at 03:17:51PM -0700, Andrew Morton wrote:
> Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua> wrote:
> >
> > With all alignment options set to 1 (minimum alignment),
> > I've got 5% smaller vmlinux compared to one built with
> > default code alignment.
> > 
> 
> Sam, can you process this one?
> 
> > 
> >  
> > +GCC_VERSION	= $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
> 
> It bugs me that we're evaluating the same thing down in arch/i386/Makefile.
>  Perhaps we should evaluate GCC_VERSION once only, as some top-level kbuild
> thing.  So everyone can assume that it's present and correct?

Started looking into this.
gcc does not document what happens if -falign-functions=x is specified more than
once. It works but I have not checked the effect.
It will occur for some CPU's

	Sam

Current patch to top-level Makefile looks like this.

===== Makefile 1.542 vs edited =====
--- 1.542/Makefile	2004-10-17 02:00:48 +02:00
+++ edited/Makefile	2004-10-17 02:29:56 +02:00
@@ -295,6 +295,11 @@
 cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
                 > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
 
+# cc-option-align
+# Prefix align with either -falign or -malign
+cc-option-align = $(subst -functions=0,,\
+	$(call cc-option,-falign-functions=0,-malign-functions=0))
+
 # cc-version
 # Usage gcc-ver := $(call cc-version $(CC))
 cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
@@ -497,6 +502,13 @@
 else
 CFLAGS		+= -O2
 endif
+
+#Add aling options in CONFIG_CC_ not equal to 0
+add-align = $(if $(filter-out 0,$($(1))),$(cc-option-align)$(2)=$($(1)))
+CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_FUNCTIONS,-functions)
+CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_LABELS,-labels)
+CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_LOOPS,-loops)
+CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_JUMPS,-jumps)
 
 ifdef CONFIG_FRAME_POINTER
 CFLAGS		+= -fno-omit-frame-pointer

  parent reply	other threads:[~2004-10-16 22:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01 19:26 Denis Vlasenko
2004-10-01 22:17 ` Andrew Morton
2004-10-04 22:04   ` Sam Ravnborg
2004-10-08  5:03   ` Keith Owens
2004-10-17  0:38   ` Sam Ravnborg [this message]
2004-10-04 18:38 ` Bill Davidsen
     [not found] <2KBq9-2S1-15@gated-at.bofh.it>
2004-10-08 12:20 ` Andi Kleen
2004-10-08 17:10   ` Denis Vlasenko
2004-10-08 14:30     ` Grzegorz Kulewski
2004-10-08 20:42       ` Denis Vlasenko
2004-10-08 21:30         ` Grzegorz Kulewski
2004-10-08 15:42     ` Andi Kleen
2004-10-08 20:46       ` Denis Vlasenko

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=20041017003808.GE15006@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vda@port.imtp.ilyichevsk.odessa.ua \
    /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

all inboxes | Powered by JetHome®