linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h]  Error 2"
@ 2006-01-19  8:41 joel.soete
  0 siblings, 0 replies; 10+ messages in thread
From: joel.soete @ 2006-01-19  8:41 UTC (permalink / raw)
  To: linux-kernel

Miles,

I read you experiment the same pb, as it makes me lost my previous day ;-(.

As far as I can investigate, it came from a pb with 'make mrproper' which (i
don't know yet when/how) rm a char dev namely /dev/null which is then replaced
by a ordinary file?

Anyway you have to 'rm /dev/null' and recreate the char dev:
e.g. with a debian install
# cd /dev
# ./MAKEDEV null 

Joel

---------------------------------------------------------------
A free anti-spam and anti-virus filter on all Scarlet mailboxes
More info on http://www.scarlet.be/


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

* Re: 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h] Error 2"
  2006-01-19  9:23     ` Sam Ravnborg
@ 2006-01-20  6:43       ` Nigel Cunningham
  0 siblings, 0 replies; 10+ messages in thread
From: Nigel Cunningham @ 2006-01-20  6:43 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Miles Lane, LKML

Hi.

On Thursday 19 January 2006 19:23, Sam Ravnborg wrote:
> This can also be a side-effect of /dev/null being damaged.

I had precisely this problem last night. No idea what caused it, but that was 
the issue. Wish I'd seen your email before I wasted time finding the 
cause! :)

Nigel

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

* Re: 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h] Error 2"
  2006-01-19 19:59   ` Miles Lane
  2006-01-19 20:05     ` Miles Lane
@ 2006-01-19 20:07     ` Sam Ravnborg
  1 sibling, 0 replies; 10+ messages in thread
From: Sam Ravnborg @ 2006-01-19 20:07 UTC (permalink / raw)
  To: Miles Lane; +Cc: LKML

On Thu, Jan 19, 2006 at 11:59:26AM -0800, Miles Lane wrote:
 
> I checked and /dev/null exists.  I also have libncursesw5 installed.
> Oddly, I rebooted and when I ran make, the build proceeded.  I quit
> and ran "make menuconfig" again.  As you suggested, this did break
> my build process as before.  I had to reboot in order to complete the
> build process.  Any other possibilities?

I've just posted a patch to fix it.
Included below also.

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

* Re: 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h] Error 2"
  2006-01-19 19:59   ` Miles Lane
@ 2006-01-19 20:05     ` Miles Lane
  2006-01-19 20:07     ` Sam Ravnborg
  1 sibling, 0 replies; 10+ messages in thread
From: Miles Lane @ 2006-01-19 20:05 UTC (permalink / raw)
  To: LKML

On 1/19/06, Miles Lane <miles.lane@gmail.com> wrote:
> I checked and /dev/null exists.  I also have libncursesw5 installed.
> Oddly, I rebooted and when I ran make, the build proceeded.  I quit
> and ran "make menuconfig" again.  As you suggested, this did break
> my build process as before.  I had to reboot in order to complete the
> build process.  Any other possibilities?

Huh.  Weird.  Now it is all happy.  I did install libncursesw5-dev
last night, but I was able to reproduce the problem afterwards.
I allowed one full build to complete, ran make (clean, menuconfig,
and all) and it is still working.  Go figure.

         Miles

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

* Re: 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h] Error 2"
  2006-01-19 11:05 ` David Luyer
@ 2006-01-19 19:59   ` Miles Lane
  2006-01-19 20:05     ` Miles Lane
  2006-01-19 20:07     ` Sam Ravnborg
  0 siblings, 2 replies; 10+ messages in thread
From: Miles Lane @ 2006-01-19 19:59 UTC (permalink / raw)
  To: LKML

