linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PATCHES] kbuild fixes
@ 2006-01-19 20:02 Sam Ravnborg
  2006-01-19 20:04 ` [PATCH 1/3] kconfig: fix /dev/null breakage Sam Ravnborg
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Sam Ravnborg @ 2006-01-19 20:02 UTC (permalink / raw)
  To: Linus Torvalds, linux-kernel, Andrew Morton, Sam Ravnborg

Hi Linus.

Please pull from:

	ssh://master.kernel.org/pub/linux/kernel/git/sam/kbuild.git

This will fix the issue that executing make menuconfig and make mrproper
will change permissions on /dev/null and sometimes convert it to a
regular file.
gcc ... -o /dev/null was causing the trouble so we avoid it now.

Two other fixes included:

Al Viro:
      cris: asm-offsets related build failure

Sam Ravnborg:
      kconfig: fix /dev/null breakage
      kbuild: fix build with O=..


diffstat:

 Makefile                                   |   12 ++++++------
 arch/cris/Makefile                         |    6 ++----
 scripts/kconfig/lxdialog/Makefile          |    7 +++++--
 scripts/kconfig/lxdialog/check-lxdialog.sh |   15 +++++++++------
 4 files changed, 22 insertions(+), 18 deletions(-)

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

* [PATCH 1/3] kconfig: fix /dev/null breakage
  2006-01-19 20:02 [GIT PATCHES] kbuild fixes Sam Ravnborg
@ 2006-01-19 20:04 ` Sam Ravnborg
  2006-01-19 20:28   ` Jan Engelhardt
  2006-01-19 20:04 ` [PATCH 2/3] cris: asm-offsets related build failure Sam Ravnborg
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2006-01-19 20:04 UTC (permalink / raw)
  To: linux-kernel

Subject: [PATCH 1/3] kconfig: fix /dev/null breakage

While running "make menuconfig" and "make mrproper"
some people experienced that /dev/null suddenly changed
permissions or suddenly became a regular file.
The main reason was that /dev/null was used as output
to gcc in the check-lxdialog.sh script and gcc did
some strange things with the output file; in this
case /dev/null when it errorred out.

Following patch implements a suggestion
from Bryan O'Sullivan <bos@serpentine.com> to
use gcc -print-file-name=libxxx.so.

Also the Makefile is adjusted to not resolve value of
HOST_EXTRACFLAGS and HOST_LOADLIBES until they are actually used.
This prevents us from calling gcc when running make *clean/mrproper

Thanks to Eyal Lebedinsky <eyal@eyal.emu.id.au> and
Jean Delvare <khali@linux-fr.org> for the first error reports.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

---

 scripts/kconfig/lxdialog/Makefile          |    7 +++++--
 scripts/kconfig/lxdialog/check-lxdialog.sh |   14 +++++++++-----
 2 files changed, 14 insertions(+), 7 deletions(-)

ec29b10f689f292accf9af0bc1c00e7815f6be7b
diff --git a/scripts/kconfig/lxdialog/Makefile b/scripts/kconfig/lxdialog/Makefile
index fae3e29..bbf4887 100644
--- a/scripts/kconfig/lxdialog/Makefile
+++ b/scripts/kconfig/lxdialog/Makefile
@@ -2,8 +2,11 @@
 #
 
 check-lxdialog  := $(srctree)/$(src)/check-lxdialog.sh
-HOST_EXTRACFLAGS:= $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
-HOST_LOADLIBES  := $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
+
+# Use reursively expanded variables so we do not call gcc unless
+# we really need to do so. (Do not call gcc as part of make mrproper)
+HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
+HOST_LOADLIBES   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
  
 HOST_EXTRACFLAGS += -DLOCALE 
 
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 448e353..120d624 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,17 +4,17 @@
 # What library to link
 ldflags()
 {
-	echo "main() {}" | $cc -lncursesw -xc - -o /dev/null 2> /dev/null
+	$cc -print-file-name=libncursesw.so | grep -q /
 	if [ $? -eq 0 ]; then
 		echo '-lncursesw'
 		exit
 	fi
-	echo "main() {}" | $cc -lncurses -xc - -o /dev/null 2> /dev/null
+	$cc -print-file-name=libncurses.so | grep -q /
 	if [ $? -eq 0 ]; then
 		echo '-lncurses'
 		exit
 	fi
-	echo "main() {}" | $cc -lcurses -xc - -o /dev/null 2> /dev/null
+	$cc -print-file-name=libcurses.so | grep -q /
 	if [ $? -eq 0 ]; then
 		echo '-lcurses'
 		exit
@@ -36,10 +36,13 @@ ccflags()
 	fi
 }
 
