public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements
@ 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
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Andi Kleen @ 2009-08-05 21:51 UTC (permalink / raw)
  To: sam, linux-kbuild, linux-kernel


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 earlier today.

-Andi

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

* [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work
  2009-08-05 21:51 [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Andi Kleen
@ 2009-08-05 21:51 ` Andi Kleen
  2009-08-05 21:51 ` [PATCH] [2/5] kbuild: Check if linker supports the -X option Andi Kleen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ 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] 9+ messages in thread

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


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] 9+ messages in thread

* [PATCH] [3/5] kbuild: Echo the record_mcount command
  2009-08-05 21:51 [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Andi Kleen
  2009-08-05 21:51 ` [PATCH] [1/5] kbuild: Fix ld-option Makefile macro to really work Andi Kleen
  2009-08-05 21:51 ` [PATCH] [2/5] kbuild: Check if linker supports the -X option Andi Kleen
@ 2009-08-05 21:51 ` Andi Kleen
  2009-08-05 21:51 ` [PATCH] [4/5] kbuild: Fail build if recordmcount.pl fails Andi Kleen
  2009-08-05 21:51 ` [PATCH] [5/5] kbuild: Set -fconserve-stack option for gcc 4.5 Andi Kleen
  4 siblings, 0 replies; 9+ messages in thread
From: Andi Kleen @ 2009-08-05 21:51 UTC (permalink / raw)
  To: sam, linux-kbuild, linux-kernel


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] 9+ messages in thread

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


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] 9+ messages in thread

* [PATCH] [5/5] kbuild: Set -fconserve-stack option for gcc 4.5
  2009-08-05 21:51 [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements Andi Kleen
                   ` (3 preceding siblings ...)
  2009-08-05 21:51 ` [PATCH] [4/5] kbuild: Fail build if recordmcount.pl fails Andi Kleen
@ 2009-08-05 21:51 ` Andi Kleen
  4 siblings, 0 replies; 9+ messages in thread
From: Andi Kleen @ 2009-08-05 21:51 UTC (permalink / raw)
  To: sam, linux-kbuild, linux-kernel


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] 9+ messages in thread

* [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements
@ 2009-09-14 20:18 Andi Kleen
  2009-09-14 21:43 ` Sam Ravnborg
  0 siblings, 1 reply; 9+ 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] 9+ 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
@ 2009-09-14 21:43 ` Sam Ravnborg
  2009-09-14 21:47   ` Andrew Morton
  0 siblings, 1 reply; 9+ 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] 9+ messages in thread

* Re: [PATCH] [0/5] kbuild: A couple of Kbuild fixes/improvements
  2009-09-14 21:43 ` Sam Ravnborg
@ 2009-09-14 21:47   ` Andrew Morton
  0 siblings, 0 replies; 9+ 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] 9+ messages in thread

end of thread, other threads:[~2009-09-14 21:47 UTC | newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox