All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements
@ 2009-09-14 20:18 Andi Kleen
  2009-09-14 20:18 ` [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work Andi Kleen
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Andi Kleen @ 2009-09-14 20:18 UTC (permalink / raw)
  To: linux-kernel, akpm, sam


I sent those some time ago, but nobody seems to have merged them. Sam?
They are all 2.6.32 canidated.

Some build system patches that accumulated in my tree:

- Fix mcount handling
- Fix gold linker support
- Add some gcc 4.5 support

One will address the problem Dave A. reported some time ago.

-Andi

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work
  2009-09-14 20:18 [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Andi Kleen
@ 2009-09-14 20:18 ` Andi Kleen
  2009-09-14 21:47   ` Sam Ravnborg
  2009-09-14 20:18 ` [PATCH] [2/5] kbuild: Check if linker supports the -X option Andi Kleen
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Andi Kleen @ 2009-09-14 20:18 UTC (permalink / raw)
  To: linux-kernel, akpm, sam


Needed for the next patch

Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 scripts/Kbuild.include |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6.31-rc1-ak/scripts/Kbuild.include
===================================================================
--- linux-2.6.31-rc1-ak.orig/scripts/Kbuild.include
+++ linux-2.6.31-rc1-ak/scripts/Kbuild.include
@@ -83,11 +83,12 @@ TMPOUT := $(if $(KBUILD_EXTMOD),$(firstw
 # is automatically cleaned up.
 try-run = $(shell set -e;		\
 	TMP="$(TMPOUT).$$$$.tmp";	\
+	TMPO="$(TMPOUT).$$$$.o";	\
 	if ($(1)) >/dev/null 2>&1;	\
 	then echo "$(2)";		\
 	else echo "$(3)";		\
 	fi;				\
-	rm -f "$$TMP")
+	rm -f "$$TMP" "$$TMPO")
 
 # as-option
 # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
@@ -133,7 +134,7 @@ cc-ifversion = $(shell [ $(call cc-versi
 # ld-option
 # Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both)
 ld-option = $(call try-run,\
-	$(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2))
+	$(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))
 
 ######
 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] [2/5] kbuild: Check if linker supports the -X option
  2009-09-14 20:18 [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Andi Kleen
  2009-09-14 20:18 ` [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work Andi Kleen
@ 2009-09-14 20:18 ` Andi Kleen
  2009-09-14 20:18 ` [PATCH] [3/5] kbuild: Echo the record_mcount command Andi Kleen
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Andi Kleen @ 2009-09-14 20:18 UTC (permalink / raw)
  To: linux-kernel, akpm, sam


The new alternative `gold' linker in recent binutils doesn't support
the -X option. This breaks allyesconfig builds that have 
CONFIG_STRIP_ASM_SYMS enabled. Check if the linker really supports
the option using ld-option.

This requires fixes in earlier patches.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.31-rc1-ak/Makefile
===================================================================
--- linux-2.6.31-rc1-ak.orig/Makefile
+++ linux-2.6.31-rc1-ak/Makefile
@@ -599,7 +599,7 @@ LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
 LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
 
 ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
-LDFLAGS_vmlinux	+= -X
+LDFLAGS_vmlinux	+= $(call ld-option, -X,)
 endif
 
 # Default kernel image to build when no specific target is given.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] [3/5] kbuild: Echo the record_mcount command
  2009-09-14 20:18 [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Andi Kleen
  2009-09-14 20:18 ` [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work Andi Kleen
  2009-09-14 20:18 ` [PATCH] [2/5] kbuild: Check if linker supports the -X option Andi Kleen
@ 2009-09-14 20:18 ` Andi Kleen
  2009-09-14 20:18 ` [PATCH] [4/5] kbuild: Fail build if recordmcount.pl fails Andi Kleen
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Andi Kleen @ 2009-09-14 20:18 UTC (permalink / raw)
  To: linux-kernel, akpm, sam


I had some problems with record_mcount in the Makefile and it was hard
to track down. Echo it by default to make it easier to diagnose.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 scripts/Makefile.build |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.31-rc1-ak/scripts/Makefile.build
===================================================================
--- linux-2.6.31-rc1-ak.orig/scripts/Makefile.build
+++ linux-2.6.31-rc1-ak/scripts/Makefile.build
@@ -216,6 +216,7 @@ define rule_cc_o_c
 	$(call echo-cmd,checksrc) $(cmd_checksrc)			  \
 	$(call echo-cmd,cc_o_c) $(cmd_cc_o_c);				  \
 	$(cmd_modversions)						  \
+	$(call echo-cmd,record_mcount)					  \
 	$(cmd_record_mcount)						  \
 	scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' >    \
 	                                              $(dot-target).tmp;  \

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] [4/5] kbuild: Fail build if recordmcount.pl fails
  2009-09-14 20:18 [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Andi Kleen
                   ` (2 preceding siblings ...)
  2009-09-14 20:18 ` [PATCH] [3/5] kbuild: Echo the record_mcount command Andi Kleen
@ 2009-09-14 20:18 ` Andi Kleen
  2009-09-14 20:18 ` [PATCH] [5/5] kbuild: Set -fconserve-stack option for gcc 4.5 Andi Kleen
  2009-09-14 21:43 ` [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Sam Ravnborg
  5 siblings, 0 replies; 15+ messages in thread
From: Andi Kleen @ 2009-09-14 20:18 UTC (permalink / raw)
  To: linux-kernel, akpm, sam


When this script fails the build should fail too. Otherwise there
are mysterious build failures later.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 scripts/Makefile.build |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.31-rc1-ak/scripts/Makefile.build
===================================================================
--- linux-2.6.31-rc1-ak.orig/scripts/Makefile.build
+++ linux-2.6.31-rc1-ak/scripts/Makefile.build
@@ -206,7 +206,7 @@ cmd_modversions =							\
 endif
 
 ifdef CONFIG_FTRACE_MCOUNT_RECORD
-cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
+cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
 	"$(if $(CONFIG_64BIT),64,32)" \
 	"$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" \
 	"$(if $(part-of-module),1,0)" "$(@)";

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] [5/5] kbuild: Set -fconserve-stack option for gcc 4.5
  2009-09-14 20:18 [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Andi Kleen
                   ` (3 preceding siblings ...)
  2009-09-14 20:18 ` [PATCH] [4/5] kbuild: Fail build if recordmcount.pl fails Andi Kleen
@ 2009-09-14 20:18 ` Andi Kleen
  2009-09-14 21:36   ` Andrew Morton
  2009-09-14 21:43 ` [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Sam Ravnborg
  5 siblings, 1 reply; 15+ messages in thread
From: Andi Kleen @ 2009-09-14 20:18 UTC (permalink / raw)
  To: linux-kernel, akpm, sam


The upcomming gcc 4.5 has a new -fconserve-stack option 
that tells the inliner to take stack frame size in account.
Set it if the compiler supports it.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 Makefile |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6.31-rc3-ak/Makefile
===================================================================
--- linux-2.6.31-rc3-ak.orig/Makefile
+++ linux-2.6.31-rc3-ak/Makefile
@@ -575,6 +575,9 @@ KBUILD_CFLAGS	+= $(call cc-option,-fno-s
 # revert to pre-gcc-4.4 behaviour of .eh_frame
 KBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
 
+# conserve stack if available
+KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
+
 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
 # But warn user when we do so
 warn-assign = \

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] [5/5] kbuild: Set -fconserve-stack option for gcc 4.5
  2009-09-14 20:18 ` [PATCH] [5/5] kbuild: Set -fconserve-stack option for gcc 4.5 Andi Kleen
@ 2009-09-14 21:36   ` Andrew Morton
  2009-09-19  9:20     ` Sam Ravnborg
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Morton @ 2009-09-14 21:36 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, sam

On Mon, 14 Sep 2009 22:18:11 +0200 (CEST)
Andi Kleen <andi@firstfloor.org> wrote:

> 
> The upcomming gcc 4.5 has a new -fconserve-stack option 
> that tells the inliner to take stack frame size in account.
> Set it if the compiler supports it.
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> 
> ---
>  Makefile |    3 +++
>  1 file changed, 3 insertions(+)
> 
> Index: linux-2.6.31-rc3-ak/Makefile
> ===================================================================
> --- linux-2.6.31-rc3-ak.orig/Makefile
> +++ linux-2.6.31-rc3-ak/Makefile
> @@ -575,6 +575,9 @@ KBUILD_CFLAGS	+= $(call cc-option,-fno-s
>  # revert to pre-gcc-4.4 behaviour of .eh_frame
>  KBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
>  
> +# conserve stack if available
> +KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)

Do we have any info about what effects this option has upon the
generated code?  Text size changes, runtime stack usage changes, etc?


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements
  2009-09-14 20:18 [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Andi Kleen
                   ` (4 preceding siblings ...)
  2009-09-14 20:18 ` [PATCH] [5/5] kbuild: Set -fconserve-stack option for gcc 4.5 Andi Kleen
@ 2009-09-14 21:43 ` Sam Ravnborg
  2009-09-14 21:47   ` Andrew Morton
  5 siblings, 1 reply; 15+ messages in thread
From: Sam Ravnborg @ 2009-09-14 21:43 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, akpm

On Mon, Sep 14, 2009 at 10:18:05PM +0200, Andi Kleen wrote:
> 
> I sent those some time ago, but nobody seems to have merged them. Sam?

Then I should have them queued somewhere...
Last months has been busy (again) so not much time for Linux stuff.
Will find time to prepare some of my pending stuff for merge -
hopefully before the weekend.

Thanks for the resend - let's see if andrew or I merge them first.


	Sam

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work
  2009-09-14 20:18 ` [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work Andi Kleen
@ 2009-09-14 21:47   ` Sam Ravnborg
  2009-09-15 13:01     ` Andi Kleen
  0 siblings, 1 reply; 15+ messages in thread
From: Sam Ravnborg @ 2009-09-14 21:47 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, akpm

On Mon, Sep 14, 2009 at 10:18:06PM +0200, Andi Kleen wrote:
> 
> Needed for the next patch
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> 
> ---
>  scripts/Kbuild.include |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6.31-rc1-ak/scripts/Kbuild.include
> ===================================================================
> --- linux-2.6.31-rc1-ak.orig/scripts/Kbuild.include
> +++ linux-2.6.31-rc1-ak/scripts/Kbuild.include
> @@ -83,11 +83,12 @@ TMPOUT := $(if $(KBUILD_EXTMOD),$(firstw
>  # is automatically cleaned up.
>  try-run = $(shell set -e;		\
>  	TMP="$(TMPOUT).$$$$.tmp";	\
> +	TMPO="$(TMPOUT).$$$$.o";	\
>  	if ($(1)) >/dev/null 2>&1;	\
>  	then echo "$(2)";		\
>  	else echo "$(3)";		\
>  	fi;				\
> -	rm -f "$$TMP")
> +	rm -f "$$TMP" "$$TMPO")
>  
>  # as-option
>  # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
> @@ -133,7 +134,7 @@ cc-ifversion = $(shell [ $(call cc-versi
>  # ld-option
>  # Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both)
>  ld-option = $(call try-run,\
> -	$(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2))
> +	$(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))
>  
>  ######

So now we pass the option direct to the linker rather than via gcc -wl.
I assume this breaks the other 8 uses of ld-option in the kernel?

Or does ld understand the -wl,... syntax?

	Sam

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements
  2009-09-14 21:43 ` [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Sam Ravnborg
@ 2009-09-14 21:47   ` Andrew Morton
  0 siblings, 0 replies; 15+ messages in thread
From: Andrew Morton @ 2009-09-14 21:47 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: andi, linux-kernel

On Mon, 14 Sep 2009 23:43:47 +0200
Sam Ravnborg <sam@ravnborg.org> wrote:

> On Mon, Sep 14, 2009 at 10:18:05PM +0200, Andi Kleen wrote:
> > 
> > I sent those some time ago, but nobody seems to have merged them. Sam?
> 
> Then I should have them queued somewhere...
> Last months has been busy (again) so not much time for Linux stuff.
> Will find time to prepare some of my pending stuff for merge -
> hopefully before the weekend.
> 
> Thanks for the resend - let's see if andrew or I merge them first.
> 

Well, I'd prefer not to merge kbuild stuff as long as you're showing
signs of life.

I'll now hose these:

gitignore-usr-initramfs_datacpiobz2-and-usr-initramfs_datacpiolzma.patch
kernel-hacking-move-strip_asm_syms-from-general.patch
kbuild-add-static-to-prototypes.patch
ctags-usability-fix.patch
checkincludespl-close-file-as-soon-as-were-done-with-it.patch
checkincludespl-provide-usage-helper.patch
checkincludespl-add-option-to-remove-duplicates-in-place.patch
markup_oops-use-modinfo-to-avoid-confusion-with-underscored-module-names.patch
kbuild-generate-modulesbuiltin.patch
kbuild-rebuild-fix-for-makefilemodbuiltin.patch
kconfig-cross_compile-option.patch
kbuild-fix-cc1-options-check-to-ensure-we-do-not-use-fpic-when-compiling.patch
gconfig-disable-typeahead-find-search-in-treeviews.patch
kbuild-fix-ld-option-makefile-macro-to-really-work.patch
kbuild-check-if-linker-supports-the-x-option.patch
kbuild-echo-the-record_mcount-command.patch
kbuild-fail-build-if-recordmcountpl-fails.patch
kbuild-set-fconserve-stack-option-for-gcc-45.patch

at you :)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work
  2009-09-14 21:47   ` Sam Ravnborg
@ 2009-09-15 13:01     ` Andi Kleen
  2009-09-15 15:32       ` Sam Ravnborg
  0 siblings, 1 reply; 15+ messages in thread
From: Andi Kleen @ 2009-09-15 13:01 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Andi Kleen, linux-kernel, akpm

> So now we pass the option direct to the linker rather than via gcc -wl.
> I assume this breaks the other 8 uses of ld-option in the kernel?
> 
> Or does ld understand the -wl,... syntax?

It does not. But -X is passed directly to the linker, not via gcc,
so it needs to probe ld directly

The right fix is probably an new macro that works with ld (and
ideally rename this one which is confusingly named) I'll
send an updated patch.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work
  2009-09-15 13:01     ` Andi Kleen
@ 2009-09-15 15:32       ` Sam Ravnborg
  0 siblings, 0 replies; 15+ messages in thread
From: Sam Ravnborg @ 2009-09-15 15:32 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, akpm

On Tue, Sep 15, 2009 at 03:01:47PM +0200, Andi Kleen wrote:
> > So now we pass the option direct to the linker rather than via gcc -wl.
> > I assume this breaks the other 8 uses of ld-option in the kernel?
> > 
> > Or does ld understand the -wl,... syntax?
> 
> It does not. But -X is passed directly to the linker, not via gcc,
> so it needs to probe ld directly
> 
> The right fix is probably an new macro that works with ld (and
> ideally rename this one which is confusingly named) I'll
> send an updated patch.
Thanks.
Please do remember to update the documentation
in Documentation/kbuild/makefiles.txt.

	Sam

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] [5/5] kbuild: Set -fconserve-stack option for gcc 4.5
  2009-09-14 21:36   ` Andrew Morton
@ 2009-09-19  9:20     ` Sam Ravnborg
  2009-09-20 12:04       ` Andi Kleen
  0 siblings, 1 reply; 15+ messages in thread
From: Sam Ravnborg @ 2009-09-19  9:20 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andi Kleen, linux-kernel

On Mon, Sep 14, 2009 at 02:36:15PM -0700, Andrew Morton wrote:
> On Mon, 14 Sep 2009 22:18:11 +0200 (CEST)
> Andi Kleen <andi@firstfloor.org> wrote:
> 
> > 
> > The upcomming gcc 4.5 has a new -fconserve-stack option 
> > that tells the inliner to take stack frame size in account.
> > Set it if the compiler supports it.
> > 
> > Signed-off-by: Andi Kleen <ak@linux.intel.com>
> > 
> > ---
> >  Makefile |    3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > Index: linux-2.6.31-rc3-ak/Makefile
> > ===================================================================
> > --- linux-2.6.31-rc3-ak.orig/Makefile
> > +++ linux-2.6.31-rc3-ak/Makefile
> > @@ -575,6 +575,9 @@ KBUILD_CFLAGS	+= $(call cc-option,-fno-s
> >  # revert to pre-gcc-4.4 behaviour of .eh_frame
> >  KBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
> >  
> > +# conserve stack if available
> > +KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
> 
> Do we have any info about what effects this option has upon the
> generated code?  Text size changes, runtime stack usage changes, etc?

I merged this despite the relevant questions above was not answered.
But maybe we should wait until Andi gets back with numbers?

	Sam

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] [5/5] kbuild: Set -fconserve-stack option for gcc 4.5
  2009-09-19  9:20     ` Sam Ravnborg
@ 2009-09-20 12:04       ` Andi Kleen
  0 siblings, 0 replies; 15+ messages in thread
From: Andi Kleen @ 2009-09-20 12:04 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Andrew Morton, Andi Kleen, linux-kernel

On Sat, Sep 19, 2009 at 11:20:03AM +0200, Sam Ravnborg wrote:
> On Mon, Sep 14, 2009 at 02:36:15PM -0700, Andrew Morton wrote:
> > On Mon, 14 Sep 2009 22:18:11 +0200 (CEST)
> > Andi Kleen <andi@firstfloor.org> wrote:
> > 
> > > 
> > > The upcomming gcc 4.5 has a new -fconserve-stack option 
> > > that tells the inliner to take stack frame size in account.
> > > Set it if the compiler supports it.
> > > 
> > > Signed-off-by: Andi Kleen <ak@linux.intel.com>
> > > 
> > > ---
> > >  Makefile |    3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > Index: linux-2.6.31-rc3-ak/Makefile
> > > ===================================================================
> > > --- linux-2.6.31-rc3-ak.orig/Makefile
> > > +++ linux-2.6.31-rc3-ak/Makefile
> > > @@ -575,6 +575,9 @@ KBUILD_CFLAGS	+= $(call cc-option,-fno-s
> > >  # revert to pre-gcc-4.4 behaviour of .eh_frame
> > >  KBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
> > >  
> > > +# conserve stack if available
> > > +KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
> > 
> > Do we have any info about what effects this option has upon the
> > generated code?  Text size changes, runtime stack usage changes, etc?
> 
> I merged this despite the relevant questions above was not answered.
> But maybe we should wait until Andi gets back with numbers?

It only changes some inlining decisions, nothing dramatic.  The main
value is in avoiding surprises in the future when the gcc inlining
algorithms change again or long term when everyone uses gcc 4.5 
the current manual hacks to avoid this could be dropped.

Here's some quick data for 64bit with a slightly older gcc snapshot:

   text    data     bss     dec     hex filename
8288629 1399680 1512012 11200321         aae741 vmlinux-45-no-conserve
8298155 1403776 1512012 11213943         ab1c77 vmlinux-45-with-conserve

Only a few hundred bytes difference in text size, at the cost of a 4k
larger data segment (I suspect that's because of the 4K padding)

At least the top stack users don't really change significantly (I suspect
because most of the inline problems have been handled manually already)

If I do statistics over all stack users there's about 4K less stack
used over all functions. Not dramatic.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work
  2009-08-05 21:51 Andi Kleen
@ 2009-08-05 21:51 ` Andi Kleen
  0 siblings, 0 replies; 15+ messages in thread
From: Andi Kleen @ 2009-08-05 21:51 UTC (permalink / raw)
  To: sam, linux-kbuild, linux-kernel


Needed for the next patch

Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 scripts/Kbuild.include |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6.31-rc1-ak/scripts/Kbuild.include
===================================================================
--- linux-2.6.31-rc1-ak.orig/scripts/Kbuild.include
+++ linux-2.6.31-rc1-ak/scripts/Kbuild.include
@@ -83,11 +83,12 @@ TMPOUT := $(if $(KBUILD_EXTMOD),$(firstw
 # is automatically cleaned up.
 try-run = $(shell set -e;		\
 	TMP="$(TMPOUT).$$$$.tmp";	\
+	TMPO="$(TMPOUT).$$$$.o";	\
 	if ($(1)) >/dev/null 2>&1;	\
 	then echo "$(2)";		\
 	else echo "$(3)";		\
 	fi;				\
-	rm -f "$$TMP")
+	rm -f "$$TMP" "$$TMPO")
 
 # as-option
 # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
@@ -133,7 +134,7 @@ cc-ifversion = $(shell [ $(call cc-versi
 # ld-option
 # Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both)
 ld-option = $(call try-run,\
-	$(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2))
+	$(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))
 
 ######
 

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-09-20 12:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-14 20:18 [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Andi Kleen
2009-09-14 20:18 ` [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work Andi Kleen
2009-09-14 21:47   ` Sam Ravnborg
2009-09-15 13:01     ` Andi Kleen
2009-09-15 15:32       ` Sam Ravnborg
2009-09-14 20:18 ` [PATCH] [2/5] kbuild: Check if linker supports the -X option Andi Kleen
2009-09-14 20:18 ` [PATCH] [3/5] kbuild: Echo the record_mcount command Andi Kleen
2009-09-14 20:18 ` [PATCH] [4/5] kbuild: Fail build if recordmcount.pl fails Andi Kleen
2009-09-14 20:18 ` [PATCH] [5/5] kbuild: Set -fconserve-stack option for gcc 4.5 Andi Kleen
2009-09-14 21:36   ` Andrew Morton
2009-09-19  9:20     ` Sam Ravnborg
2009-09-20 12:04       ` Andi Kleen
2009-09-14 21:43 ` [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Sam Ravnborg
2009-09-14 21:47   ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2009-08-05 21:51 Andi Kleen
2009-08-05 21:51 ` [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work Andi Kleen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.