-compiler=""
+# Temp file, try to clean up after us
+tmp=.lxdialog.tmp
+trap "rm -f $tmp" 0 1 2 3 15
+
 # Check if we can link to ncurses
 check() {
-	echo "main() {}" | $cc -xc - -o /dev/null 2> /dev/null
+	echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null
 	if [ $? != 0 ]; then
 		echo " *** Unable to find the ncurses libraries."          1>&2
 		echo " *** make menuconfig require the ncurses libraries"  1>&2
@@ -59,6 +62,7 @@ if [ $# == 0 ]; then
 	exit 1
 fi
 
+cc=""
 case "$1" in
 	"-check")
 		shift
-- 
1.0.GIT

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

* [PATCH 2/3] cris: asm-offsets related build failure
  2006-01-19 20:02 [GIT PATCHES] kbuild fixes Sam Ravnborg
  2006-01-19 20:04 ` [PATCH 1/3] kconfig: fix /dev/null breakage Sam Ravnborg
@ 2006-01-19 20:04 ` Sam Ravnborg
  2006-01-19 20:05 ` [PATCH 3/3] kbuild: fix build with O= Sam Ravnborg
  2006-01-19 20:12 ` [GIT PATCHES] kbuild fixes Sam Ravnborg
  3 siblings, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2006-01-19 20:04 UTC (permalink / raw)
  To: linux-kernel

Subject: [PATCH 2/3] cris: asm-offsets related build failure
From: Al Viro <viro@ftp.linux.org.uk>
Date: 1137697395 +0000

fallout from "kbuild: cris use generic asm-offsets.h support" - symlink
target was wrong

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

---

 arch/cris/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

6dd84484328cf9a0d7b8d100f506333a80033db5
diff --git a/arch/cris/Makefile b/arch/cris/Makefile
index ea65d58..ee11469 100644
--- a/arch/cris/Makefile
+++ b/arch/cris/Makefile
@@ -119,7 +119,7 @@ $(SRC_ARCH)/.links:
 	@ln -sfn $(SRC_ARCH)/$(SARCH)/lib $(SRC_ARCH)/lib
 	@ln -sfn $(SRC_ARCH)/$(SARCH) $(SRC_ARCH)/arch
 	@ln -sfn $(SRC_ARCH)/$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
-	@ln -sfn $(SRC_ARCH)/$(SARCH)/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c
+	@ln -sfn $(SRC_ARCH)/$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c
 	@touch $@
 
 # Create link to sub arch includes
-- 
1.0.GIT

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

* [PATCH 3/3] kbuild: fix build with O=..
  2006-01-19 20:02 [GIT PATCHES] kbuild fixes Sam Ravnborg
  2006-01-19 20:04 ` [PATCH 1/3] kconfig: fix /dev/null breakage Sam Ravnborg
  2006-01-19 20:04 ` [PATCH 2/3] cris: asm-offsets related build failure Sam Ravnborg
@ 2006-01-19 20:05 ` Sam Ravnborg
  2006-01-19 20:12 ` [GIT PATCHES] kbuild fixes Sam Ravnborg
  3 siblings, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2006-01-19 20:05 UTC (permalink / raw)
  To: linux-kernel

Subject: [PATCH 3/3] kbuild: fix build with O=..

.kernelrelease was saved in same directory as kernel source also
with make O=...
Make sure we kick in the normal logic to shift to the output directory
when we build .kernelrelease after executing *config.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

---

 Makefile |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

f73b6ff2f3e7981c0b9cd34a70c491dfa98fd396
diff --git a/Makefile b/Makefile
index 37a4b67..671e6da 100644
--- a/Makefile
+++ b/Makefile
@@ -435,7 +435,7 @@ export KBUILD_DEFCONFIG
 config %config: scripts_basic outputmakefile FORCE
 	$(Q)mkdir -p include/linux
 	$(Q)$(MAKE) $(build)=scripts/kconfig $@
-	$(Q)$(MAKE) .kernelrelease
+	$(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
 
 else
 # ===========================================================================
@@ -1265,7 +1265,8 @@ define cmd_tags
 	CTAGSF=`ctags --version | grep -i exuberant >/dev/null &&     \
                 echo "-I __initdata,__exitdata,__acquires,__releases  \
                       -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL              \
-                      --extra=+f --c-kinds=+px"`;                     \
+                      --extra=+f --c-kinds=+px                        \
+		      --regex-asm=/ENTRY\(([^)]*)\).*/\1/"`;          \
                 $(all-sources) | xargs ctags $$CTAGSF -a
 endef
 
-- 
1.0.GIT

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

* Re: [GIT PATCHES] kbuild fixes
  2006-01-19 20:02 [GIT PATCHES] kbuild fixes Sam Ravnborg
                   ` (2 preceding siblings ...)
  2006-01-19 20:05 ` [PATCH 3/3] kbuild: fix build with O= Sam Ravnborg
@ 2006-01-19 20:12 ` Sam Ravnborg
  3 siblings, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2006-01-19 20:12 UTC (permalink / raw)
  To: Linus Torvalds, linux-kernel, Andrew Morton

On Thu, Jan 19, 2006 at 09:02:16PM +0100, Sam Ravnborg wrote:
> Hi Linus.
> 
> Please pull from:
> 
> 	ssh://master.kernel.org/pub/linux/kernel/git/sam/kbuild.git

Make that:
 	ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git

	Sam

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

* Re: [PATCH 1/3] kconfig: fix /dev/null breakage
  2006-01-19 20:04 ` [PATCH 1/3] kconfig: fix /dev/null breakage Sam Ravnborg
@ 2006-01-19 20:28   ` Jan Engelhardt
  2006-01-19 20:56     ` Sam Ravnborg
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Engelhardt @ 2006-01-19 20:28 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel


>Following patch implements a suggestion
>from Bryan O'Sullivan <bos@serpentine.com> to
>use gcc -print-file-name=libxxx.so.

Just for completeness: Does it work with all gccs supported?



Jan Engelhardt
-- 

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

* Re: [PATCH 1/3] kconfig: fix /dev/null breakage
  2006-01-19 20:28   ` Jan Engelhardt
@ 2006-01-19 20:56     ` Sam Ravnborg
  0 siblings, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2006-01-19 20:56 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: linux-kernel

On Thu, Jan 19, 2006 at 09:28:48PM +0100, Jan Engelhardt wrote:
> 
> >Following patch implements a suggestion
> >from Bryan O'Sullivan <bos@serpentine.com> to
> >use gcc -print-file-name=libxxx.so.
> 
> Just for completeness: Does it work with all gccs supported?

It has been used like this:
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)

for a few months in the main Makefile.
So I assume yes.

	Sam

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

end of thread, other threads:[~2006-01-19 20:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-19 20:02 [GIT PATCHES] kbuild fixes Sam Ravnborg
2006-01-19 20:04 ` [PATCH 1/3] kconfig: fix /dev/null breakage Sam Ravnborg
2006-01-19 20:28   ` Jan Engelhardt
2006-01-19 20:56     ` Sam Ravnborg
2006-01-19 20:04 ` [PATCH 2/3] cris: asm-offsets related build failure Sam Ravnborg
2006-01-19 20:05 ` [PATCH 3/3] kbuild: fix build with O= Sam Ravnborg
2006-01-19 20:12 ` [GIT PATCHES] kbuild fixes Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).