On 1/19/06, David Luyer <david@luyer.net> wrote:
> On Wed, Jan 18, 2006 at 10:47:13PM -0800, Miles Lane wrote:
> > make all install modules modules_install
> > /bin/sh: -c: line 0: syntax error near unexpected token `('
> > /bin/sh: -c: line 0: `set -e; echo '  CHK
> > include/linux/version.h'; mkdir -p include/linux/;      if [ `echo -n
> > "2.6.16-rc1-git1 .file null .ident
> > GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
> > .note.GNU-stack,,@progbits" | wc -c ` -gt 64 ]; then echo
> > '"2.6.16-rc1-git1 .file null .ident
> [...]
>
> Happens for me also (on latest snapshot).
>
> /dev/null is removed by this line in check-lxdialog.sh during a
> 'make menuconfig':
>
>    echo "main() {}" | $cc -lncursesw -xc - -o /dev/null 2> /dev/null
>
> This only happens if you don't have a libncursesw installed (not sure
> if it is compiler dependant as well).
>
> /dev/null being removed has many side-effects, this is just one of them.
>
> Obviously 'cd /dev; ./MAKEDEV null' will fix.  Oh, and fixing the script
> would be useful too ;-)

I checked and /dev/null exists.  I also have libncursesw5 installed.
Oddly, I rebooted and when I ran make, the build proceeded.  I quit
and ran "make menuconfig" again.  As you suggested, this did break
my build process as before.  I had to reboot in order to complete the
build process.  Any other possibilities?

Thanks!
        Miles

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

* Re: 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h] Error 2"
  2006-01-19  6:47 Miles Lane
  2006-01-19  7:35 ` Sam Ravnborg
@ 2006-01-19 11:05 ` David Luyer
  2006-01-19 19:59   ` Miles Lane
  1 sibling, 1 reply; 10+ messages in thread
From: David Luyer @ 2006-01-19 11:05 UTC (permalink / raw)
  To: Miles Lane; +Cc: LKML

On Wed, Jan 18, 2006 at 10:47:13PM -0800, Miles Lane wrote:
> make all install modules modules_install
> /bin/sh: -c: line 0: syntax error near unexpected token `('
> /bin/sh: -c: line 0: `set -e; echo '  CHK    
> include/linux/version.h'; mkdir -p include/linux/;      if [ `echo -n
> "2.6.16-rc1-git1 .file null .ident
> GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
> .note.GNU-stack,,@progbits" | wc -c ` -gt 64 ]; then echo
> '"2.6.16-rc1-git1 .file null .ident
[...]

Happens for me also (on latest snapshot).

/dev/null is removed by this line in check-lxdialog.sh during a
'make menuconfig':

   echo "main() {}" | $cc -lncursesw -xc - -o /dev/null 2> /dev/null

This only happens if you don't have a libncursesw installed (not sure
if it is compiler dependant as well).

/dev/null being removed has many side-effects, this is just one of them.

Obviously 'cd /dev; ./MAKEDEV null' will fix.  Oh, and fixing the script
would be useful too ;-)

David.
-- 
Pacific Internet (Australia) Pty Ltd
Business card: http://www.luyer.net/bc.html
Important notice: http://www.pacific.net.au/disclaimer/

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

* Re: 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h] Error 2"
  2006-01-19  9:15   ` Miles Lane
@ 2006-01-19  9:23     ` Sam Ravnborg
  2006-01-20  6:43       ` Nigel Cunningham
  0 siblings, 1 reply; 10+ messages in thread
From: Sam Ravnborg @ 2006-01-19  9:23 UTC (permalink / raw)
  To: Miles Lane; +Cc: LKML

On Thu, Jan 19, 2006 at 01:15:49AM -0800, Miles Lane wrote:
> I do have .kernelrelease that contains:
> "2.6.16-rc1-mm1 .file null .ident
> GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
> .note.GNU-stack,,@progbits"
> I tried deleting it,  but it gets recreated.
> 
> I'm pretty frustrated.  I have built hundreds of kernels and have not
> hit this problem before.
> 
> Any help is most appreciated!
This can also be a side-effect of /dev/null being damaged.
In scripts/kconfig/lxdialog/check-lxdialog.sh we do:
echo main() {} | gcc -nncursesw -cx - -o /dev/null

I could imagine that your /dev/null has become a regular file and is now
filled with garbage.
And then the trick:
cat /dev/null $(wildcard .kernelrelease)
causes KERNELRELEASE to be full of crap.

Care to check that?

I have not a patch ready to fix the /dev/null issue - later today.

	Sam

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

* Re: 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h] Error 2"
  2006-01-19  7:35 ` Sam Ravnborg
