Web Server forum
Back To The Forum Home!Search!Private Messaging System

This is Interesting: Free IT Magazines Now Free shipping to California  
Web Server Talk Web Server Talk > Unix and Linux reviews > Linux support forum > Linux Kernel > kbuild/all archs: Sanitize creating offsets.h




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    kbuild/all archs: Sanitize creating offsets.h  
Sam Ravnborg


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-28-04 10:46 PM

When creating offsets.h from arch/$(ARCH)/Makefile we failed to check
all dependencies. A few key dependencies were listed - but a manually
edited list of include files are bound to be incomplete.
A few times I have tried building a kernel - which failed because
offsets.h needed to be updated but kbuild failed to do so.
I wonder what could happen with a kernel with an out-dated offsets.h
file with wrong assembler constants.

This serie of patches fixes this.
Generating offsets.h is moved to include/asm-$(ARCH)/Kbuild and
the usual dependency tracking is used to detect when an update is needed.

With this mail four patches are posted:
o Accept kbuild file named Kbuild
o generic support for offsets.h
o changes for i386
o changes for arm

The second patch breaks all architectures...

My bk tree at bk://linux-sam.bkbits.net/kbuild contains support for most
architectures (sh and cris missing for now).

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/





[ Post a follow-up to this message ]



    Re: kbuild/all archs: Sanitize creating offsets.h  
Russell King


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-28-04 10:46 PM

On Thu, Oct 28, 2004 at 08:59:18PM +0200, Sam Ravnborg wrote:
> When creating offsets.h from arch/$(ARCH)/Makefile we failed to check
> all dependencies. A few key dependencies were listed - but a manually
> edited list of include files are bound to be incomplete.
> A few times I have tried building a kernel - which failed because
> offsets.h needed to be updated but kbuild failed to do so.
> I wonder what could happen with a kernel with an out-dated offsets.h
> file with wrong assembler constants.

This fails:

