All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PATCH] kbuild fixes for 2.6.18
@ 2006-08-07 19:27 Sam Ravnborg
  2006-08-07 20:42 ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2006-08-07 19:27 UTC (permalink / raw)
  To: Greg KH, Andrew Morton, LKML

Hi Greg.
Please apply to 2.6.18.

Pull from:

	git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-2.6.18.git

Patches for both changes appended below.

	Sam

Shortlog:

Sam Ravnborg:
      kbuild: do not try to build content of initramfs
      kbuild: external modules shall not check config consistency

commit 9ee4e3365dd0dab4c1e02fe44dc08a223b826c72
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Mon Aug 7 21:01:36 2006 +0200

    kbuild: external modules shall not check config consistency
    
    external modules needs include/linux/autoconf.h and include/config/auto.conf
    but skip the integrity test of these. Even with a newer Kconfig file we
    shall just proceed since external modules simply uses the kernel source and
    shall not attempt to modify it.
    Error out if a config fiel is missing since they are mandatory.
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

commit 58a2f7d85aaf4c41157f15c43a913b5c3c6b3adb
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Mon Aug 7 20:58:28 2006 +0200

    kbuild: do not try to build content of initramfs
    
    When a file supplied via CONFIG_INITRAMFS pointed to a file
    for which kbuild had a rule to compile it (foo.c => foo.o)
    then kbuild would compile the file before adding the
    file to the initramfs.
    
    Teach make that files included in initramfs shall not be updated by adding
    an 'empty command'. (See "Using Empty Commands" in info make).
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 Makefile     |   24 ++++++++++++++++++------
 usr/Makefile |    3 +++
 2 files changed, 21 insertions(+), 6 deletions(-)


diff --git a/Makefile b/Makefile
index 110db85..e71fefd 100644
--- a/Makefile
+++ b/Makefile
@@ -436,12 +436,13 @@ core-y		:= usr/
 endif # KBUILD_EXTMOD
 
 ifeq ($(dot-config),1)
-# In this section, we need .config
+# Read in config
+-include include/config/auto.conf
 
+ifeq ($(KBUILD_EXTMOD),)
 # Read in dependencies to all Kconfig* files, make sure to run
 # oldconfig if changes are detected.
 -include include/config/auto.conf.cmd
--include include/config/auto.conf
 
 # To avoid any implicit rule to kick in, define an empty command
 $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
@@ -451,16 +452,27 @@ # with it and forgot to run make oldconf
 # if auto.conf.cmd is missing then we are probably in a cleaned tree so
 # we execute the config step to be sure to catch updated Kconfig files
 include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
-ifeq ($(KBUILD_EXTMOD),)
 	$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
 else
-	$(error kernel configuration not valid - run 'make prepare' in $(srctree) to update it)
-endif
+# external modules needs include/linux/autoconf.h and include/config/auto.conf
+# but do not care if they are up-to-date. Use auto.conf to trigger the test
+PHONY += include/config/auto.conf
+
+include/config/auto.conf:
+	$(Q)test -e include/linux/autoconf.h -a -e $@ || (		\
+	echo;								\
+	echo "  ERROR: Kernel configuration is invalid.";		\
+	echo "         include/linux/autoconf.h or $@ are missing.";	\
+	echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
+	echo;								\
+	/bin/false)
+
+endif # KBUILD_EXTMOD
 
 else
 # Dummy target needed, because used as prerequisite
 include/config/auto.conf: ;
-endif
+endif # $(dot-config)
 
 # The all: target is the default when no target is given on the
 # command line.
diff --git a/usr/Makefile b/usr/Makefile
index e938242..5b31c0b 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -35,6 +35,9 @@ quiet_cmd_initfs = GEN     $@
       cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
 
 targets := initramfs_data.cpio.gz
+# do not try to update files included in initramfs
+$(deps_initramfs): ;
+
 $(deps_initramfs): klibcdirs
 # We rebuild initramfs_data.cpio.gz if:
 # 1) Any included file is newer then initramfs_data.cpio.gz

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

* Re: [GIT PATCH] kbuild fixes for 2.6.18
  2006-08-07 19:27 [GIT PATCH] kbuild fixes for 2.6.18 Sam Ravnborg