@ 2006-01-19  9:15   ` Miles Lane
  2006-01-19  9:23     ` Sam Ravnborg
  0 siblings, 1 reply; 10+ messages in thread
From: Miles Lane @ 2006-01-19  9:15 UTC (permalink / raw)
  To: LKML

On 1/18/06, Sam Ravnborg <sam@ravnborg.org> wrote:
> On Wed, Jan 18, 2006 at 10:47:13PM -0800, Miles Lane wrote:
> > make all install modules modules_install
> > /bin/sh: -c: line 0: syntax error near unexpected token `('
> > /bin/sh: -c: line 0: `set -e; echo '  CHK
> > include/linux/version.h'; mkdir -p include/linux/;      if [ `echo -n
> > "2.6.16-rc1-git1 .file null .ident
> > GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
> > .note.GNU-stack,,@progbits" | wc -c ` -gt 64 ]; then echo
> > '"2.6.16-rc1-git1 .file null .ident
> > GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
> > .note.GNU-stack,,@progbits" exceeds 64 characters' >&2; exit 1; fi;
> > (echo \#define UTS_RELEASE \"2.6.16-rc1-git1 .file null .ident
> > GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
> > .note.GNU-stack,,@progbits\"; echo \#define LINUX_VERSION_CODE `expr 2
> > \\* 65536 + 6 \\* 256 + 16`; echo '#define KERNEL_VERSION(a,b,c) (((a)
> > << 16) + ((b) << 8) + (c))'; ) < /usr/src/linux-2.6/Makefile >
> > include/linux/version.h.tmp; if [ -r include/linux/version.h ] && cmp
> > -s include/linux/version.h include/linux/version.h.tmp; then rm -f
> > include/linux/version.h.tmp; else echo '  UPD
> > include/linux/version.h'; mv -f include/linux/version.h.tmp
> > include/linux/version.h; fi'
> > make: *** [include/linux/version.h] Error 2
> Do you have any file in your build directory named localversion* ?
> That would explain the loon line that includes
> ".file null .ident GCC: ..."
>
> Otherwise something else goes in and trigger the long localversion.
> The variable CONFIG_LOCALVERSION may also be set to a wrong value in
> your environment but this is unlikely.

I don't have any localversion* files in the build directory.
I do have .kernelrelease that contains:
"2.6.16-rc1-mm1 .file null .ident
GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
.note.GNU-stack,,@progbits"
I tried deleting it,  but it gets recreated.

I'm pretty frustrated.  I have built hundreds of kernels and have not
hit this problem before.

Any help is most appreciated!
          Miles

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

* Re: 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h] Error 2"
  2006-01-19  6:47 Miles Lane
@ 2006-01-19  7:35 ` Sam Ravnborg
  2006-01-19  9:15   ` Miles Lane
  2006-01-19 11:05 ` David Luyer
  1 sibling, 1 reply; 10+ messages in thread
From: Sam Ravnborg @ 2006-01-19  7:35 UTC (permalink / raw)
  To: Miles Lane; +Cc: LKML

On Wed, Jan 18, 2006 at 10:47:13PM -0800, Miles Lane wrote:
> make all install modules modules_install
> /bin/sh: -c: line 0: syntax error near unexpected token `('
> /bin/sh: -c: line 0: `set -e; echo '  CHK    
> include/linux/version.h'; mkdir -p include/linux/;      if [ `echo -n
> "2.6.16-rc1-git1 .file null .ident
> GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
> .note.GNU-stack,,@progbits" | wc -c ` -gt 64 ]; then echo
> '"2.6.16-rc1-git1 .file null .ident
> GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
> .note.GNU-stack,,@progbits" exceeds 64 characters' >&2; exit 1; fi;
> (echo \#define UTS_RELEASE \"2.6.16-rc1-git1 .file null .ident
> GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
> .note.GNU-stack,,@progbits\"; echo \#define LINUX_VERSION_CODE `expr 2
> \\* 65536 + 6 \\* 256 + 16`; echo '#define KERNEL_VERSION(a,b,c) (((a)
> << 16) + ((b) << 8) + (c))'; ) < /usr/src/linux-2.6/Makefile >
> include/linux/version.h.tmp; if [ -r include/linux/version.h ] && cmp
> -s include/linux/version.h include/linux/version.h.tmp; then rm -f
> include/linux/version.h.tmp; else echo '  UPD    
> include/linux/version.h'; mv -f include/linux/version.h.tmp
> include/linux/version.h; fi'
> make: *** [include/linux/version.h] Error 2
Do you have any file in your build directory named localversion* ?
That would explain the loon line that includes 
".file null .ident GCC: ..."

Otherwise something else goes in and trigger the long localversion.
The variable CONFIG_LOCALVERSION may also be set to a wrong value in
your environment but this is unlikely.

	Sam

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

* 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h] Error 2"
@ 2006-01-19  6:47 Miles Lane
  2006-01-19  7:35 ` Sam Ravnborg
  2006-01-19 11:05 ` David Luyer
  0 siblings, 2 replies; 10+ messages in thread
From: Miles Lane @ 2006-01-19  6:47 UTC (permalink / raw)
  To: LKML

make all install modules modules_install
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `set -e; echo '  CHK    
include/linux/version.h'; mkdir -p include/linux/;      if [ `echo -n
"2.6.16-rc1-git1 .file null .ident
GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
.note.GNU-stack,,@progbits" | wc -c ` -gt 64 ]; then echo
'"2.6.16-rc1-git1 .file null .ident
GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
.note.GNU-stack,,@progbits" exceeds 64 characters' >&2; exit 1; fi;
(echo \#define UTS_RELEASE \"2.6.16-rc1-git1 .file null .ident
GCC:(GNU)4.0.320060115(prerelease)(Ubuntu4.0.2-7ubuntu1) .section
.note.GNU-stack,,@progbits\"; echo \#define LINUX_VERSION_CODE `expr 2
\\* 65536 + 6 \\* 256 + 16`; echo '#define KERNEL_VERSION(a,b,c) (((a)
<< 16) + ((b) << 8) + (c))'; ) < /usr/src/linux-2.6/Makefile >
include/linux/version.h.tmp; if [ -r include/linux/version.h ] && cmp
-s include/linux/version.h include/linux/version.h.tmp; then rm -f
include/linux/version.h.tmp; else echo '  UPD    
include/linux/version.h'; mv -f include/linux/version.h.tmp
include/linux/version.h; fi'
make: *** [include/linux/version.h] Error 2

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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-19  8:41 2.6.16-rc1-git1 -- Build error "make: *** [include/linux/version.h] Error 2" joel.soete
  -- strict thread matches above, loose matches on Subject: below --
2006-01-19  6:47 Miles Lane
2006-01-19  7:35 ` Sam Ravnborg
2006-01-19  9:15   ` Miles Lane
2006-01-19  9:23     ` Sam Ravnborg
2006-01-20  6:43       ` Nigel Cunningham
2006-01-19 11:05 ` David Luyer
2006-01-19 19:59   ` Miles Lane
2006-01-19 20:05     ` Miles Lane
2006-01-19 20:07     ` 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).