rmk@dyn-67:[linux-2.6-rmk]:<1041> amake O=../build/rpc
Using /home/rmk/bk/linux-2.6-rmk as source for kernel
GEN    /home/rmk/bk/build/rpc/Makefile
CHK     include/linux/version.h
UPD     include/linux/version.h
HOSTCC  scripts/basic/fixdep
HOSTCC  scripts/basic/split-include
HOSTCC  scripts/basic/docproc
GEN    /home/rmk/bk/build/rpc/Makefile
SHIPPED scripts/kconfig/zconf.tab.h
HOSTCC  scripts/kconfig/conf.o
HOSTCC  scripts/kconfig/mconf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
HOSTCC  -fPIC scripts/kconfig/zconf.tab.o
HOSTLLD -shared scripts/kconfig/libkconfig.so
HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -s arch/arm/Kconfig
#
# using defaults found in .config
#
SPLIT   include/linux/autoconf.h -> include/config/*
/home/rmk/bk/linux-2.6-rmk/scripts/Makefile.build:13: /home/rmk/bk/linux-2.6
-rmk/include/asm/Makefile: No such file or directory
make[2]: *** No rule to make target `/home/rmk/bk/linux-2.6-rmk/include/
asm/Makefile'.  Stop.
make[1]: *** [prepare0] Error 2
make: *** [_all] Error 2

../build/rpc only contained .version and .config

--
Russell King
Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/





[ Post a follow-up to this message ]



    Re: kbuild/all archs: Sanitize creating offsets.h  
Sam Ravnborg


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-28-04 10:46 PM

On Thu, Oct 28, 2004 at 08:44:30PM +0100, Russell King wrote:
> On Thu, Oct 28, 2004 at 08:59:18PM +0200, Sam Ravnborg wrote: 
>
> This fails:
>
> rmk@dyn-67:[linux-2.6-rmk]:<1041> amake O=../build/rpc
>   Using /home/rmk/bk/linux-2.6-rmk as source for kernel
>   GEN    /home/rmk/bk/build/rpc/Makefile
>   CHK     include/linux/version.h
>   UPD     include/linux/version.h
>   HOSTCC  scripts/basic/fixdep
>   HOSTCC  scripts/basic/split-include
>   HOSTCC  scripts/basic/docproc
>   GEN    /home/rmk/bk/build/rpc/Makefile
>   SHIPPED scripts/kconfig/zconf.tab.h
>   HOSTCC  scripts/kconfig/conf.o
>   HOSTCC  scripts/kconfig/mconf.o
>   SHIPPED scripts/kconfig/zconf.tab.c
>   SHIPPED scripts/kconfig/lex.zconf.c
>   HOSTCC  -fPIC scripts/kconfig/zconf.tab.o
>   HOSTLLD -shared scripts/kconfig/libkconfig.so
>   HOSTLD  scripts/kconfig/conf
> scripts/kconfig/conf -s arch/arm/Kconfig
> #
> # using defaults found in .config
> #
>   SPLIT   include/linux/autoconf.h -> include/config/*
> /home/rmk/bk/linux-2.6-rmk/scripts/Makefile.build:13: /home/rmk/bk/linux-2
.6-rmk/include/asm/Makefile: No such file or directory
> make[2]: *** No rule to make target `/home/rmk/bk/linux-2.6-rmk/includ
e/asm/Makefile'.  Stop.
> make[1]: *** [prepare0] Error 2
> make: *** [_all] Error 2
>
> ../build/rpc only contained .version and .config

Did you apply the patch that enabled kbuild files to be named Kbuild?
It looks like this patch is missing.

If you did apply the patch could you please check if the asm->asm-arm symlin
k exists
when the error happens and that a file named Kbuild is located in the direct
ory:
include/asm-arm/

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/





[ Post a follow-up to this message ]



    Re: kbuild/all archs: Sanitize creating offsets.h  
Russell King


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-28-04 10:46 PM

On Thu, Oct 28, 2004 at 11:59:59PM +0200, Sam Ravnborg wrote: 
>
> Did you apply the patch that enabled kbuild files to be named Kbuild?
> It looks like this patch is missing.

I applied three patches.  The first was "kbuild: Prefer Kbuild as name of
the kbuild files"

> If you did apply the patch could you please check if the asm->asm-arm
> symlink exists when the error happens and that a file named Kbuild is
> located in the directory: include/asm-arm/

In the source tree, I have:

drwxrwxr-x   2 rmk rmk  4096 Oct 28 20:38 include/asm
-rw-rw-r--   1 rmk rmk  1026 Oct 28 20:37 include/asm-arm/Kbuild

Note that kbuild created an extra directory called asm in the source
tree.  In the output tree:

rmk@dyn-67:[linux-2.6-rmk]:<1047> vdir ../build/rpc/include/
drwxr-xr-x  120 rmk rmk 4096 Oct 28 20:42 config
drwxrwxr-x    2 rmk rmk 4096 Oct 28 20:42 linux
rmk@dyn-67:[linux-2.6-rmk]:<1048> vdir ../build/rpc/include2/
total 0
lrwxrwxrwx  1 rmk rmk 42 Oct 28 20:42 asm -> /home/rmk/bk/linux-2.6-rmk/incl
ude/asm-arm

After removing ../build/rpc/include* and include/asm:

rmk@dyn-67:[linux-2.6-rmk]:<1050> amake O=../build/rpc
Using /home/rmk/bk/linux-2.6-rmk as source for kernel
GEN    /home/rmk/bk/build/rpc/Makefile
CHK     include/linux/version.h
UPD     include/linux/version.h
SYMLINK include/asm -> include/asm-arm
GEN    /home/rmk/bk/build/rpc/Makefile
scripts/kconfig/conf -s arch/arm/Kconfig
#
# using defaults found in .config
#
SPLIT   include/linux/autoconf.h -> include/config/*
/home/rmk/bk/linux-2.6-rmk/scripts/Makefile.build:13: /home/rmk/bk/linux-2.6
-rmk/include/asm/Makefile: No such file or directory
make[2]: *** No rule to make target `/home/rmk/bk/linux-2.6-rmk/include/
asm/Makefile'.  Stop.
make[1]: *** [prepare0] Error 2
make: *** [_all] Error 2
rmk@dyn-67:[linux-2.6-rmk]:<1051> vdir ../build/rpc/include*
../build/rpc/include:
total 8
lrwxrwxrwx    1 rmk rmk    7 Oct 28 21:59 asm -> asm-arm
drwxr-xr-x  120 rmk rmk 4096 Oct 28 21:59 config
drwxrwxr-x    2 rmk rmk 4096 Oct 28 21:59 linux

../build/rpc/include2:
total 0
lrwxrwxrwx  1 rmk rmk 42 Oct 28 21:59 asm -> /home/rmk/bk/linux-2.6-rmk/incl
ude/asm-arm
rmk@dyn-67:[linux-2.6-rmk]:<1052> vdir include/
...
drwxrwxr-x   2 rmk rmk  4096 Oct 28 21:59 asm
drwxrwxr-x  25 rmk rmk  4096 Oct 28 20:37 asm-arm

--
Russell King
Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/





[ Post a follow-up to this message ]



    Re: kbuild/all archs: Sanitize creating offsets.h  
Sam Ravnborg


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-28-04 10:46 PM

On Thu, Oct 28, 2004 at 10:00:24PM +0100, Russell King wrote:[vbcol=seagreen] 
>
> I applied three patches.  The first was "kbuild: Prefer Kbuild as name of
> the kbuild files"
> 

OK - I see it now.
It's in i386 also - I will have a fix ready tomorrow. Thanks for testing!

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/





[ Post a follow-up to this message ]



    Re: kbuild/all archs: Sanitize creating offsets.h  
Sam Ravnborg


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-29-04 10:48 PM

On Fri, Oct 29, 2004 at 01:45:49AM +0200, Sam Ravnborg wrote:
> On Thu, Oct 28, 2004 at 10:00:24PM +0100, Russell King wrote: 
>
> OK - I see it now.
> It's in i386 also - I will have a fix ready tomorrow. Thanks for testing!

Fix attached - next time I better check O= support myself.
Russell - I would be glad if you could test this version. There is
some symlink handling for arm I like to see tested.

Sam


===== Makefile 1.546 vs edited =====
--- 1.546/Makefile	2004-10-27 23:00:25 +02:00
+++ edited/Makefile	2004-10-29 23:05:42 +02:00
@@ -761,7 +761,7 @@
prepare1: prepare2 outputmakefile

prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER
-	$(Q)$(MAKE) $(build)=$(srctree)/include/asm
+	$(Q)$(MAKE) $(build)=include/asm-$(ARCH)
ifneq ($(KBUILD_MODULES),)
$(Q)rm -rf $(MODVERDIR)
$(Q)mkdir -p $(MODVERDIR)
===== include/asm-i386/Kbuild 1.1 vs edited =====
--- 1.1/include/asm-i386/Kbuild	2004-10-27 23:06:50 +02:00
+++ edited/include/asm-i386/Kbuild	2004-10-29 01:44:08 +02:00
@@ -11,7 +11,7 @@
always  := offsets.h
targets := offsets.s

-CFLAGS_offsets.o := -I arch/i386/kernel
+CFLAGS_offsets.o := -Iarch/i386/kernel

$(obj)/offsets.h: $(obj)/offsets.s FORCE
$(call filechk,gen-asm-offsets, < $< )
===== scripts/Makefile.build 1.51 vs edited =====
--- 1.51/scripts/Makefile.build	2004-10-27 22:49:53 +02:00
+++ edited/scripts/Makefile.build	2004-10-29 23:04:40 +02:00
@@ -10,7 +10,7 @@
# Read .config if it exist, otherwise ignore
-include .config

-include $(if $(wildcard $(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Makefile)
+include $(if $(wildcard $(srctree)/$(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Ma
kefile)

include scripts/Makefile.lib

===== scripts/Makefile.clean 1.17 vs edited =====
--- 1.17/scripts/Makefile.clean	2004-10-27 22:49:53 +02:00
+++ edited/scripts/Makefile.clean	2004-10-29 23:22:26 +02:00
@@ -7,7 +7,7 @@
.PHONY: __clean
__clean:

-include $(if $(wildcard $(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Makefile)
+include $(if $(wildcard $(srctree)/$(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Ma
kefile)

# Figure out what we need to build from the various variables
#  ========================================
==================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/





[ Post a follow-up to this message ]



    Re: kbuild/all archs: Sanitize creating offsets.h  
Russell King


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-29-04 10:48 PM

On Fri, Oct 29, 2004 at 11:28:52PM +0200, Sam Ravnborg wrote:
> On Fri, Oct 29, 2004 at 01:45:49AM +0200, Sam Ravnborg wrote: 
>
> Fix attached - next time I better check O= support myself.
> Russell - I would be glad if you could test this version. There is
> some symlink handling for arm I like to see tested.

Getting better, but still not right:

make -f /home/rmk/bk/linux-2.6-rmk/scripts/Makefile.build obj=include/asm-ar
m
SYMLINK include/asm-arm/arch -> include/asm-arm/arch-rpc
mkdir -p include/asm-arm
ln -fsn /home/rmk/bk/linux-2.6-rmk/include/asm-arm/arch-rpc include/asm-arm/
arch
arm-linux-gcc -Wp,-MD,include/asm-arm/.offsets.s.d -nostdinc -iwithprefix in
clude -D__KERNEL__ -Iinclude -Iinclude2 -I/home/rmk/bk/linux-2.6-rmk/include
 -I/home/rmk/bk/linux-2.6-rmk/include/asm-arm -Iinclude/asm-arm -Wall -Wstri
ct-prototypes -Wno-trigra
phs -fno-strict-aliasing -fno-common -Os -fno-omit-frame-pointer -fno-omit-f
rame-pointer -mapcs -mno-sched-prolog -mlittle-endian -mapcs-32 -D__LINUX_AR
M_ARCH__=3 -march=armv3 -mtune=strongarm110 -malignment-traps -msoft-float -
Uarm -Wdeclaration-after-st
atement -I/home/rmk/bk/linux-2.6-rmk/ -I arch/arm/kernel  -DKBUILD_BASENAME=
offsets -DKBUILD_MODNAME=offsets -S -o include/asm-arm/offsets.s /home/rmk/b
k/linux-2.6-rmk/include/asm-arm/offsets.c
set -e; echo '  CHK     include/asm-arm/constants.h'; mkdir -p include/asm-a
rm/;        (set -e; echo "#ifndef __ASM_OFFSETS_H__"; echo "#define __ASM_O
FFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This f
ile was generated by arch/a
rm/Makefile"; echo " *"; echo " */"; echo ""; sed -ne "/^->/{s:^->\(	
1;^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}
"; echo ""; echo "#endif" )  < include/asm-arm/offsets.s > include/asm-arm/c
onstants.h.tmp; if [ -r include/asm-arm/cons
tants.h ] && cmp -s include/asm-arm/constants.h include/asm-arm/constants.h.
tmp; then rm -f include/asm-arm/constants.h.tmp; else echo '  UPD     includ
e/asm-arm/constants.h'; mv -f include/asm-arm/constants.h.tmp include/asm-ar
m/constants.h; fi
CHK     include/asm-arm/constants.h
UPD     include/asm-arm/constants.h
make[2]: *** No rule to make target `include/asm-arm/include/asm-arm/.ar
ch', needed by `__build'.  Stop.
make[1]: *** [prepare0] Error 2
make: *** [_all] Error 2

Removing "include/asm-arm/" from the always := line in asm-arm/Kbuild
appears to fix this.

--
Russell King
Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/





[ Post a follow-up to this message ]



    Re: kbuild/all archs: Sanitize creating offsets.h  
Sam Ravnborg


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-29-04 10:48 PM

On Fri, Oct 29, 2004 at 08:51:06PM +0100, Russell King wrote:
> On Fri, Oct 29, 2004 at 11:28:52PM +0200, Sam Ravnborg wrote: 
>
> Getting better, but still not right:

Thanks.
Building arm toolchain atm so I can test myself.
The .arch stuff was the main reason to post arm.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:24 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register