@ 2006-08-07 20:42 ` Greg KH
  2006-08-07 21:02   ` Sam Ravnborg
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2006-08-07 20:42 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Andrew Morton, LKML

On Mon, Aug 07, 2006 at 09:27:09PM +0200, Sam Ravnborg wrote:
> Hi Greg.
> Please apply to 2.6.18.
> 
> Pull from:
> 
> 	git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-2.6.18.git

Thanks, pulled and pushed out.

Oh, I just got a few reports of 2.6.18-rc3 not building with external
trees very well, and something like the following would be required:

--- linux-2.6.17/arch/sh/Makefile-dist        2006-08-07 20:42:33.000000000 +0200
+++ linux-2.6.17/arch/sh/Makefile     2006-08-07 21:08:26.000000000 +0200
@@ -173,7 +173,7 @@
 archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach

 PHONY += maketools FORCE
-maketools:  include/linux/version.h FORCE
+maketools: $(objtree)/include/linux/version.h FORCE

for all instances of the version.h file.

Was this fixed in -rc4 and I should update the SuSE kernel to it (well,
I'll do that anyway later today...), or is this something that you did
not know about?

thanks,

greg k-h

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

* Re: [GIT PATCH] kbuild fixes for 2.6.18
  2006-08-07 20:42 ` Greg KH
@ 2006-08-07 21:02   ` Sam Ravnborg
  2006-08-07 21:06     ` arm + sh cross compile suite for amd64 (i386)? Sam Ravnborg
                       ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sam Ravnborg @ 2006-08-07 21:02 UTC (permalink / raw)
  To: Greg KH; +Cc: Andrew Morton, LKML

On Mon, Aug 07, 2006 at 01:42:41PM -0700, Greg KH wrote:
> On Mon, Aug 07, 2006 at 09:27:09PM +0200, Sam Ravnborg wrote:
> > Hi Greg.
> > Please apply to 2.6.18.
> > 
> > Pull from:
> > 
> > 	git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-2.6.18.git
> 
> Thanks, pulled and pushed out.
> 
> Oh, I just got a few reports of 2.6.18-rc3 not building with external
> trees very well, and something like the following would be required:
> 
> --- linux-2.6.17/arch/sh/Makefile-dist        2006-08-07 20:42:33.000000000 +0200
> +++ linux-2.6.17/arch/sh/Makefile     2006-08-07 21:08:26.000000000 +0200
> @@ -173,7 +173,7 @@
>  archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach
> 
>  PHONY += maketools FORCE
> -maketools:  include/linux/version.h FORCE
> +maketools: $(objtree)/include/linux/version.h FORCE
> 
> for all instances of the version.h file.
This looks bogus.
Current directory is $(objtree) so prefixing with $(objtree) should not
be needed and doing so will confuse make. make will not know that
$(objtree)/include/linux/version.h and include/linux/version.h is the
same file.

And the version.h dependency is anyway not needed. kbuild guarantee the
version.h is created when the commands for archprepare are executed.

So for sh I would expect the following is a better fix:

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index e467a45..ed1c865 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -172,8 +172,8 @@ include/asm-sh/.mach: $(wildcard include
 
 archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach
 
-PHONY += maketools FORCE
-maketools:  include/linux/version.h FORCE
+PHONY += maketools
+maketools:  FORCE
 	$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
 
 all: zImage


arm should have a similar fix - thats the only other archtecture that
reference version.h in the arch specific kbuild (Makefile) files.

> 
> Was this fixed in -rc4 and I should update the SuSE kernel to it (well,
> I'll do that anyway later today...), or is this something that you did
> not know about?
Have not seen the reports - may have overlookd them at lkml.
Been on vacation a few days so ctrl-d was used to read most of my
lkml mails.

	Sam

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

* arm + sh cross compile suite for amd64 (i386)?
  2006-08-07 21:02   ` Sam Ravnborg
@ 2006-08-07 21:06     ` Sam Ravnborg
  2006-08-07 22:23       ` Andrew Morton
  2006-08-07 21:20     ` [GIT PATCH] kbuild fixes for 2.6.18 Greg KH
  2006-08-08  8:45     ` Takashi Iwai
  2 siblings, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2006-08-07 21:06 UTC (permalink / raw)
  To: Greg KH; +Cc: Andrew Morton, LKML

On Mon, Aug 07, 2006 at 11:02:09PM +0200, Sam Ravnborg wrote:
 
> So for sh I would expect the following is a better fix:

Reminds me. Anyone has a pointer to arm+sh gcc + binutils cross-compile
suite that can run on my amd64 box?
My usual source: http://developer.osdl.org/dev/plm/cross_compile/
did have neither sh nor arm :-(

	Sam

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

* Re: [GIT PATCH] kbuild fixes for 2.6.18
  2006-08-07 21:02   ` Sam Ravnborg
  2006-08-07 21:06     ` arm + sh cross compile suite for amd64 (i386)? Sam Ravnborg
@ 2006-08-07 21:20     ` Greg KH
  2006-08-08  8:45     ` Takashi Iwai
  2 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2006-08-07 21:20 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Andrew Morton, LKML

On Mon, Aug 07, 2006 at 11:02:09PM +0200, Sam Ravnborg wrote:
> On Mon, Aug 07, 2006 at 01:42:41PM -0700, Greg KH wrote:
> > On Mon, Aug 07, 2006 at 09:27:09PM +0200, Sam Ravnborg wrote:
> > > Hi Greg.
> > > Please apply to 2.6.18.
> > > 
> > > Pull from:
> > > 
> > > 	git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-2.6.18.git
> > 
> > Thanks, pulled and pushed out.
> > 
> > Oh, I just got a few reports of 2.6.18-rc3 not building with external
> > trees very well, and something like the following would be required:
> > 
> > --- linux-2.6.17/arch/sh/Makefile-dist        2006-08-07 20:42:33.000000000 +0200
> > +++ linux-2.6.17/arch/sh/Makefile     2006-08-07 21:08:26.000000000 +0200
> > @@ -173,7 +173,7 @@
> >  archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach
> > 
> >  PHONY += maketools FORCE
> > -maketools:  include/linux/version.h FORCE
> > +maketools: $(objtree)/include/linux/version.h FORCE
> > 
> > for all instances of the version.h file.
> This looks bogus.

Ick, ok, thanks.

> Current directory is $(objtree) so prefixing with $(objtree) should not
> be needed and doing so will confuse make. make will not know that
> $(objtree)/include/linux/version.h and include/linux/version.h is the
> same file.
> 
> And the version.h dependency is anyway not needed. kbuild guarantee the
> version.h is created when the commands for archprepare are executed.

Hm, I'll point the person who is having the problem with this at you and
lkml and have him explain the problems he is seeing.  Much easier than
me trying to mediate the conversation :)

thanks,

greg k-h

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

* Re: arm + sh cross compile suite for amd64 (i386)?
  2006-08-07 21:06     ` arm + sh cross compile suite for amd64 (i386)? Sam Ravnborg
@ 2006-08-07 22:23       ` Andrew Morton
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2006-08-07 22:23 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Greg KH, LKML

On Mon, 7 Aug 2006 23:06:25 +0200
Sam Ravnborg <sam@ravnborg.org> wrote:

> On Mon, Aug 07, 2006 at 11:02:09PM +0200, Sam Ravnborg wrote:
>  
> > So for sh I would expect the following is a better fix:
> 
> Reminds me. Anyone has a pointer to arm+sh gcc + binutils cross-compile
> suite that can run on my amd64 box?
> My usual source: http://developer.osdl.org/dev/plm/cross_compile/
> did have neither sh nor arm :-(
> 

I was somewhat-successful in building those up.  From my notes:

arm:
	eval `cat arm.dat gcc-3.4.5-glibc-2.3.6.dat` sh all.sh --notest

sh4:
	eval `cat sh4.dat gcc-3.4.5-glibc-2.3.6.dat` sh all.sh --notest

when you've struggled with crosstool for long enough, that'll become
meaningful ;)


fwiw, I've uploaded x86 binaries to http://userweb.kernel.org/~akpm/. 
They're a bit flakey but seem to be good enough to get through a defconfig
build.  The main problem is fancy machine-specific binutils options which
are present in the kernel Makefiles but which stock binutils doesn't know
about.



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

* Re: [GIT PATCH] kbuild fixes for 2.6.18
  2006-08-07 21:02   ` Sam Ravnborg
  2006-08-07 21:06     ` arm + sh cross compile suite for amd64 (i386)? Sam Ravnborg
  2006-08-07 21:20     ` [GIT PATCH] kbuild fixes for 2.6.18 Greg KH
@ 2006-08-08  8:45     ` Takashi Iwai
  2 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2006-08-08  8:45 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Greg KH, Andrew Morton, LKML

At Mon, 7 Aug 2006 23:02:09 +0200,
Sam Ravnborg wrote:
> 
> On Mon, Aug 07, 2006 at 01:42:41PM -0700, Greg KH wrote:
> > On Mon, Aug 07, 2006 at 09:27:09PM +0200, Sam Ravnborg wrote:
> > > Hi Greg.
> > > Please apply to 2.6.18.
> > > 
> > > Pull from:
> > > 
> > > 	git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-2.6.18.git
> > 
> > Thanks, pulled and pushed out.
> > 
> > Oh, I just got a few reports of 2.6.18-rc3 not building with external
> > trees very well, and something like the following would be required:
> > 
> > --- linux-2.6.17/arch/sh/Makefile-dist        2006-08-07 20:42:33.000000000 +0200
> > +++ linux-2.6.17/arch/sh/Makefile     2006-08-07 21:08:26.000000000 +0200
> > @@ -173,7 +173,7 @@
> >  archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach
> > 
> >  PHONY += maketools FORCE
> > -maketools:  include/linux/version.h FORCE
> > +maketools: $(objtree)/include/linux/version.h FORCE
> > 
> > for all instances of the version.h file.
> This looks bogus.
> Current directory is $(objtree) so prefixing with $(objtree) should not
> be needed and doing so will confuse make. make will not know that
> $(objtree)/include/linux/version.h and include/linux/version.h is the
> same file.

OK now I'm awake ;)

Actually, this part wasn't tested at all.  I just blindly applied the
patch for 2.6.16.  Simply discard it.

> And the version.h dependency is anyway not needed. kbuild guarantee the
> version.h is created when the commands for archprepare are executed.
> 
> So for sh I would expect the following is a better fix:
> 
> diff --git a/arch/sh/Makefile b/arch/sh/Makefile
> index e467a45..ed1c865 100644
> --- a/arch/sh/Makefile
> +++ b/arch/sh/Makefile
> @@ -172,8 +172,8 @@ include/asm-sh/.mach: $(wildcard include
>  
>  archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach
>  
> -PHONY += maketools FORCE
> -maketools:  include/linux/version.h FORCE
> +PHONY += maketools
> +maketools:  FORCE
>  	$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
>  
>  all: zImage
> 
> 
> arm should have a similar fix - thats the only other archtecture that
> reference version.h in the arch specific kbuild (Makefile) files.

Yes, that looks better anyway.


> > Was this fixed in -rc4 and I should update the SuSE kernel to it (well,
> > I'll do that anyway later today...), or is this something that you did
> > not know about?
> Have not seen the reports - may have overlookd them at lkml.
> Been on vacation a few days so ctrl-d was used to read most of my
> lkml mails.

I believe your patch fixes the problem we had -- the compilation of
external modules with extra headers (created via "make prepare")
outside the kernel source root.  At least, I can build external
alsa-driver modules now.

Of course, each package must be fixed to adapt somes changes in 2.6.18
(implicit inclusion of linux/config.h and linux/utsrelease.h)...


Thanks,

Takashi

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

end of thread, other threads:[~2006-08-08  8:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-07 19:27 [GIT PATCH] kbuild fixes for 2.6.18 Sam Ravnborg
2006-08-07 20:42 ` Greg KH
2006-08-07 21:02   ` Sam Ravnborg
2006-08-07 21:06     ` arm + sh cross compile suite for amd64 (i386)? Sam Ravnborg
2006-08-07 22:23       ` Andrew Morton
2006-08-07 21:20     ` [GIT PATCH] kbuild fixes for 2.6.18 Greg KH
2006-08-08  8:45     ` Takashi Iwai

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.