Re: [kbuild-devel] Dynamically add objects to be built

2010-04-29 Thread Sam Ravnborg
First - posting to linux-kbuild will liekly get you more attention.
The old list at sourceforge is no longer active.

[From the bottom of your mail]
 If anyone can point me to the kbuild way of doing things, it would be
 greatly appreciated. Thanks!
The kbuild philosofy is that you specify all .o files.
Considering the many many hours invested writing a single .c file,
then the effort it is to add it to the kbuild file is minimal.

On Thu, Apr 29, 2010 at 11:38:30AM -0500, Chris Horlick wrote:
 Im having an issue getting my build system set up the way id like and im
 hoping someone here can point me in a new direction or perhaps offer some
 advice.
 If i manually add each .o file i want built to the makefile the lkm will
 build with no issues, essentially this works:
 
 OBJS = main.o
 #OBJS += wm_algo_common.o
 #OBJS += wm_algomgr_ops.o
 #OBJS += wm_algomgr_static.o
 #OBJS += wm_algo_tcp1.o
 #OBJS += wm_algo_tcp2.o
 #OBJS += wm_algo_udp.o
 #OBJS += wm_arp_reg_method.o
 #OBJS += wmc_algomgr.o
 #OBJS += wmc_core.o
 #OBJS += wmc_core_function.o
 #OBJS += wmc_debug.o
 #OBJS += wmc_linked_list.o
 #OBJS += wm_core_info.o
 #OBJS += wm_core_ops.o
 #OBJS += wmc_packet_common.o
 #OBJS += wmc_regmgr.o wm_driver.o
 #OBJS += wm_hashtable.o
 #OBJS += wm_network_common.o
 #OBJS += wm_regmgr_ops.o
 #OBJS += wm_regmgr_static.o
 
 Granted these are commented out but they will build a loadable lkm if i
 un-comment the obj lines. What i would really like is just to be able to
 drop new sources into my build directory and have the makefile pick them up
 and build them auto-magically, something like this:
 
 OBJS = $(patsubst %.c,%.o,$(wildcard $(PWD)/*.c))

What you fail to realise is that current directory is the root
of the kernel source when you build your module.

Try something like this:

OBJS := $(patsubst %.c, %.o,$(notdir $(wildcard $(src)/*.c)))

$(wildcard $(src)/*.c) will find all .c files in the directory where you module 
reside
$(notdir ...) remove the path component.

Try to look at the resulting OBJS like this:

$(warning OBJS=$(OBJS))

Note - I used := above. I always avoid using = unless strictly required.

Sam

--
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] kbuild mailing list has moved

2007-10-18 Thread Sam Ravnborg
The vger postmasters has created linux-kbuild on my request.

The old list at sourceforge had a few issues:
- it was subscriber-only
- it were relying on moderation

And I could see several mails did not get to the list lately
so I decided this was a good time for a new list.

I already requested marc.info to archieve the new list -
and I dunno where else the old list was archieved but we
ought to update.

I have no access to the list of subscribers on the old list
so people will have to subscribe manually.

How to subscribe:

send a mail to: [EMAIL PROTECTED]
containing following text:
subscribe linux-kbuild

See also http://vger.kernel.org/vger-lists.html

Below is a patch to update MAINTAINERS in the kernel.
Note that I expect the list to cover both pure kbuild
but also kconfig stuff.

Sam

diff --git a/MAINTAINERS b/MAINTAINERS
index 10deabe..f978c60 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2178,7 +2178,7 @@ S:Maintained
 KCONFIG
 P: Roman Zippel
 M: [EMAIL PROTECTED]
-L: kbuild-devel@lists.sourceforge.net
+L: [EMAIL PROTECTED]
 S: Maintained
 
 KDUMP
@@ -2207,6 +2207,7 @@ KERNEL BUILD (kbuild: Makefile, scripts/Makefile.*)
 P: Sam Ravnborg
 M: [EMAIL PROTECTED]
 T: git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git
+L: [EMAIL PROTECTED]
 S: Maintained
 
 KERNEL JANITORS

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] kbuild mailing list has moved

2007-10-18 Thread Sam Ravnborg
On Thu, Oct 18, 2007 at 12:19:09PM +0200, Giacomo A. Catenazzi wrote:
 [added the owner of the old list]

Thanks. I forgot initially and forwarded this message to mec.
But the address I had were different.

Sam

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [patch] modpost problem when symbols move from one module to another

2007-10-18 Thread Sam Ravnborg
On Thu, Oct 11, 2007 at 04:40:10PM -0700, Trent Piepho wrote:
 The v4l-dvb tree recently renamed a module and this caused some problems
 with modpost creating incorrect module dependencies.  This patch fixes that
 problem.  It should be explained thoroughly in the patch description.
 modpost: Fix problem with out of date Module.symvers
 
 When part of build an external module tree, modpost first reads in the
 kernel's and then the external tree's Module.symvers files.  From these files
 it establishes a symbol = module mapping.  When it later reads in each module
 built and processes the symbols it finds, it discovers the symbol=module
 mapping from Module.symvers and leaves it as it is.
 
 The problem comes with a module has been re-named or a symbol has moved from
 one module to another, since the Module.symvers file was generated.  modpost
 does not update the symbol=module mapping when it finds the new location of
 the symbol when scanning the newly built modules.  This results in the module
 containing incorrect dependency information and the new Module.symvers file
 written by modpost will also contain the incorrect mappings, perpetuating the
 problem to the next build, and so on.
 
 When building the out of kernel development tree for kernel subsystem, like
 v4l-dvb or ALSA, deleting the external Module.symvers file before building
 (which the kernel build system doesn't do and shouldn't be necessary anyway),
 won't fix the problem.  modpost still reads the kernel's Module.symvers, and
 since we a building a kernel subsystem, it will define the same symbols as the
 external modules.
 
 Signed-off-by: Trent Piepho [EMAIL PROTECTED]

Thanks - applied,

Sam

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [RFT] kbuild: check asm symlink when building a kernel

2007-10-17 Thread Sam Ravnborg
We often hit the situation where the asm symlink
in include/ points to the wrong architecture.
In 9 out of 10 cases thats because we forgot to set
ARCH but sometimes we just reused the same tree
for another ARCH. For the merged x86 tree we need
to create a new symlink but this is not obvious.
So with the following patch we check if the symlink
points to the correct architecture and error
out if this is not the case.

For x86 a rm include/asm is enough but we
recommend make mrproper for the general case.

The patch survives my testing but before pushing
it to -mm or -linus I would like a few more to
test it in their environment.
I am a bit unsafe with the use of readlink and cut since
they are not widely used by the kernel
build today.

Any feedback good/bad appreciated!

PS - I know that the lines are too long in the patch but
 breaking them would hurt readability.

Sam

diff --git a/Makefile b/Makefile
index ed65de7..136d7c2 100644
--- a/Makefile
+++ b/Makefile
@@ -903,14 +903,24 @@ prepare: prepare0
 
 export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
 
-# FIXME: The asm symlink changes when $(ARCH) changes. That's
-# hard to detect, but I suppose make mrproper is a good idea
-# before switching between archs anyway.
-
-include/asm:
-   @echo '  SYMLINK $@ - include/asm-$(SRCARCH)'
-   $(Q)if [ ! -d include ]; then mkdir -p include; fi;
-   @ln -fsn asm-$(SRCARCH) $@
+# The asm symlink changes when $(ARCH) changes.
+# Detect this and ask user to run make mrproper
+
+include/asm: FORCE
+   $(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`;   \
+   if [ -L include/asm ]; then \
+   if [ $$asmlink != $(SRCARCH) ]; then\
+   echo ERROR: the symlink $@ points to asm-$$asmlink but 
asm-$(SRCARCH) was expected; \
+   echosave .config and run 'make mrproper' to 
fix it; \
+   exit 1; \
+   fi; \
+   else\
+   echo '  SYMLINK $@ - include/asm-$(SRCARCH)';  \
+   if [ ! -d include ]; then   \
+   mkdir -p include;   \
+   fi; \
+   ln -fsn asm-$(SRCARCH) $@;  \
+   fi
 
 # Generate some files
 # ---

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [GIT PULL (updated)] kbuild updates

2007-10-16 Thread Sam Ravnborg
On Tue, Oct 16, 2007 at 11:11:01PM +0200, Markus Trippelsdorf wrote:
 Bisecting shows that:
 
 commit f77bf01425b11947eeb3b5b54685212c302741b8
   Author: Sam Ravnborg [EMAIL PROTECTED](none)
   Date:   Mon Oct 15 22:25:06 2007 +0200
 
 kbuild: introduce ccflags-y, asflags-y and ldflags-y
 
 breaks booting with grub here. Grub stops with error 28: 
 Selected item cannot fit into memory.
 
 Reverting the commit fixes the problem.
Thanks for this excellent report!
Following patch fixes the issue.
The target specific assignmnet used in x86/boot fooled kbuild.
I have audited the kernel for similar uses and found no
other places this was used.

Linus please pull the fix below from:

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

Sam

diff --git a/Documentation/kbuild/makefiles.txt 
b/Documentation/kbuild/makefiles.txt
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index d6ed8e5..e8756e5 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -64,10 +64,10 @@ KBUILD_CFLAGS   := $(LINUXINCLUDE) -g -Os -D_SETUP 
-D__KERNEL__ \
 KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
 
 $(obj)/zImage:  IMAGE_OFFSET := 0x1000
-$(obj)/zImage:  EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK)
+$(obj)/zImage:  asflags-y := $(SVGA_MODE) $(RAMDISK)
 $(obj)/bzImage: IMAGE_OFFSET := 0x10
-$(obj)/bzImage: EXTRA_CFLAGS := -D__BIG_KERNEL__
-$(obj)/bzImage: EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
+$(obj)/bzImage: ccflags-y := -D__BIG_KERNEL__
+$(obj)/bzImage: asflags-y := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
 $(obj)/bzImage: BUILDFLAGS   := -b
 
 quiet_cmd_image = BUILD   $@

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [PATCH v2] kbuild: save ARCH CROSS_COMPILE when building a kernel

2007-10-12 Thread Sam Ravnborg
On Tue, Oct 09, 2007 at 09:49:19PM +0200, Sam Ravnborg wrote:
 When building a kernel for a different architecture
 kbuild requires the user always to specify ARCH and
 CROSS_COMPILE on the command-line.
 Failing to do so can result in strange build errros especially
 when the asm symlink point to anohter architecture than
 the one being build.
 The typical case is that the user forget to specify
 ARCH and/or CROSS_COMPILE on the commandline.
 
 Address the above issues by saving ARCH and CROSS_COMPILE
 when building a kernel. The information is saved in a
 file named .kbuild which is not supposed to be manually
 edited and kbuild will overwrite it when a kernel is build.
 
 If a kernel is build and no ARCH/CROSS_COMPILE info is saved
 then the current settings are saved.
 If ARCH/CROSS_COMPILE was saved then these value are used.
 If the user specified either ARCH and/or CROSS_COMPILE
 it is validated that they match the saved values and kbuild
 error out if this is not the case.

There quickly turned up two issues which this patch when
hitting -mm.
Issue 1) Adding the ARCH ?= caused all native builds
to loose their ARCH setting. I only tested this with
my suite of crosscompilers and not native.

Issue 2) When installing the kernel in a different
environment than where is was compiled turned up that
we even for a modules_install or headers_install call
gcc - and with CROSS_COMPILE set the gcc could not be
located and we printed an error message.

The latter issue require some more involved refactoring
of the top-level Makefile and is thus not ready until next
merge window.
The patch will be withdrawn for now and I hope to have
the top-level Makefile refactored until next merge window.

The prime reason for the refactoring is to remove the top-
level Makefile from the 3xun list.
3xun = Unreadable, unhackable, unmaintainable

Introducing said patch afterwoard is just a nice bonus.

Sam

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [RFC/RFT] kbuild: save ARCH CROSS_COMPILE

2007-10-09 Thread Sam Ravnborg
On Mon, Oct 08, 2007 at 11:12:56PM +0200, Adrian Bunk wrote:
 On Mon, Oct 08, 2007 at 10:02:55PM +0200, Sam Ravnborg wrote:
 ...
  The settings are stored in the build directory in a file
  named Kbuild.config (should it be a .dot file?).
 ...
 
 A .dot file sounds better.
I will make it .kbuild.
Droppeing the .config bits of the name will hopefully avoid that
people mess with it manually.

 BTW: I'm currently trying without success to understand why the
  drivers/infiniband/{hw/amso1100,ulp/srp}/Kbuild files are not
  named Makefile.
Giacomo explained this already..
But I have never done a global renaming - the
pain/benefit ratio seems too low.

Sam

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [RFC/RFT] kbuild: save ARCH CROSS_COMPILE

2007-10-09 Thread Sam Ravnborg
On Tue, Oct 09, 2007 at 10:09:06AM -0400, Jeff Dike wrote:
 On Tue, Oct 09, 2007 at 12:00:30PM +0200, Sam Ravnborg wrote:
  If it is OK to drop the $(SUBARCH) assingment like this then yes.
  ARCH?=
  CROSS_COMPILE   ?=
 
 Does the UML build still work when you do that?

The original behaviour is kept is ARCH is not set on the
commandline and saved in .kbuild (Kbuild.config in the patch).

The logic goes basically like this:
If there is no .kbuild file then set ARCH = $(SUBARCH)
else set ARCH = saved ARCH from .kbuild.

And then a bit sanity check that the user does not
try to change architecture in the middle.

I actually used um as testing ground for this patch so
it works for um in my way of building um.

I considered switching architectures automagically
but concluded that in most cases when a user change ARCH
then that's because the user forgot to specify ARCH or more
seldom forgot what ARCH was being built in that directory.

Sam

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH v2] kbuild: save ARCH CROSS_COMPILE when building a kernel

2007-10-09 Thread Sam Ravnborg
When building a kernel for a different architecture
kbuild requires the user always to specify ARCH and
CROSS_COMPILE on the command-line.
Failing to do so can result in strange build errros especially
when the asm symlink point to anohter architecture than
the one being build.
The typical case is that the user forget to specify
ARCH and/or CROSS_COMPILE on the commandline.

Address the above issues by saving ARCH and CROSS_COMPILE
when building a kernel. The information is saved in a
file named .kbuild which is not supposed to be manually
edited and kbuild will overwrite it when a kernel is build.

If a kernel is build and no ARCH/CROSS_COMPILE info is saved
then the current settings are saved.
If ARCH/CROSS_COMPILE was saved then these value are used.
If the user specified either ARCH and/or CROSS_COMPILE
it is validated that they match the saved values and kbuild
error out if this is not the case.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
This addressed the comments from Adrian and Andi.
The file is now named .kbuild.
And the dummy assignmnets are preserved (and commented).

I plan to sneak this patch into the merge window if there
are no complains - despite that I have not tested this in -mm.

diff --git a/Makefile b/Makefile
index 9d06120..6e930ef 100644
--- a/Makefile
+++ b/Makefile
@@ -189,9 +189,39 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e 
s/sun4u/sparc64/ \
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 
-ARCH   ?= $(SUBARCH)
+# The empty ARCH and CROSS_COMPILE statements exist so it is easy to
+# patch in hardcoded values for ARCH and CROSS_COMPILE
+ARCH   ?=
 CROSS_COMPILE  ?=
 
+# Kbuild save the ARCH and CROSS_COMPILE setting in .kbuild
+# Restore these settings and check that user did not specify
+# conflicting values.
+.kbuild: ;
+noconfigcheck-targets := clean mrproper distclean help %config
+
+ifneq ($(wildcard .kbuild),)
+-include .kbuild
+ifeq ($(filter $(noconfigcheck-targets),$(MAKECMDGOALS)),)
+ifneq ($(CROSS_COMPILE),)
+ifneq ($(CROSS_COMPILE),$(KBUILD_CROSS_COMPILE))
+$(error CROSS_COMPILE changed from 
$(KBUILD_CROSS_COMPILE) \
+to $(CROSS_COMPILE). Use make 
mrproper to fix it up)
+endif
+endif
+ifneq ($(ARCH),)
+ifneq ($(KBUILD_ARCH),$(ARCH))
+$(error ARCH changed from $(KBUILD_ARCH) \
+to $(ARCH). Use make mrproper to 
fix it up)
+endif
+endif   
+endif
+CROSS_COMPILE := $(KBUILD_CROSS_COMPILE)
+ARCH := $(KBUILD_ARCH)
+else
+ARCH ?= $(SUBARCH)
+endif
+
 # Architecture as present in compile.h
 UTS_MACHINE := $(ARCH)
 
@@ -358,6 +388,12 @@ scripts_basic:
 # To avoid any implicit rule to kick in, define an empty command.
 scripts/basic/%: scripts_basic ;
 
+# Save CROSS_COMPILE and ARCH for subsequent make invocations
+PHONY += dotkbuild
+dotkbuild:
+   $(Q)echo KBUILD_ARCH := $(ARCH) .kbuild
+   $(Q)echo KBUILD_CROSS_COMPILE := $(CROSS_COMPILE)  .kbuild
+
 PHONY += outputmakefile
 # outputmakefile generates a Makefile in the output directory, if using a
 # separate output directory. This allows convenient use of make in the
@@ -420,7 +456,7 @@ ifeq ($(config-targets),1)
 include $(srctree)/arch/$(ARCH)/Makefile
 export KBUILD_DEFCONFIG
 
-config %config: scripts_basic outputmakefile FORCE
+config %config: scripts_basic outputmakefile dotkbuild FORCE
$(Q)mkdir -p include/linux include/config
$(Q)$(MAKE) $(build)=scripts/kconfig $@
 
@@ -866,7 +902,10 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 
prepare3
 # and if so do:
 # 1) Check that make has not been executed in the kernel src $(srctree)
 # 2) Create the include2 directory, used for the second asm symlink
-prepare3: include/config/kernel.release
+prepare3: include/config/kernel.release dotkbuild
+ifneq ($(KBUILD_CROSS_COMPILE)$(KBUILD_ARCH),)
+   $(Q)echo '  Using ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)'
+endif
 ifneq ($(KBUILD_SRC),)
@echo '  Using $(srctree) as source for kernel'
$(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
@@ -932,10 +971,10 @@ define filechk_version.h
echo '#define KERNEL_VERSION(a,b,c) (((a)  16) + ((b)  8) + (c))';)
 endef
 
-include/linux/version.h: $(srctree)/Makefile FORCE
+include/linux/version.h: $(srctree)/Makefile prepare2 FORCE
$(call filechk,version.h)
 
-include/linux/utsrelease.h: include/config/kernel.release FORCE
+include/linux/utsrelease.h: include/config/kernel.release prepare2 FORCE
$(call filechk,utsrelease.h

[kbuild-devel] [RFC/RFT] kbuild: save ARCH CROSS_COMPILE

2007-10-08 Thread Sam Ravnborg
One of the complaints that I continue to hear is that kbuild
is lacking a way to 'remember' the ARCH and CROSS_COMPILE
values originally used.
Likewise we have people that change ARCH settings and get
a lot of build errors due to asm symlink pointing at the
wrong directory.

This patch tries to address this by saving ARCH and
CROSS_COMPILE settings and error out if user specify
anohter ARCH or CROSS_COMPILE setting.
If there is inconsistency then error out and suggest
to run make mrproper.

This will as a side-effect prevent a build with the wrong
asm symlink.

The settings are stored in the build directory in a file
named Kbuild.config (should it be a .dot file?).

I have tested it here with success - but please give
it a try in your setup and let me know if anything breaks.

The patch is on top of latest linus tree but should apply
with some fuzz to -mm too (at least it apply on top of 
my kbuild.git tree).

PS. I do not like adding additional cruft to the top-level
Makefile but did not find an easy way to push this to
kconfig.

Sam

diff --git a/Makefile b/Makefile
index 6fc97bf..9f6d03f 100644
--- a/Makefile
+++ b/Makefile
@@ -182,8 +182,33 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e 
s/sun4u/sparc64/ \
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 
-ARCH   ?= $(SUBARCH)
-CROSS_COMPILE  ?=
+# Kbuild save the ARCH and CROSS_COMPILE setting in Kbuild.config
+# Restore these settings and check that user did not specify
+# conflicting values.
+Kbuild.config: ;
+noconfigcheck-targets := clean mrproper distclean help %config
+
+ifneq ($(wildcard Kbuild.config),)
+-include Kbuild.config
+ifeq ($(filter $(noconfigcheck-targets),$(MAKECMDGOALS)),)
+ifneq ($(CROSS_COMPILE),)
+ifneq ($(CROSS_COMPILE),$(KBUILD_CROSS_COMPILE))
+$(error CROSS_COMPILE changed from 
$(KBUILD_CROSS_COMPILE) \
+to $(CROSS_COMPILE). Use make 
mrproper to fix it up)
+endif
+endif
+ifneq ($(ARCH),)
+ifneq ($(KBUILD_ARCH),$(ARCH))
+$(error ARCH changed from $(KBUILD_ARCH) \
+to $(ARCH). Use make mrproper to 
fix it up)
+endif
+endif   
+endif
+CROSS_COMPILE := $(KBUILD_CROSS_COMPILE)
+ARCH := $(KBUILD_ARCH)
+else
+ARCH ?= $(SUBARCH)
+endif
 
 # Architecture as present in compile.h
 UTS_MACHINE := $(ARCH)
@@ -351,6 +376,12 @@ scripts_basic:
 # To avoid any implicit rule to kick in, define an empty command.
 scripts/basic/%: scripts_basic ;
 
+# Save CROSS_COMPILE and ARCH for subsequent make invocations
+PHONY += Kbuild.config.save
+Kbuild.config.save:
+   $(Q)echo KBUILD_ARCH := $(ARCH) Kbuild.config
+   $(Q)echo KBUILD_CROSS_COMPILE := $(CROSS_COMPILE)  Kbuild.config
+
 PHONY += outputmakefile
 # outputmakefile generates a Makefile in the output directory, if using a
 # separate output directory. This allows convenient use of make in the
@@ -413,7 +444,7 @@ ifeq ($(config-targets),1)
 include $(srctree)/arch/$(ARCH)/Makefile
 export KBUILD_DEFCONFIG
 
-config %config: scripts_basic outputmakefile FORCE
+config %config: scripts_basic outputmakefile Kbuild.config.save FORCE
$(Q)mkdir -p include/linux include/config
$(Q)$(MAKE) $(build)=scripts/kconfig $@
 
@@ -853,7 +884,10 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 
prepare3
 # and if so do:
 # 1) Check that make has not been executed in the kernel src $(srctree)
 # 2) Create the include2 directory, used for the second asm symlink
-prepare3: include/config/kernel.release
+prepare3: include/config/kernel.release Kbuild.config.save
+ifneq ($(KBUILD_CROSS_COMPILE)$(KBUILD_ARCH),)
+   $(Q)echo '  Using ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)'
+endif
 ifneq ($(KBUILD_SRC),)
@echo '  Using $(srctree) as source for kernel'
$(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
@@ -919,10 +953,10 @@ define filechk_version.h
echo '#define KERNEL_VERSION(a,b,c) (((a)  16) + ((b)  8) + (c))';)
 endef
 
-include/linux/version.h: $(srctree)/Makefile FORCE
+include/linux/version.h: $(srctree)/Makefile prepare2 FORCE
$(call filechk,version.h)
 
-include/linux/utsrelease.h: include/config/kernel.release FORCE
+include/linux/utsrelease.h: include/config/kernel.release prepare2 FORCE
$(call filechk,utsrelease.h)
 
 # ---
@@ -1050,7 +1084,7 @@ CLEAN_FILES +=vmlinux System.map \
 MRPROPER_DIRS  += include/config include2 usr/include
 MRPROPER_FILES += .config .config.old include/asm .version .old_version \
   

Re: [kbuild-devel] [RFC/RFT] kbuild: save ARCH CROSS_COMPILE

2007-10-08 Thread Sam Ravnborg
 
 What about, that this is the first ever prompt, that must be shown and
 written to the .config?
Two issues to fix before we can do this:
1) chocie values cannot have more than one prompt
2) We need to share much more Kconfig* between the individual architectures
   First step is to let all arch's use drivers/Kconfig

Let's get the two items above solved then we can revisit adding arch selection
to kconfig (where it belongs in the end).
And neither require a rewrite of kconfig...

 Also, i'd like to propose sequencing of config-enable-build-this-unit
 in config file(s), thus Makefile(s) (sometimes very small and stupid)
 will be not necessary. Additional link ordering can be supplied as
 meta-config information there. Shell scripting, very ugly in the view
 of make syntax, will be natural in config files. Extending build
 process to get hidden dependencies or right linking/other magic is
 part of particular configuration. Hm?
Discussed before but so far no patches has shown up.

Sam

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [RFC/RFT] kbuild: save ARCH CROSS_COMPILE

2007-10-08 Thread Sam Ravnborg
  2) We need to share much more Kconfig* between the individual architectures
 First step is to let all arch's use drivers/Kconfig
 
 2) isn't terribly difficult, just takes some time and willingness
 of $arch maintainers to some changes, but please explain a bit more
 why it is needed...?

A prerequisite for moving ARCH selection to Kconfig is that we
read in all Kconfig files for all architectures.
To do so efficient we should avoind including the same Kconfig
file for each architecture which is obviously the case today.

The efficiency comes both with respect to reading the files but
also memory consumption. If we read in drivers/Kconfig only once
then we will avoid some duplication compared to reading drivers/Kconfig
once for each architecture.

The structure we should aim for is something like a top-level
Kconfig file that pull in relevant parts from the kernel tree
and where the arch Kconfig only pull in additional Kconfig files
from that arch.

When we get this far we will have a more logical structure
in the Kconfig file and their distribution.

But the showstopper is the part with choice value that cannot have more
than a single prompt so when we have the same choice value
used in two arch Kconfig files then kconfig will warn and the
choice will do the wrong thing.
I never took a deeper look at this - I seem to get distracted each
time I try to understand all the inner details of the kconfig
use of data structures.

Sam


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH] kbuild: move Kai Germaschewski to CREDITS

2007-10-06 Thread Sam Ravnborg
I have just pushed following patch to kbuild.git.

And with this mail I want to give Kai all the thanks
he deserves for his major kbuild work during the 2.5
kernel series.
He left us a reliable and working kbuild to continue
to use and hack on.

THANKS!

Sam

Subject: [PATCH] kbuild: move Kai Germaschewski to CREDITS

Kai is not active in kernel development these
days so give him credit for his major kbuild
contribution and ISDN work.

Acked-by: Kai Germaschewski [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 CREDITS |6 ++
 MAINTAINERS |4 
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/CREDITS b/CREDITS
index 832436e..a305f0b 100644
--- a/CREDITS
+++ b/CREDITS
@@ -1149,6 +1149,12 @@ S: 600 North Bell Avenue, Suite 160
 S: Carnegie, Pennsylvania 15106-4304
 S: USA
 
+N: Kai Germaschewski
+E: [EMAIL PROTECTED]
+D: Major kbuild rework during the 2.5 cycle
+D: ISDN Maintainer
+S: USA
+
 N: Philip Gladstone
 E: [EMAIL PROTECTED]
 D: Kernel / timekeeping stuff
diff --git a/MAINTAINERS b/MAINTAINERS
index 9c54a5e..d09102b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2110,8 +2110,6 @@ S:Maintained
 ISDN SUBSYSTEM
 P: Karsten Keil
 M: [EMAIL PROTECTED]
-P: Kai Germaschewski
-M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 W: http://www.isdn4linux.de
 T: git kernel.org:/pub/scm/linux/kernel/kkeil/isdn-2.6.git
@@ -2180,8 +2178,6 @@ L:[EMAIL PROTECTED]
 S: Maintained
 
 KERNEL BUILD (kbuild: Makefile, scripts/Makefile.*)
-P: Kai Germaschewski
-M: [EMAIL PROTECTED]
 P: Sam Ravnborg
 M: [EMAIL PROTECTED]
 T: git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git
-- 
1.5.2.4


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] A bit of kconfig rewrite (Re: [PATCH] 9p: fix compile error if !CONFIG_SYSCTL)

2007-10-01 Thread Sam Ravnborg
Hi Oleg.
 
 Today's kconfig was proposed and accepted in a very unpleasant
 circumstances, has very poor design, development and no working
 alternative (for 5+ years now).

I have read all your mails about this subject - but I still miss what
is so bad about current design.

Could you try to stay down on the earth and be very specific about
what you see as so bad in current design.
With stay down on earth I try to say that what I have read before
I could not dechiper so be specific, please.

Sam

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [RFC] Extending kbuild syntax

2007-09-30 Thread Sam Ravnborg
On Sun, Sep 30, 2007 at 05:02:58AM +0200, Adrian Bunk wrote:
 On Sat, Sep 29, 2007 at 10:11:45PM +0200, Sam Ravnborg wrote:
 ...
  The second is the more controversial suggestion.
  In several Makefile we have simple if expression of the variants:
  if ($(CONFIG_FOO),y)
obj-$(CONFIG_BAR) += fubar.o
  endif
  
  The pattern varies over this theme.
  The suggestion here is to introduce a few helpers:
  
  obj-y-if-$(CONFIG_FOO) += fubar.o
  This one shall read:
  if $(CONFIG_FOO) is y or m then set += to obj-y
 
 IMHO for people who are not kbuild junkies the pattern is more clear 
 with the current syntax.
 
 But you should better ask some guinea pigs who have not already seen as 
 many kernel Makefiles as I have...

Target group are for kernel developers and people who have
actually read Documentation/kbuild/makefiles.txt

But point taken - this is too 'magic'.
I will try to think of something that looks a bit more straightforward.

 Some of the cases have the following pattern:
 
 config X86_POWERNOW_K8_ACPI
 bool
 depends on X86_POWERNOW_K8  ACPI_PROCESSOR
 depends on !(X86_POWERNOW_K8 = y  ACPI_PROCESSOR = m)
 default y
 
 Your suggested syntax has to be enhanced with three additional
 variables for handling such cases.
 
 
 The complicated cases can be handled either in kconfig or in kbuild,
 and I think kconfig is the better place for them:

The kbuild enhancements are for the cases where it
makes less sense to express this in Kconfig.
They are not thought as replacing Kconfig dependencies in any way.

I will try to come up with a new proposal later today.

Sam

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] kbuild update

2007-09-16 Thread Sam Ravnborg
A summary of what is planned to be submitted in next merge window for kbuild.
The shortlog below have additional details but the headlines are:

o Make the kernel buildable on a cygwin box (but not without a few glitches)
o detect unterminated device id list
o add export_report as a valid top-level make target
o add script to find unused kconfig symbols (try it!)
o allow a user to specify additional flags on the commandline with
  CFLAGS, AFLAGS or CPPFLAGS. The flags will be appended to the kernel defiend 
flags

The CFLAGS change will conflict with Andi's x86 patches and I fix it
before pushing if Andi's patches are pushed first.
Otherwise no conflicts.

The vmlinux.lds changes that I have sent to a number of arch maintainers
lately are not included.
I expect them to be applied by the respective arch maintainers.

The --gc-section cleanup from Denys Vlasenko will be included in
kbuild after the merge window so we can try it out in -mm before
hitting mainline.

Jan Beulich kconfig patch will most likely be included.
Need to test it first.

Marej menuconfig improvement may also be included.
Last patch looked good but have not made up my mind if it
really help people.

Patched referred below are available at git.kernel.org at kbuild.git
in an hour or so.

Sam


Adrian Bunk (2):
  kbuild: fix export_report.pl
  kbuild: call export_report from the Makefile

Jesper Juhl (3):
  kbuild: improve scripts/gcc-version.sh output a bit when called without 
args
  kbuild: ver_linux fix glibc version print
  kbuild: scripts/ver_linux : correct printing of binutils version

Kees Cook (1):
  kbuild: make modpost detect unterminated device id lists

Mike Frysinger (1):
  kbuild: clean Modules.symvers in external module dirs

Paolo 'Blaisorblade' Giarrusso (1):
  kbuild: script to check for undefined Kconfig symbols

Petr Stetiar (1):
  kbuild: fix segfault in modpost

Ram Pai (1):
  kbuild: fix perl usage in export_report.pl

Randy Dunlap (1):
  docproc: style  typo cleanups

Sam Ravnborg (10):
  kbuild: Use Elfnn_Half as replacement for Elfnn_Section
  kbuild: check if we can link gettext not just compile
  kbuild: fix genksyms Makefile
  kbuild: __extension__ support in genksyms (fix unknown CRC warning)
  kbuild: apply genksyms changes
  kbuild: enable 'make CFLAGS=...' to add additional options to CC
  kbuild: enable 'make AFLAGS=...' to add additional options to AS
  ia64: fix sn to add include files using EXTRA_CFLAGS
  kbuild: enable 'make CPPFLAGS=...' to add additional options to CPP
  kbuild: fix directory traversal bug

Shlomi Fish (1):
  kconfig: qconf (make xconfig) Search Dialog Enhancement


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Distributed configuration scheme by Linus at. al. (going back in time)

2007-09-16 Thread Sam Ravnborg
Hi Oleg.
On Sun, Sep 16, 2007 at 03:12:48PM +0200, Oleg Verych wrote:
 Hallo, Sam.
 
 Can try to find exact wording/archives of the subject?
 http://www.uwsg.iu.edu/hypermail/linux/kernel/0202.1/2004.html
 
 Also, please describe what it was from your POV that time back.
I'm not sure exactly what you are after here.
Are you asking to the actual kbuild-2.5 versus mainline kbuild story or
are you asking for an opinion on a specific subject?
Your mail subject and the mail content confuses me - I do not see the relation.

Sam

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Distributed configuration scheme by Linus at. al. (going back in time)

2007-09-16 Thread Sam Ravnborg
On Sun, Sep 16, 2007 at 05:40:00PM +0200, Oleg Verych wrote:
 On Sun, Sep 16, 2007 at 05:11:12PM +0200, Sam Ravnborg wrote:
  Hi Oleg.
  On Sun, Sep 16, 2007 at 03:12:48PM +0200, Oleg Verych wrote:
   Hallo, Sam.
   
   Can try to find exact wording/archives of the subject?
   http://www.uwsg.iu.edu/hypermail/linux/kernel/0202.1/2004.html
   
   Also, please describe what it was from your POV that time back.
  I'm not sure exactly what you are after here.
 
 There is your comment about Linus, describing distributed (or whatever)
 kconfig. I'd like to have link to read archives, if you can find it.
 
 []
  are you asking for an opinion on a specific subject?
 
 Yes also. Specific as in the Subject:, please.

CML2 had all config in a single file IIRC.
Kconfig has it distributed all over the tree.

If you need more please elaborate a bit more.

Thanks,
Sam

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [patch 01/03] kbuild, asm-values: infrastructure

2007-09-16 Thread Sam Ravnborg
Hi Oleg.

On Wed, Jun 13, 2007 at 01:36:51AM +0200, Oleg Verych wrote:
   * header with widely used value definitions
   * handle all asm-related things in one file (Makefile.asm)
   * move some asm bits from Makefile.build there
 (rule %.s:%.c)
   * add script to generate headers from assembles output
 (hopefully better output, MIPS testing/joining to all arch
  probably needed)
 

Took a look at this patch at last.
Your patch moves everything to Makefile.asm and uses a script
to generate the offset file.

Now where we go the step to use a script to generate the offset file
a much simpler approach would be to move both steps to the shell script.
So the script are called with the input file as one of the
arguments and it spits out the resulting file to stdout.

Doing it this way would allow the caller to have full control
on the filenames and the current call-site in top-level Kbuild
would still be much simpler than today.

Moving the bits from Makefile.build that is only used for asm-offset is
a nice cleanup and this should the script version support too.

I see no value in renaming from asm_offset to asm_value - please drop it.
Introducing the generic asm-values.h should wait and when you do
you should be preapred to update all architectures (ecasue otherwise it
will not happen).

Sorry for the late feedback.

Sam

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Rename asm-offsets tool or not? (Re: [patch 01/03] kbuild, asm-values: infrastructure)

2007-09-16 Thread Sam Ravnborg
On Sun, Sep 16, 2007 at 09:32:58PM +0200, Oleg Verych wrote:
 On Sun, Sep 16, 2007 at 08:29:12PM +0200, Sam Ravnborg wrote:
  Hi Oleg.
 
 Hallo. Nice, you are bringing it back. I'll try to have LKML-like
 output this time, not a makefile mess and stuff:
 
 []
  I see no value in renaming from asm_offset to asm_value - please drop it.
  Introducing the generic asm-values.h should wait and when you do
  you should be preapred to update all architectures (ecasue otherwise it
  will not happen).
 
 All archs, are using same syntax. But.
 
 Interesting exception is MIPS, where tokens are organized and implemented
 more nicely, that is where *asm-values* name coming from, actually. One
 can see all that text, size, constant tokens in addition to just offsets.
 
 So, if name change isn't worth, then OK; filename compatibility check, as
 one in `linux/Kbuild', is easy to hack as well to remove.
 
 But nice feature/tool with meaningful name and functionality is just
 another thing.
 
 Opinions?
Everyone and their cousin these days knows that asm-offset is constants
generated from C and used in assembler.
If we benefit from more values in the asm-offset file - let's do it.
But there is no reason to change a name that has been used for this purpose
for as long as I can remember.

Sam

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [RFC] kbuild - introduce vdir to make life easier for x86_64

2007-09-11 Thread Sam Ravnborg
On Tue, Sep 11, 2007 at 12:40:41AM +0200, Andi Kleen wrote:
 
  The below are the minimal clean-up - a bit more could be done.
  
  Comments?
 
 Looks good in principle. My only suggestion would be to name it something
 differently than vdir. I know that's what GNU make calls it, but it's still
 pretty cryptic. How about just fallback-dir ? 
 
 Also what would be nice (I don't know if it's doable in make) would
 be a separate variable (e.g. other-obj-... := ) that contains the fallback
 names and that is double checked against the fallback directory. That
 would document it clearly what's going on. Failing that stuffing 
 them into a comment would be good at least.

I did not like the vdir hack for a couple of reasons as partly outline by Andi.
So starting to wonder why the obvious did not work.

For mm/Makefile I wanted to do:

diff --git a/arch/x86_64/mm/Makefile b/arch/x86_64/mm/Makefile
index d25ac86..6f4addf 100644
--- a/arch/x86_64/mm/Makefile
+++ b/arch/x86_64/mm/Makefile
@@ -1,11 +1,10 @@
 #
 # Makefile for the linux x86_64-specific parts of the memory manager.
 #
+i386 := ../../../arch/i386/mm
 
 obj-y   := init.o fault.o ioremap.o extable.o pageattr.o mmap.o
-obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
+obj-$(CONFIG_HUGETLB_PAGE) += $(i386)/hugetlbpage.o
 obj-$(CONFIG_NUMA) += numa.o
 obj-$(CONFIG_K8_NUMA) += k8topology.o
 obj-$(CONFIG_ACPI_NUMA) += srat.o
-
-hugetlbpage-y = ../../i386/mm/hugetlbpage.o

And after wondering a bit I came up with following fix for kbuild:
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index fc498fe..ff03b15 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -46,7 +46,7 @@ multi-objs   := $(multi-objs-y) $(multi-objs-m)
 
 # $(subdir-obj-y) is the list of objects in $(obj-y) which do not live
 # in the local directory
-subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir 
$(o))),$(o)))
+subdir-obj-y := $(filter %/built-in.o, $(obj-y))
 
 # $(obj-dirs) is a list of directories that contain object files
 obj-dirs := $(dir $(multi-objs) $(subdir-obj-y))

subdir-obj-y listed all targets in another dir than current dir
but only needed to list built-in.o targets.

So after fixig this long standing bug in kbuild I could do the attached
cleanup of current x86_64 Makefiles.

I will push the kbuild fix in next merge window but due to the ongoing
merge talk I dunno about the x86_64 patch.
Anyway the kbuild fix needs to be pushed first.

Sam

 arch/x86_64/kernel/Makefile |   37 +++-
 arch/x86_64/kernel/acpi/Makefile|   12 ---
 arch/x86_64/kernel/cpufreq/Makefile |   18 +
 arch/x86_64/mm/Makefile |5 +---
 arch/x86_64/pci/Makefile|   24 ++-
 scripts/Makefile.lib|2 -
 6 files changed, 33 insertions(+), 65 deletions(-)

diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index ff5d8c9..ac27cc4 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -1,25 +1,26 @@
 #
 # Makefile for the linux kernel.
 #
+i386 := ../../../arch/i386/kernel
 
 extra-y:= head.o head64.o init_task.o vmlinux.lds
 EXTRA_AFLAGS   := -traditional
 obj-y  := process.o signal.o entry.o traps.o irq.o \
ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
x8664_ksyms.o i387.o syscall.o vsyscall.o \
-   setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
-   pci-dma.o pci-nommu.o alternative.o hpet.o tsc.o bugs.o \
-   perfctr-watchdog.o
+   setup64.o $(i386)/bootflag.o e820.o reboot.o $(i386)/quirks.o 
$(i386)/i8237.o \
+   pci-dma.o pci-nommu.o $(i386)/alternative.o hpet.o tsc.o bugs.o 
\
+   $(i386)/cpu/perfctr-watchdog.o
 
 obj-$(CONFIG_STACKTRACE)   += stacktrace.o
-obj-$(CONFIG_X86_MCE)  += mce.o therm_throt.o
+obj-$(CONFIG_X86_MCE)  += mce.o $(i386)/cpu/mcheck/therm_throt.o
 obj-$(CONFIG_X86_MCE_INTEL)+= mce_intel.o
 obj-$(CONFIG_X86_MCE_AMD)  += mce_amd.o
 obj-$(CONFIG_MTRR) += ../../i386/kernel/cpu/mtrr/
 obj-$(CONFIG_ACPI) += acpi/
-obj-$(CONFIG_X86_MSR)  += msr.o
-obj-$(CONFIG_MICROCODE)+= microcode.o
-obj-$(CONFIG_X86_CPUID)+= cpuid.o
+obj-$(CONFIG_X86_MSR)  += $(i386)/msr.o
+obj-$(CONFIG_MICROCODE)+= $(i386)/microcode.o
+obj-$(CONFIG_X86_CPUID)+= $(i386)/cpuid.o
 obj-$(CONFIG_SMP)  += smp.o smpboot.o trampoline.o tsc_sync.o
 obj-y  += apic.o  nmi.o
 obj-y  += io_apic.o mpparse.o genapic.o genapic_flat.o
@@ -41,23 +42,9 @@ obj-$(CONFIG_AUDIT)  += audit.o
 obj-$(CONFIG_MODULES)  += module.o
 obj-$(CONFIG_PCI)  += early-quirks.o
 
-obj-y  += topology.o
-obj-y  += intel_cacheinfo.o
-obj-y

[kbuild-devel] [RFC] kbuild - introduce vdir to make life easier for x86_64

2007-09-10 Thread Sam Ravnborg
Hi Andi  Thomas.

One of the complaints raised about the current x86_64
Makfiles are the ugliness needed to reuse code from i386.
Andi asked me if we could do something in kbuild to make
this less ugly and below are the hack I could come up with.

The trick is that in the Makefile we tell kbuild what directory
to search for source files should we fail to locate them in
current directory. This is done by an assingment to the variable
named 'vdir' - a counterpart to make's vpath but it takes only a single
directory and not a list.

In Makefile.build I added an additional rule (see last part of the patch)
that tell kbuild that it may find the sourcefile in vdir if not
present in current dir.
This allowed me to delete some cruft from the current x86_64 makefiles.

The below are the minimal clean-up - a bit more could be done.

Comments?

This is obviously only a RFC patch - I have not even bothered to update
the documentation to describe vdir...

Sam

 arch/x86_64/kernel/Makefile |   11 +--
 arch/x86_64/mm/Makefile |3 +--
 arch/x86_64/pci/Makefile|   12 +---
 scripts/Makefile.build  |4 
 4 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index ff5d8c9..fe58ac6 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -1,7 +1,7 @@
 #
 # Makefile for the linux kernel.
 #
-
+vdir := arch/i386/kernel
 extra-y:= head.o head64.o init_task.o vmlinux.lds
 EXTRA_AFLAGS   := -traditional
 obj-y  := process.o signal.o entry.o traps.o irq.o \
@@ -49,15 +49,6 @@ obj-y+= pcspeaker.o
 CFLAGS_vsyscall.o  := $(PROFILING) -g0
 
 therm_throt-y   += ../../i386/kernel/cpu/mcheck/therm_throt.o
-bootflag-y += ../../i386/kernel/bootflag.o
-cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../i386/kernel/cpuid.o
-topology-y += ../../i386/kernel/topology.o
-microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../i386/kernel/microcode.o
 intel_cacheinfo-y  += ../../i386/kernel/cpu/intel_cacheinfo.o
 addon_cpuid_features-y += ../../i386/kernel/cpu/addon_cpuid_features.o
-quirks-y   += ../../i386/kernel/quirks.o
-i8237-y+= ../../i386/kernel/i8237.o
-msr-$(subst m,y,$(CONFIG_X86_MSR))  += ../../i386/kernel/msr.o
-alternative-y  += ../../i386/kernel/alternative.o
-pcspeaker-y+= ../../i386/kernel/pcspeaker.o
 perfctr-watchdog-y += ../../i386/kernel/cpu/perfctr-watchdog.o
diff --git a/arch/x86_64/mm/Makefile b/arch/x86_64/mm/Makefile
index d25ac86..3d61425 100644
--- a/arch/x86_64/mm/Makefile
+++ b/arch/x86_64/mm/Makefile
@@ -1,11 +1,10 @@
 #
 # Makefile for the linux x86_64-specific parts of the memory manager.
 #
+vdir := arch/i386/mm
 
 obj-y   := init.o fault.o ioremap.o extable.o pageattr.o mmap.o
 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
 obj-$(CONFIG_NUMA) += numa.o
 obj-$(CONFIG_K8_NUMA) += k8topology.o
 obj-$(CONFIG_ACPI_NUMA) += srat.o
-
-hugetlbpage-y = ../../i386/mm/hugetlbpage.o
diff --git a/arch/x86_64/pci/Makefile b/arch/x86_64/pci/Makefile
index c9eddc8..84247e6 100644
--- a/arch/x86_64/pci/Makefile
+++ b/arch/x86_64/pci/Makefile
@@ -3,6 +3,7 @@
 #
 # Reuse the i386 PCI subsystem
 #
+vdir := arch/i386/pci
 EXTRA_CFLAGS += -Iarch/i386/pci
 
 obj-y  := i386.o
@@ -14,14 +15,3 @@ obj-y+= legacy.o irq.o common.o 
early.o
 obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o mmconfig-shared.o
 
 obj-$(CONFIG_NUMA) += k8-bus.o
-
-direct-y += ../../i386/pci/direct.o
-acpi-y   += ../../i386/pci/acpi.o
-legacy-y += ../../i386/pci/legacy.o
-irq-y+= ../../i386/pci/irq.o
-common-y += ../../i386/pci/common.o
-fixup-y  += ../../i386/pci/fixup.o
-i386-y  += ../../i386/pci/i386.o
-init-y += ../../i386/pci/init.o
-early-y += ../../i386/pci/early.o
-mmconfig-shared-y += ../../i386/pci/mmconfig-shared.o
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 7fd6055..e979833 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -218,6 +218,10 @@ $(obj)/%.o: $(src)/%.c FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)
 
+$(obj)/%.o: $(vdir)/%.c FORCE
+   $(call cmd,force_checksrc)
+   $(call if_changed_rule,cc_o_c)
+
 # Single-part modules are special since we need to mark them in $(MODVERDIR)
 
 $(single-used-m): $(obj)/%.o: $(src)/%.c FORCE

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 2/4] kbuild: enable 'make AFLAGS=...' to add additional options to AS

2007-09-09 Thread Sam Ravnborg
The variable AFLAGS is a wellknown variable and the usage by
kbuild may result in unexpected behaviour.
On top of that several people over time has asked for a way to
pass in additional flags to gcc.

This patch replace use of AFLAGS with KBUILD_AFLAGS all over the
tree and enabling one to use:
make AFLAGS=...
to specify additional gcc (as) commandline options.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 Documentation/kbuild/makefiles.txt |5 +++--
 Makefile   |9 +
 arch/arm/Makefile  |2 +-
 arch/arm/vfp/Makefile  |2 +-
 arch/avr32/Makefile|4 ++--
 arch/blackfin/Makefile |2 +-
 arch/cris/Makefile |2 +-
 arch/frv/Makefile  |   10 +-
 arch/h8300/Makefile|2 +-
 arch/h8300/lib/Makefile|2 +-
 arch/i386/Makefile |6 +++---
 arch/i386/boot/Makefile|2 +-
 arch/m32r/Makefile |2 +-
 arch/m68knommu/Makefile|2 +-
 arch/m68knommu/platform/5206/Makefile  |2 +-
 arch/m68knommu/platform/5206e/Makefile |2 +-
 arch/m68knommu/platform/520x/Makefile  |2 +-
 arch/m68knommu/platform/523x/Makefile  |2 +-
 arch/m68knommu/platform/5249/Makefile  |2 +-
 arch/m68knommu/platform/5272/Makefile  |2 +-
 arch/m68knommu/platform/527x/Makefile  |2 +-
 arch/m68knommu/platform/528x/Makefile  |2 +-
 arch/m68knommu/platform/5307/Makefile  |2 +-
 arch/m68knommu/platform/532x/Makefile  |2 +-
 arch/m68knommu/platform/5407/Makefile  |2 +-
 arch/mips/Makefile |2 +-
 arch/powerpc/Makefile  |4 ++--
 arch/ppc/Makefile  |4 ++--
 arch/s390/Makefile |6 +++---
 arch/sh/Makefile   |2 +-
 arch/sparc/Makefile|2 +-
 arch/sparc64/Makefile  |2 +-
 arch/um/Makefile   |2 +-
 arch/um/Makefile-i386  |2 +-
 arch/um/Makefile-x86_64|2 +-
 arch/um/sys-ppc/Makefile   |6 +++---
 arch/x86_64/Makefile   |6 +++---
 arch/x86_64/boot/compressed/Makefile   |2 +-
 arch/xtensa/boot/Makefile  |2 +-
 scripts/Kbuild.include |2 +-
 scripts/Makefile.lib   |2 +-
 41 files changed, 62 insertions(+), 60 deletions(-)

diff --git a/Documentation/kbuild/makefiles.txt 
b/Documentation/kbuild/makefiles.txt
index 4df47e4..15b3c11 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -425,6 +425,7 @@ more details, with real examples.
as-instr checks if the assembler reports a specific instruction
and then outputs either option1 or option2
C escapes are supported in the test instruction
+   Note: as-instr-option uses KBUILD_AFLAGS for $(AS) options
 
 cc-option
cc-option is used to check if $(CC) supports a given option, and not
@@ -820,14 +821,14 @@ When kbuild executes, the following steps are followed 
(roughly):
In this example, the binary $(obj)/image is a binary version of
vmlinux. The usage of $(call if_changed,xxx) will be described later.
 
-AFLAGS $(AS) assembler flags
+KBUILD_AFLAGS  $(AS) assembler flags
 
Default value - see top level Makefile
Append or modify as required per architecture.
 
Example:
#arch/sparc64/Makefile
-   AFLAGS += -m64 -mcpu=ultrasparc
+   KBUILD_AFLAGS += -m64 -mcpu=ultrasparc
 
 KBUILD_CFLAGS  $(CC) compiler flags
 
diff --git a/Makefile b/Makefile
index 2a83bf3..5b2dbdd 100644
--- a/Makefile
+++ b/Makefile
@@ -315,7 +315,7 @@ CPPFLAGS:= -D__KERNEL__ $(LINUXINCLUDE)
 KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
   -fno-strict-aliasing -fno-common \
   -Werror-implicit-function-declaration
-AFLAGS  := -D__ASSEMBLY__
+KBUILD_AFLAGS   := -D__ASSEMBLY__
 
 # Read KERNELRELEASE from include/config/kernel.release (if it exists)
 KERNELRELEASE = $(shell cat include/config/kernel.release 2 /dev/null)
@@ -328,7 +328,7 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
 
 export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
 export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
-export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
+export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
 
 # When compiling out-of-tree modules, put MODVERDIR in the module
 # tree rather than in the kernel tree. The kernel tree might
@@ -514,7 +514,8 @@ KBUILD_CFLAGS += $(call 
cc-option,-Wdeclaration-after-statement,)
 # disable pointer signed / unsigned warnings in gcc 4.0
 KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign

[kbuild-devel] [PATCH 4/4] kbuild: enable 'make CPPFLAGS=...' to add additional options to CPP

2007-09-09 Thread Sam Ravnborg
The variable CPPFLAGS is a wellknown variable and the usage by
kbuild may result in unexpected behaviour.

This patch replace use of CPPFLAGS with KBUILD_AFLAGS all over the
tree and enabling one to use:
make CPPFLAGS=...
to specify additional CPP commandline options.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 Documentation/kbuild/makefiles.txt |2 +-
 Makefile   |   13 +++--
 arch/arm/Makefile  |4 ++--
 arch/ia64/Makefile |2 +-
 arch/powerpc/Makefile  |2 +-
 arch/ppc/Makefile  |2 +-
 arch/um/Makefile-x86_64|2 +-
 drivers/atm/Makefile   |2 +-
 scripts/Makefile.lib   |6 +++---
 9 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/Documentation/kbuild/makefiles.txt 
b/Documentation/kbuild/makefiles.txt
index 15b3c11..29d070f 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -1100,7 +1100,7 @@ When kbuild executes, the following steps are followed 
(roughly):
specified options when building the target vmlinux.lds.
 
When building the *.lds target, kbuild uses the variables:
-   CPPFLAGS: Set in top-level Makefile
+   KBUILD_CPPFLAGS : Set in top-level Makefile
EXTRA_CPPFLAGS  : May be set in the kbuild makefile
CPPFLAGS_$(@F)  : Target specific flags.
  Note that the full filename is used in this
diff --git a/Makefile b/Makefile
index 5b2dbdd..771ecd8 100644
--- a/Makefile
+++ b/Makefile
@@ -310,7 +310,7 @@ LINUXINCLUDE:= -Iinclude \
$(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
   -include include/linux/autoconf.h
 
-CPPFLAGS:= -D__KERNEL__ $(LINUXINCLUDE)
+KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
 
 KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
   -fno-strict-aliasing -fno-common \
@@ -326,7 +326,7 @@ export ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS 
LD CC
 export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE
 export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
 
-export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
+export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
 export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
 export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
 
@@ -514,9 +514,10 @@ KBUILD_CFLAGS += $(call 
cc-option,-Wdeclaration-after-statement,)
 # disable pointer signed / unsigned warnings in gcc 4.0
 KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
 
-# Add user supplied AFLAGS and CFLAGS as the last assignments
-KBUILD_AFLAGS += $(AFLAGS)
-KBUILD_CFLAGS += $(CFLAGS)
+# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
+KBUILD_CPPFLAGS += $(CPPFLAGS)
+KBUILD_AFLAGS   += $(AFLAGS)
+KBUILD_CFLAGS   += $(CFLAGS)
 
 # Use --build-id when available.
 LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
@@ -1492,7 +1493,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   
$(wildcard $(rm-files))
 
 
 a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
- $(NOSTDINC_FLAGS) $(CPPFLAGS) \
+ $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \
  $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
 
 quiet_cmd_as_o_S = AS  $@
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index e7eab5b..b315899 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -32,11 +32,11 @@ KBUILD_CFLAGS   +=-fno-omit-frame-pointer -mapcs 
-mno-sched-prolog
 endif
 
 ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
-CPPFLAGS   += -mbig-endian
+KBUILD_CPPFLAGS+= -mbig-endian
 AS += -EB
 LD += -EB
 else
-CPPFLAGS   += -mlittle-endian
+KBUILD_CPPFLAGS+= -mlittle-endian
 AS += -EL
 LD += -EL
 endif
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index 9708a29..34951aa 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -29,7 +29,7 @@ cflags-y  := -pipe $(EXTRA) -ffixed-r13 
-mfixed-range=f12-f15,f32-f127 \
 CFLAGS_KERNEL  := -mconstant-gp
 
 GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas $(CC) 
$(OBJDUMP))
-CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags $(CC) 
$(OBJDUMP) $(READELF))
+KBUILD_CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags 
$(CC) $(OBJDUMP) $(READELF))
 
 ifeq ($(GAS_STATUS),buggy)
 $(error Sorry, you need a newer version of the assember, one that is built 
from\
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 02fbeb1..8138ac2 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -68,7 +68,7 @@ CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) 
-Iarch/$(ARCH)/include
 AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)
 CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none  -mcall-aixdesc
 CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2

Re: [kbuild-devel] CONFIG_HOTPLUG_CPU: kconfig bug?

2007-08-27 Thread Sam Ravnborg
On Mon, Aug 27, 2007 at 03:54:49PM +0100, Hugh Dickins wrote:
 Hi Roman,
 
 I've noticed an oddity with CONFIG_HOTPLUG_CPU in 2.6.23-rc:
 make oldconfig seems to turn it on even when nothing wants it,
 increasing kernel size by about 10k; but if you then edit the
 line out of .config and make oldconfig again, it correctly
 offers the choice and lets it be turned off after all.
 
 (I've not actually tried make anything_else_config.)
 
 Attached is a 2.6.23-rc1 i386 SMP .config, CONFIG_HOTPLUG_CPU
 not set, with which it should be easy to reproduce the issue: just
 make oldconfig in an -rc2 or current kernel tree (being sure to
 choose N for SUSPEND and HIBERNATION: those rightly select it).

I tried to reproduce this with no luck:

$ mv hugh .config 
$ make 
scripts/kconfig/conf -s arch/i386/Kconfig
*
* Restart config...
*
*
* Power management options (ACPI, APM)
*
Power Management support (PM) [Y/n/?] y
  Legacy Power Management API (DEPRECATED) (PM_LEGACY) [N/y/?] n
  Power Management Debug Support (PM_DEBUG) [N/y/?] n
Suspend to RAM and standby (SUSPEND) [Y/n/?] (NEW) n  = I selected 
'n'
Hibernation (aka 'suspend to disk') (HIBERNATION) [N/y/?] (NEW) n = I selected 
'n'
*
* Fusion MPT device support
*
Fusion MPT ScsiHost drivers for SPI (FUSION_SPI) [Y/n/m/?] y
Fusion MPT ScsiHost drivers for FC (FUSION_FC) [N/m/y/?] n
Fusion MPT ScsiHost drivers for SAS (FUSION_SAS) [N/m/y/?] n
Maximum number of scatter gather entries (16 - 128) (FUSION_MAX_SGE) [128] 128
Fusion MPT misc device (ioctl) driver (FUSION_CTL) [N/m/y/?] n
Fusion MPT logging facility (FUSION_LOGGING) [N/y/?] (NEW) 
#
# configuration written to .config
#
  CHK include/linux/version.h
  CHK include/linux/utsrelease.h
make: *** [_all] Interrupt

$ grep HOTPLUG_CPU .config
# CONFIG_HOTPLUG_CPU is not set

If you let kbuild do a silentoldconfig then I expect
it to be set due to SUSPEND being set.

If you can still reproduce it could you then explan the
exect stepts to do so.

PS. I used latest -linus as of yesterday.

Sam

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [PATCH] kconfig: add *_silentdefconfig feature for config targets

2007-08-22 Thread Sam Ravnborg
 
- We seem to switch between using _() and not using it for strings; I'm
  assuming that we don't actually care about i18n in conf.c, and that the
  _() stuff was just copied from elsewhere.  If that's not the case, I
  can update the patch to wrap strings properly.
 
 I try to keep this uptodate, but I don't really check for this.

It is on my TODO list to go through the missing bits based on a patch
from the linux kernel translation project.
But work-work keeps me outright busy atm.
So not much itime for kernel-work :-(

Sam

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [PATCH 25/33] kbuild: use POSIX BRE in headers install target

2007-07-21 Thread Sam Ravnborg
On Sat, Jul 21, 2007 at 06:03:00PM -0400, Mike Frysinger wrote:
 On 7/21/07, Sam Ravnborg [EMAIL PROTECTED] wrote:
 On Sat, Jul 21, 2007 at 03:21:43PM -0400, Mike Frysinger wrote:
  On 7/21/07, Oleg Verych [EMAIL PROTECTED] wrote:
  On Sat, Jul 21, 2007 at 04:27:31AM -0400, Mike Frysinger wrote:
  []
   if you want to make some micro optimization in the build install step,
   sure ... but functionally, the difference is irrelevant considering
   sed operates only on individual lines
  
  That was an attempt to support less sucking userspace in the kernel
  development. More readable, more memory/cpu effective, more portable.
 
  while you could try and make a claim against memory/cpu effeciency, i
  fail to see how the first or last claims could possibly be backed up
 
  but again, if you feel that strongly about it, you're certainly free
  to post a patch
 
 I would much more prefer this functionality to be integrated into unifdef.
 There is no good reason to have two different preprocesisng methonds, one
 being the sed based one and the other the unidef one.
 
 A sinlge dedicated program that contian the sum of the functionality would
 be faster too.
 
 which functionality ?  normalizing of whitespace or all these
 linux-specific hacks ?  unifdef serves one specific function which is
 stated in its manpage: remove preprocessor conditionals from code.

At present the kernel has a private copy of unidef. So adjusting the
private copy for the needs of the kernels seems like a god plan.
We could even make it an extension so we do not break current
functionality.

Sam

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] More effective processing (Re: [PATCH 25/33] kbuild: use POSIX BRE in headers install target)

2007-07-21 Thread Sam Ravnborg
On Sun, Jul 22, 2007 at 12:16:27AM +0200, Oleg Verych wrote:
 
 What do you think about this one? I want to propose to remove
 scripts/unifdef.c but to make clear policy about how to mark __KERNEL__
 sections in header files. We know how obfuscated C can be, and this also
 applies to preprocessing. There's known CodingStyle about some points.
 The thing is to specify rules, that will be easy for `sed` to do cleaup
 job.
 
 ./linux/soundcard.h:#if (!defined(__KERNEL__)  !defined(KERNEL)  
 !defined(INKERNEL)
!defined(_KERNEL)) || defined(USE_SEQ_MACROS)
 ./linux/stat.h:#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__  
 2)
 
 Split __KERNEL__ check, make only positive, i.e.
 
 #if defined(__KERNEL__)
 #ifdef __KERNEL__
 
 ./linux/stat.h:#ifdef __KERNEL__
 
 No `#else` and ending part to contain comment:
 
 ./linux/smb_fs_sb.h:#endif /* __KERNEL__ */
 
 Simple enough:
 
 sed '/^#if[^_]*__KERNEL__/,/^#end[^_]*__KERNEL__/d'

What are you trying to say with the above?
Sorry but I lost track of part of the discussion but you seems to havea point 
here?

Sam

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Mucking with assembly files

2007-07-14 Thread Sam Ravnborg
On Tue, Jul 10, 2007 at 10:19:14AM -0700, H. Peter Anvin wrote:
 I seem to always be the one with the kbuild corner cases...
 
 As part of my x86 setup rewrite, there has been some concern that using
 asm(.code16gcc); isn't as safe as it should be (because of gcc
 reordering), and making it safe apparently means disabling optimizations
 that adds at least 5% to the code size.  Not really a huge deal, but
 undesirable in the long run.
 
 The alternative is to compile to a .s file and then inject .code16gcc
 to the top of the .s file before assembling it into a .o file.  This
 means overriding some of kbuild's implicit rules, and I'm not sure how
 to do that cleanly.

Is this still relevant considering you adopted the -funit-at-a-time
proposal?

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] help text on choices

2007-07-14 Thread Sam Ravnborg
On Tue, Jul 10, 2007 at 04:30:30PM -0500, Mike Frysinger wrote:
 ive always wondered about this but never got around to asking ;)
 
 is the help text on the top level choice supposed to be usable ?  for example:
 choice
 prompt you [may] have a choice
 default YES
 help
   This help text is never viewable :(
 config YES
 bool yes
 help
   This help text is viewable when yes is selected.
 config NO
 bool no
 help
   This help text is viewable when no is selected.
 endchoice
 
 if you highlight the you [may] have a choice and query help, you get
 no output ... but if you go into the choice selection and query help
 on the options, you can view the help text for those individual ones.
 generally i like to put an overview in the choice help and explain
 each option in depth in the individual choices.

It is a menuconfig limitation. xconfig shows the helptext as one
would expect it to do.

See attached screenshot.

Sam
attachment: mike.png-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Mucking with assembly files

2007-07-14 Thread Sam Ravnborg
On Tue, Jul 10, 2007 at 09:46:25PM +0200, Oleg Verych wrote:
 On Tue, Jul 10, 2007 at 10:19:14AM -0700, H. Peter Anvin wrote:
  I seem to always be the one with the kbuild corner cases...
  
  As part of my x86 setup rewrite, there has been some concern that using
  asm(.code16gcc); isn't as safe as it should be (because of gcc
  reordering), and making it safe apparently means disabling optimizations
  that adds at least 5% to the code size.  Not really a huge deal, but
  undesirable in the long run.
  
  The alternative is to compile to a .s file and then inject .code16gcc
  to the top of the .s file before assembling it into a .o file.  This
  means overriding some of kbuild's implicit rules, and I'm not sure how
  to do that cleanly.
 
 As part of my kbuild/kconfig pre-rewrite info collecting... whatever :)
 
 I did asm-offsets build rewrite RFC four week ago:
 http://mid.gmane.org/[EMAIL PROTECTED]
 
 You may be interested in it. But Sam is busy, nothing happend since
 then.

Just returned from a nice 2 week vacation with no Internet access
and no computer turned on (not counting the GPS).
And still lacking behind on other stuff too.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [patch 01/03] kbuild, asm-values: infrastructure

2007-06-14 Thread Sam Ravnborg
On Thu, Jun 14, 2007 at 09:41:43AM +0200, Oleg Verych wrote:
 Jun 13, 2007 at 01:36:51AM +0200, asm-values patch set:
  * header with widely used value definitions
  * handle all asm-related things in one file (Makefile.asm)
  * move some asm bits from Makefile.build there
(rule %.s:%.c)
  * add script to generate headers from assembles output
(hopefully better output, MIPS testing/joining to all arch
 probably needed)
  
  rfc-by: Oleg Verych
  ---
 
 So, is it another not so juicy lets-break-it-all stuff from me, or it just
 doesn't apply for you?

I have not yet looked at it. A few other items pending that I need to finish
off before next merge window has priority.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Need opinions on asm-offsets cleanup (Re: [patch 01/03] kbuild, asm-values: infrastructure)

2007-06-14 Thread Sam Ravnborg
On Thu, Jun 14, 2007 at 01:16:21PM +0200, Oleg Verych wrote:
 On Thu, Jun 14, 2007 at 11:12:25AM +0200, Sam Ravnborg wrote:
  On Thu, Jun 14, 2007 at 09:41:43AM +0200, Oleg Verych wrote:
   Jun 13, 2007 at 01:36:51AM +0200, asm-values patch set:
* header with widely used value definitions
* handle all asm-related things in one file (Makefile.asm)
* move some asm bits from Makefile.build there
  (rule %.s:%.c)
* add script to generate headers from assembles output
  (hopefully better output, MIPS testing/joining to all arch
   probably needed)

rfc-by: Oleg Verych
---
   
   So, is it another not so juicy lets-break-it-all stuff from me, or it just
   doesn't apply for you?
  
  I have not yet looked at it. A few other items pending that I need to finish
  off before next merge window has priority.
  
 That's my view about asm-offsets cleanup/generalizing. I just need ack or
 nack from, for example arch maintainers if this is acceptable at all or
 anybody, actually interested in this kind of things. Not cool stuff, but
 still quite straight and easy to finish and merge.
I will for sure take a look.
But with less than 1 hour/day for Linux stuff this has been scheduled after
other stuff I need to do before next merge window.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [patch] kbuild: remember ARCH in the object directory

2007-06-12 Thread Sam Ravnborg
On Tue, Jun 12, 2007 at 07:19:22PM +0200, Oleg Verych wrote:
 On Tue, Jun 12, 2007 at 09:12:09AM -0700, Randy Dunlap wrote:
 []
  I did:
  
  # build a linux-2.6.22-rc4-git4 kernel source tree  cd into it
  # mkdir BLD
  $ make ARCH=i386 O=BLD defconfig
  $ make -j4 O=BLD all BLD/bld.out 21
  
  and it cried to me:
  
GEN /scsi/linsrc/linux-2.6.22-rc4-git4/BLD/Makefile
  scripts/kconfig/conf -s arch/x86_64/Kconfig
  #... many config warning lines
  *
  * Restart config...
  *
  *
  * Processor type and features
  *
  Subarchitecture Type
   1. PC-compatible (X86_PC)
2. Support for ScaleMP vSMP (X86_VSMP) (NEW)
  choice[1-2]: aborted!
  
  Console input/output is redirected. Run 'make oldconfig' to update 
  configuration.
  
  make[3]: *** [silentoldconfig] Error 1
  make[2]: *** [silentoldconfig] Error 2
  make[1]: *** [include/config/auto.conf] Error 2
  make: *** [all] Error 2
  
 [] 
 
  What did I do wrong??
 
 That Makefile is used only, if you are *in* that obj. directory.
 Thus `cd BLD` is what you've forget.
 
 There must be a better way to have this kind of choice be saved,
 but it's chicken-and-egg issue from the kconfig POV.
 
 As i'm always try to use separate obj. dir., i've made life easier
 *in* it.

I fully agree with the intent of the patch.
But it fails exactly because it introduce different behaviour
dependent of actual usage.

For non O= build ARCH is not saved and does not work
For make O= it does not work
For make in the output dir it works
For external modules it does not work

This will greatly confuse people.

If we go the save important parts of the config I prefer
something along the suggestion by hpa with a config file.
The config file should though be named along the lines
of Kbuild.config and the syntax should be future proof.
I like the syntax of the .git/config file and
it should be along these lines.

And the bahavior should be exactly the same for all uses
listed above.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [patch] scripts: clean-whitespace.sh

2007-06-08 Thread Sam Ravnborg
On Thu, Jun 07, 2007 at 11:44:59PM -0700, Andrew Morton wrote:
 
 Then again, it's a better strategy than trying to read the code ;)
 
 Please, tell us what it does, so that we can decide whether we want it in
 Linux.

It does the same as cleanfile.pl.
I have seen no reason to replace cleanfile.pl with this version.

Linecount is down but so is maintainability / extendability.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [patch] scripts: clean-whitespace.sh

2007-06-08 Thread Sam Ravnborg
On Fri, Jun 08, 2007 at 05:02:15PM +0200, Oleg Verych wrote:
 On Fri, Jun 08, 2007 at 04:28:49PM +0200, Sam Ravnborg wrote:
  On Thu, Jun 07, 2007 at 11:44:59PM -0700, Andrew Morton wrote:
   
   Then again, it's a better strategy than trying to read the code ;)
   
   Please, tell us what it does, so that we can decide whether we want it in
   Linux.
  
  It does the same as cleanfile.pl.
  I have seen no reason to replace cleanfile.pl with this version.
 
 It does better whitespace cleanup, than
 
 scripts/{cleanfile *and* cleanpatch}

Made a short test here.
Added the following to a file:

static sam = ;

clean-whitespace replaced spaces within  with tabs.
cleanfile did not.

Seems that clean-whitespace has the wrong assumption that any sequence
of tab-stop8 spacestab-stop must be replaced with a tab.
It should obviously default to beginning of file.


Running latest cleanfile (it is -mm) on your testfile
gave following output:
cleanfile: ipv6.h
ipv6.h:105: line exceeds 79 characters (89)
ipv6.h:111: line exceeds 79 characters (89)
ipv6.h:350: line exceeds 79 characters (85)
ipv6.h:356: line exceeds 79 characters (85)
ipv6.h:362: line exceeds 79 characters (85)
ipv6.h:386: line exceeds 79 characters (82)
ipv6.h:413: line exceeds 79 characters (85)

And spaces were replaced with tabs only where
it is safe.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Another version of cleanfile/cleanpatch (Re: [PATCH 08/19] scripts: Make cleanfile/cleanpatch warn about long lines)

2007-06-06 Thread Sam Ravnborg
On Wed, Jun 06, 2007 at 07:45:56PM +0200, Oleg Verych wrote:
 While i'm against whitespace damaged files or patches since my very
 first patch, and don't like brain damaged programmer's tools called
 text editors, i also want to encourage UNIX-way of using userspace.
 
 Of course, i might be wrong and foolish. Anyway, what i'm trying to do
 is not to become new generation of Visual Perl#(R) implemented in
 Java(R) using XML with userspace, that suck.
 
 Many things in XXI century still can be done by tools founded 20-30
 years ago. Why not try to?

Because your shell script is unreadable by normal human beings[*]
while the perl script for people with a bit of perl fu can read it
and fix/modify it.

We want tools that can be maintained and enhanced by most people.

[*] Normal human beings are people with same level of shell
scripting/sed skills that I have just to put that straight.
Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [PATCH 08/19] scripts: Make cleanfile/cleanpatch warn about long lines

2007-06-05 Thread Sam Ravnborg
On Tue, Jun 05, 2007 at 09:33:35AM +0200, Oleg Verych wrote:
 Hallo.
 
 On Sun, Jun 03, 2007 at 10:47:00PM +0200, Sam Ravnborg wrote:
  Subject: [PATCH 08/19] scripts: Make cleanfile/cleanpatch warn about long 
  lines
  From: H. Peter Anvin [EMAIL PROTECTED]
  Date: Fri, 25 May 2007 17:58:26 -0700
  
  Make the cleanfile and cleanpatch script warn about long lines,
  by default lines whose visual width exceeds 79 characters.
  
  Per suggestion from Auke Kok.
  
  Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
  Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
 
 Thank you, Sam, for sending messages back in Kbuild list again.
 I have ~30k backlog in LKML, so that thing is good.
Delete them all - it only hurst a few minutes ;-)

 
 So, there are some new scripts. What if my proposition will be better,
 so to speak? Any problems i'm willing to fix/enhance.
 
 Note: only one copy of the file required. Sym-linked name *diff* or
 *patch* will process patches. I know, that symlinks in sources isn't
 good, thus change $0 - $1 will process first parameter.

Sorry - but I really do not get your point here.
Are you trying to say that current cleanpatch is not good enough
or do you propose a new script to do something similar?

We do not want everyones favorite patch preprocessing script
in the kernel. So the only option is to incorporate changes in
cleanpatch.

If on the other hand you are proposing a script to clean whitespace
damage in the code then git already does this nicely.
I do not recall the actual receipt but searching the git mailing list
should reveal it. So for whitespace cleanup we should use git but maybe
via a small helper script.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] kbuild update

2007-06-03 Thread Sam Ravnborg
Short intro to content of kbuild.git at the moment.
See http://git.kernel.org/?p=linux/kernel/git/sam/kbuild.git;a=summary

Everything are targeted for next merge window.

section mismatch
  kbuild: make better section mismatch reports on i386, arm and mips
  kbuild: The .paravirtprobe section is obsolete, so modpost doesn't need 
to handle it
  kbuild: ignore section mismatch warnings originating from .note section
  kbuild: refactor code in modpost to improve maintainability
  kbuild: warn about references from .init.text to .exit.text
  kbuild: remove hardcoded apic_es7000 from modpost
  kbuild: refactor code in modpost
  kbuild: remove hardcoded _logo names from modpost
  kbuild: suppress modpost warnings for references from the .toc section as 
used by powerpc
  kbuild: whitelist references from variables named _timer to .init.text

Several changes to either improve reporting - or to ignore false positives.
In particular modpost now check for and warn about references from .init.text 
to .exit.text
This check caugth several real bugs - which for the most part are already fixed 
in upstream.
modpost now does a better job finding the symbols using addend - this works for 
me
but had caused troubles in the past. If modpost suddenly bails out with a 
segmentation
violation this may the the culprint.
In addition some trivial code refactoring was done to improve maintainability 
of modpost.


  kconfig: use POSIX equality test in check-lxdialog.sh
Bugfix.


  scripts: Make cleanfile/cleanpatch warn about long lines
Improved so we all adhere to 80 lines (in)sanity


  kbuild: avoid environment to set variables used by kbuild
I had a report that a user tried to do:
EXTRA_CFLAGS=FOO make fs/nfs/
This is not supposed to impact the build so make sure it does not.


  kbuild: add support for reading stdin with gen_init_cpio
  kbuild: add support for squashing uid/gid in gen_initramfs_list.sh
initramfs improvements


  kbuild: asm-offsets.h is now cleaned with O=.. builds
Bugfix


  kbuild: document cc-fullversion
  kbuild: New 'cc-fullversion' macro
  powerpc: Refuse to build 64-bit with GCC-4.2.0 and CONFIG_MODULES
Add and use cc-fullversion to obtain exact gcc version
See documentation in Documentation/kbuild/makefiles.txt


What's next?
- davem has requested to add a new section used for code modifying support.
   The actual section name to use needs to be sorted out.
- A few cygwin specific changes may hit kbuild - to allow the kernel to be 
built
   using cygwin on a windoze box.
- A few trivial kconfig changes are pending. Needs to review them before they 
are ready.
- A speed-up of headers_check is in the works. Got stalled but will look into 
it soon.
   The check goes down to ~3 sec on my not-so-fast machine
- If I get really bored I may start a 'cleaning up all vmlinux.lds files' 
round.
   If someone would help out here it would be appreciated.
   These change will then be merged via the arch-maintaines and not really 
kbuild stuff..

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 01/19] kbuild: asm-offsets.h is now cleaned with O=.. builds

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 01/19] kbuild: asm-offsets.h is now cleaned with O=.. builds
From: Sam Ravnborg [EMAIL PROTECTED]
Date: Mon, 28 May 2007 22:14:37 +0200

Reported by: Robert P. J. Day [EMAIL PROTECTED]

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
Cc: Robert P. J. Day [EMAIL PROTECTED]
---
 Kbuild |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Kbuild b/Kbuild
index 163f8cb..56b8edf 100644
--- a/Kbuild
+++ b/Kbuild
@@ -13,6 +13,7 @@ offsets-file := include/asm-$(ARCH)/asm-offsets.h
 always  := $(offsets-file)
 targets := $(offsets-file)
 targets += arch/$(ARCH)/kernel/asm-offsets.s
+clean-files := $(addprefix $(objtree)/,$(targets))
 
 # Default sed regexp - multiline due to syntax constraints
 define sed-y
-- 
1.5.1.rc3.1544.g8a923

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 02/19] kbuild: make better section mismatch reports on i386, arm and mips

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 02/19] kbuild: make better section mismatch reports on i386, 
arm and mips
From: Atsushi Nemoto [EMAIL PROTECTED]
Date: Tue, 22 May 2007 18:27:39 +0900

On i386, ARM and MIPS, warn_sec_mismatch() sometimes fails to show
usefull symbol name.  This is because empty 'refsym' due to 0 r_addend
value.  This patch is to adjust r_addend value, consulting with
apply_relocate() routine in kernel code.

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/mod/modpost.c |   85 +
 scripts/mod/modpost.h |3 ++
 2 files changed, 88 insertions(+), 0 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 8e5610d..760b2b3 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -374,6 +374,7 @@ static int parse_elf(struct elf_info *info, const char 
*filename)
hdr-e_shstrndx = TO_NATIVE(hdr-e_shstrndx);
hdr-e_shnum= TO_NATIVE(hdr-e_shnum);
hdr-e_machine  = TO_NATIVE(hdr-e_machine);
+   hdr-e_type = TO_NATIVE(hdr-e_type);
sechdrs = (void *)hdr + hdr-e_shoff;
info-sechdrs = sechdrs;
 
@@ -384,6 +385,8 @@ static int parse_elf(struct elf_info *info, const char 
*filename)
sechdrs[i].sh_size   = TO_NATIVE(sechdrs[i].sh_size);
sechdrs[i].sh_link   = TO_NATIVE(sechdrs[i].sh_link);
sechdrs[i].sh_name   = TO_NATIVE(sechdrs[i].sh_name);
+   sechdrs[i].sh_info   = TO_NATIVE(sechdrs[i].sh_info);
+   sechdrs[i].sh_addr   = TO_NATIVE(sechdrs[i].sh_addr);
}
/* Find symbol table. */
for (i = 1; i  hdr-e_shnum; i++) {
@@ -753,6 +756,8 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, 
Elf_Addr addr,
for (sym = elf-symtab_start; sym  elf-symtab_stop; sym++) {
if (sym-st_shndx != relsym-st_shndx)
continue;
+   if (ELF_ST_TYPE(sym-st_info) == STT_SECTION)
+   continue;
if (sym-st_value == addr)
return sym;
}
@@ -895,6 +900,72 @@ static void warn_sec_mismatch(const char *modname, const 
char *fromsec,
}
 }
 
+static inline unsigned int *reloc_location(struct elf_info *elf,
+  int rsection, Elf_Rela *r)
+{
+   Elf_Shdr *sechdrs = elf-sechdrs;
+   int section = sechdrs[rsection].sh_info;
+
+   return (void *)elf-hdr + sechdrs[section].sh_offset +
+   (r-r_offset - sechdrs[section].sh_addr);
+}
+
+static void addend_386_rel(struct elf_info *elf, int rsection, Elf_Rela *r)
+{
+   unsigned int r_typ = ELF_R_TYPE(r-r_info);
+   unsigned int *location = reloc_location(elf, rsection, r);
+
+   switch (r_typ) {
+   case R_386_32:
+   r-r_addend = TO_NATIVE(*location);
+   break;
+   case R_386_PC32:
+   r-r_addend = TO_NATIVE(*location) + 4;
+   /* For CONFIG_RELOCATABLE=y */
+   if (elf-hdr-e_type == ET_EXEC)
+   r-r_addend += r-r_offset;
+   break;
+   }
+}
+
+static void addend_arm_rel(struct elf_info *elf, int rsection, Elf_Rela *r)
+{
+   unsigned int r_typ = ELF_R_TYPE(r-r_info);
+   unsigned int *location = reloc_location(elf, rsection, r);
+
+   switch (r_typ) {
+   case R_ARM_ABS32:
+   r-r_addend = TO_NATIVE(*location);
+   break;
+   case R_ARM_PC24:
+   r-r_addend = ((TO_NATIVE(*location)  0x00ff)  2) + 8;
+   break;
+   }
+}
+
+static int addend_mips_rel(struct elf_info *elf, int rsection, Elf_Rela *r)
+{
+   unsigned int r_typ = ELF_R_TYPE(r-r_info);
+   unsigned int *location = reloc_location(elf, rsection, r);
+   unsigned int inst;
+
+   if (r_typ == R_MIPS_HI16)
+   return 1;   /* skip this */
+   inst = TO_NATIVE(*location);
+   switch (r_typ) {
+   case R_MIPS_LO16:
+   r-r_addend = inst  0x;
+   break;
+   case R_MIPS_26:
+   r-r_addend = (inst  0x03ff)  2;
+   break;
+   case R_MIPS_32:
+   r-r_addend = inst;
+   break;
+   }
+   return 0;
+}
+
 /**
  * A module includes a number of sections that are discarded
  * either when loaded or when used as built-in.
@@ -938,8 +1009,11 @@ static void check_sec_ref(struct module *mod, const char 
*modname,
r.r_offset = TO_NATIVE(rela-r_offset);
 #if KERNEL_ELFCLASS == ELFCLASS64
if (hdr-e_machine == EM_MIPS) {
+   unsigned int r_typ;
r_sym = ELF64_MIPS_R_SYM(rela-r_info);
r_sym = TO_NATIVE(r_sym);
+   r_typ = ELF64_MIPS_R_TYPE(rela-r_info

[kbuild-devel] [PATCH 03/19] kbuild: New 'cc-fullversion' macro

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 03/19] kbuild: New 'cc-fullversion' macro
From: Segher Boessenkool [EMAIL PROTECTED]
Date: Sat, 19 May 2007 18:49:07 +0200

Prints a six-digit string including the GCC patchlevel.  Also fix
the 'usage' comment for cc-version.

Signed-off-by: Segher Boessenkool [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/Kbuild.include |7 ++-
 scripts/gcc-version.sh |   15 ---
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 06c1a37..677bc6c 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -100,9 +100,14 @@ cc-option-align = $(subst -functions=0,,\
$(call cc-option,-falign-functions=0,-malign-functions=0))
 
 # cc-version
-# Usage gcc-ver := $(call cc-version,$(CC))
+# Usage gcc-ver := $(call cc-version)
 cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
 
+# cc-fullversion
+# Usage gcc-ver := $(call cc-fullversion)
+cc-fullversion = $(shell $(CONFIG_SHELL) \
+   $(srctree)/scripts/gcc-version.sh -p $(CC))
+
 # cc-ifversion
 # Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
 cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ]  echo $(3))
diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh
index bb4fbea..8a1d187 100644
--- a/scripts/gcc-version.sh
+++ b/scripts/gcc-version.sh
@@ -1,14 +1,23 @@
 #!/bin/sh
 #
-# gcc-version gcc-command
+# gcc-version [-p] gcc-command
 #
 # Prints the gcc version of `gcc-command' in a canonical 4-digit form
 # such as `0295' for gcc-2.95, `0303' for gcc-3.3, etc.
 #
+# With the -p option, prints the patchlevel as well, for example `029503' for
+# gcc-2.95.3, `030301' for gcc-3.3.1, etc.
+#
+
+if [ $1 = -p ] ; then with_patchlevel=1; shift; fi
 
 compiler=$*
 
 MAJOR=$(echo __GNUC__ | $compiler -E -xc - | tail -n 1)
 MINOR=$(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)
-printf %02d%02d\\n $MAJOR $MINOR
-
+if [ x$with_patchlevel != x ] ; then
+   PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -xc - | tail -n 1)
+   printf %02d%02d%02d\\n $MAJOR $MINOR $PATCHLEVEL
+else
+   printf %02d%02d\\n $MAJOR $MINOR
+fi
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 04/19] powerpc: Refuse to build 64-bit with GCC-4.2.0 and CONFIG_MODULES

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 04/19] powerpc: Refuse to build 64-bit with GCC-4.2.0 and 
CONFIG_MODULES
From: Segher Boessenkool [EMAIL PROTECTED]
Date: Sat, 19 May 2007 18:49:08 +0200

...since this won't work (compiler bug, see http://gcc.gnu.org/PR31490).

Signed-off-by: Segher Boessenkool [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 arch/powerpc/Makefile |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6238b58..1447c83 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -202,6 +202,14 @@ checkbin:
false; \
fi ; \
fi
+   @if test $(call cc-fullversion) = 040200 \
+test x${CONFIG_MODULES}${CONFIG_PPC64} = xyy ; then \
+   echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
+   echo 'kernel with modules enabled.' ; \
+   echo -n '*** Please use a different GCC version or ' ; \
+   echo 'disable kernel modules' ; \
+   false ; \
+   fi
@if ! /bin/echo dssall | $(AS) -many -o $(TOUT) /dev/null 21 ; then \
echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' 
; \
echo 'correctly with old versions of binutils.' ; \
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 05/19] kbuild: document cc-fullversion

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 05/19] kbuild: document cc-fullversion
From: Sam Ravnborg [EMAIL PROTECTED]
Date: Mon, 28 May 2007 22:26:55 +0200

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 Documentation/kbuild/makefiles.txt |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/Documentation/kbuild/makefiles.txt 
b/Documentation/kbuild/makefiles.txt
index bb5306e..c6d9a35 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -501,6 +501,20 @@ more details, with real examples.
The third parameter may be a text as in this example, but it may also
be an expanded variable or a macro.
 
+cc-fullversion
+   cc-fullversion is usefull when the exact version of gcc is needed.
+   One typical use-case is when a specific GCC version is broken.
+   cc-fullversion points out a more specific version than cc-version does.
+
+   Example:
+   #arch/powerpc/Makefile
+   $(Q)if test $(call cc-fullversion) = 040200 ; then \
+   echo -n '*** GCC-4.2.0 cannot compile the 64-bit 
powerpc ' ; \
+   false ; \
+   fi
+
+   In this example for a specific GCC version the build will error out 
explaining
+   the user why it stops.
 
 === 4 Host Program support
 
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 06/19] kbuild: suppress modpost warnings for references from the .toc section as used by powerpc

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 06/19] kbuild: suppress modpost warnings for references from 
the .toc section as used by powerpc
From: Stephen Rothwell [EMAIL PROTECTED]
Date: Thu, 24 May 2007 14:16:13 +1000

We should do better here by effetively dereferencing references to
the .toc (or the .got2) section, but that is much harder.

Signed-off-by: Stephen Rothwell [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/mod/modpost.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 760b2b3..f6bae03 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -870,9 +870,12 @@ static void warn_sec_mismatch(const char *modname, const 
char *fromsec,
return;
 
/* fromsec whitelist - without a valid 'before'
-* powerpc has a GOT table in .got2 section */
+* powerpc has a GOT table in .got2 section
+* and also a .toc section */
if (strcmp(fromsec, .got2) == 0)
return;
+   if (strcmp(fromsec, .toc) == 0)
+   return;
 
if (before  after) {
warn(%s(%s+0x%llx): Section mismatch: reference to %s:%s 
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 07/19] kbuild: avoid environment to set variables used by kbuild

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 07/19] kbuild: avoid environment to set variables used by kbuild
From: Sam Ravnborg [EMAIL PROTECTED]
Date: Mon, 28 May 2007 22:47:48 +0200

A few of the variables used by kbuild has fixed naming.
Make sure we do not pick up random values from the environment.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/Makefile.build |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index a525112..3f7b451 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -7,6 +7,22 @@ src := $(obj)
 PHONY := __build
 __build:
 
+# Init all relevant variables used in kbuild files so
+# 1) they have correct type
+# 2) they do not inherit any value from the environment
+obj-y :=
+obj-m :=
+lib-y :=
+lib-m :=
+always :=
+targets :=
+subdir-y :=
+subdir-m :=
+EXTRA_AFLAGS   :=
+EXTRA_CFLAGS   :=
+EXTRA_CPPFLAGS :=
+EXTRA_LDFLAGS  :=
+
 # Read .config if it exist, otherwise ignore
 -include include/config/auto.conf
 
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 08/19] scripts: Make cleanfile/cleanpatch warn about long lines

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 08/19] scripts: Make cleanfile/cleanpatch warn about long lines
From: H. Peter Anvin [EMAIL PROTECTED]
Date: Fri, 25 May 2007 17:58:26 -0700

Make the cleanfile and cleanpatch script warn about long lines,
by default lines whose visual width exceeds 79 characters.

Per suggestion from Auke Kok.

Signed-off-by: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/cleanfile  |   54 ++-
 scripts/cleanpatch |   58 +--
 2 files changed, 107 insertions(+), 5 deletions(-)

diff --git a/scripts/cleanfile b/scripts/cleanfile
index f1ba8aa..cefd29e 100755
--- a/scripts/cleanfile
+++ b/scripts/cleanfile
@@ -7,7 +7,9 @@
 use bytes;
 use File::Basename;
 
-#
+# Default options
+$max_width = 79;
+
 # Clean up space-tab sequences, either by removing spaces or
 # replacing them with tabs.
 sub clean_space_tabs($)
@@ -48,9 +50,49 @@ sub clean_space_tabs($)
 return $lo;
 }
 
+# Compute the visual width of a string
+sub strwidth($) {
+no bytes;  # Tab alignment depends on characters
+
+my($li) = @_;
+my($c, $i);
+my $pos = 0;
+my $mlen = 0;
+
+for ($i = 0; $i  length($li); $i++) {
+   $c = substr($li,$i,1);
+   if ($c eq \t) {
+   $pos = ($pos+8)  ~7;
+   } elsif ($c eq \n) {
+   $mlen = $pos if ($pos  $mlen);
+   $pos = 0;
+   } else {
+   $pos++;
+   }
+}
+
+$mlen = $pos if ($pos  $mlen);
+return $mlen;
+}
+
 $name = basename($0);
 
-foreach $f ( @ARGV ) {
[EMAIL PROTECTED] = ();
+
+while (defined($a = shift(@ARGV))) {
+if ($a =~ /^-/) {
+   if ($a eq '-width' || $a eq '-w') {
+   $max_width = shift(@ARGV)+0;
+   } else {
+   print STDERR Usage: $name [-width #] files...\n;
+   exit 1;
+   }
+} else {
+   push(@files, $a);
+}
+}
+
+foreach $f ( @files ) {
 print STDERR $name: $f\n;
 
 if (! -f $f) {
@@ -90,8 +132,10 @@ foreach $f ( @ARGV ) {
 
 @blanks = ();
 @lines  = ();
+$lineno = 0;
 
 while ( defined($line = FILE) ) {
+   $lineno++;
$in_bytes += length($line);
$line =~ s/[ \t\r]*$//; # Remove trailing spaces
$line = clean_space_tabs($line);
@@ -107,6 +151,12 @@ foreach $f ( @ARGV ) {
@blanks = ();
$blank_bytes = 0;
}
+
+   $l_width = strwidth($line);
+   if ($max_width  $l_width  $max_width) {
+   print STDERR
+   $f:$lineno: line exceeds $max_width characters ($l_width)\n;
+   }
 }
 
 # Any blanks at the end of the file are discarded
diff --git a/scripts/cleanpatch b/scripts/cleanpatch
index a53f987..9680d03 100755
--- a/scripts/cleanpatch
+++ b/scripts/cleanpatch
@@ -7,7 +7,9 @@
 use bytes;
 use File::Basename;
 
-#
+# Default options
+$max_width = 79;
+
 # Clean up space-tab sequences, either by removing spaces or
 # replacing them with tabs.
 sub clean_space_tabs($)
@@ -48,9 +50,49 @@ sub clean_space_tabs($)
 return $lo;
 }
 
+# Compute the visual width of a string
+sub strwidth($) {
+no bytes;  # Tab alignment depends on characters
+
+my($li) = @_;
+my($c, $i);
+my $pos = 0;
+my $mlen = 0;
+
+for ($i = 0; $i  length($li); $i++) {
+   $c = substr($li,$i,1);
+   if ($c eq \t) {
+   $pos = ($pos+8)  ~7;
+   } elsif ($c eq \n) {
+   $mlen = $pos if ($pos  $mlen);
+   $pos = 0;
+   } else {
+   $pos++;
+   }
+}
+
+$mlen = $pos if ($pos  $mlen);
+return $mlen;
+}
+
 $name = basename($0);
 
-foreach $f ( @ARGV ) {
[EMAIL PROTECTED] = ();
+
+while (defined($a = shift(@ARGV))) {
+if ($a =~ /^-/) {
+   if ($a eq '-width' || $a eq '-w') {
+   $max_width = shift(@ARGV)+0;
+   } else {
+   print STDERR Usage: $name [-width #] files...\n;
+   exit 1;
+   }
+} else {
+   push(@files, $a);
+}
+}
+
+foreach $f ( @files ) {
 print STDERR $name: $f\n;
 
 if (! -f $f) {
@@ -86,6 +128,7 @@ foreach $f ( @ARGV ) {
 
 $in_bytes = 0;
 $out_bytes = 0;
+$lineno = 0;
 
 @lines  = ();
 
@@ -93,10 +136,12 @@ foreach $f ( @ARGV ) {
 $err = 0;
 
 while ( defined($line = FILE) ) {
+   $lineno++;
$in_bytes += length($line);
 
if (!$in_hunk) {
-   if ($line =~ /[EMAIL 
PROTECTED]@\s+\-([0-9]+),([0-9]+)\s+\+([0-9]+),([0-9]+)[EMAIL PROTECTED]@/) {
+   if ($line =~
+   /[EMAIL 
PROTECTED]@\s+\-([0-9]+),([0-9]+)\s+\+([0-9]+),([0-9]+)[EMAIL PROTECTED]@/) {
$minus_lines = $2;
$plus_lines = $4;
if ($minus_lines || $plus_lines) {
@@ -117,6 +162,13 @@ foreach $f ( @ARGV ) {
$text =~ s/[ \t\r]*$//; # Remove trailing spaces
$text = clean_space_tabs($text);
 
+   $l_width = strwidth($text

[kbuild-devel] [PATCH 09/19] kconfig: use POSIX equality test in check-lxdialog.sh

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 09/19] kconfig: use POSIX equality test in check-lxdialog.sh
From: Mike Frysinger [EMAIL PROTECTED]
Date: Wed, 23 May 2007 21:37:45 -0400

The == operator is not in POSIX, so use -eq instead.

Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/kconfig/lxdialog/check-lxdialog.sh |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh 
b/scripts/kconfig/lxdialog/check-lxdialog.sh
index cdca738..9681476 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -51,7 +51,7 @@ usage() {
printf Usage: $0 [-check compiler options|-header|-library]\n
 }
 
-if [ $# == 0 ]; then
+if [ $# -eq 0 ]; then
usage
exit 1
 fi
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 10/19] kbuild: add support for reading stdin with gen_init_cpio

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 10/19] kbuild: add support for reading stdin with gen_init_cpio
From: Mike Frysinger [EMAIL PROTECTED]
Date: Thu, 10 May 2007 22:44:28 -0700

Treat an argument of - as meaning read stdin for cpio files so
gen_init_cpio can be piped into.

Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 usr/gen_init_cpio.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
index 8365db6..7abc07f 100644
--- a/usr/gen_init_cpio.c
+++ b/usr/gen_init_cpio.c
@@ -498,7 +498,9 @@ int main (int argc, char *argv[])
exit(1);
}
 
-   if (! (cpio_list = fopen(argv[1], r))) {
+   if (!strcmp(argv[1], -))
+   cpio_list = stdin;
+   else if (! (cpio_list = fopen(argv[1], r))) {
fprintf(stderr, ERROR: unable to open '%s': %s\n\n,
argv[1], strerror(errno));
usage(argv[0]);
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 10/19] kbuild: add support for reading stdin with gen_init_cpio

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 10/19] kbuild: add support for reading stdin with gen_init_cpio
From: Mike Frysinger [EMAIL PROTECTED]
Date: Thu, 10 May 2007 22:44:28 -0700

Treat an argument of - as meaning read stdin for cpio files so
gen_init_cpio can be piped into.

Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 usr/gen_init_cpio.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
index 8365db6..7abc07f 100644
--- a/usr/gen_init_cpio.c
+++ b/usr/gen_init_cpio.c
@@ -498,7 +498,9 @@ int main (int argc, char *argv[])
exit(1);
}
 
-   if (! (cpio_list = fopen(argv[1], r))) {
+   if (!strcmp(argv[1], -))
+   cpio_list = stdin;
+   else if (! (cpio_list = fopen(argv[1], r))) {
fprintf(stderr, ERROR: unable to open '%s': %s\n\n,
argv[1], strerror(errno));
usage(argv[0]);
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 11/19] kbuild: add support for squashing uid/gid in gen_initramfs_list.sh

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 11/19] kbuild: add support for squashing uid/gid in 
gen_initramfs_list.sh
From: Mike Frysinger [EMAIL PROTECTED]
Date: Thu, 10 May 2007 22:44:28 -0700

Sometimes it is useful to squash all uid's/gid's to 0:0 regardless of
current owner.  For example, in build systems that get run as arbitrary
users (uClinux-dist).  This adds a special squash keyword so you can do
'-g squash -u squash' and have ownership squashed to root.

Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
Cc: Sam Ravnborg [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---
 scripts/gen_initramfs_list.sh |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 683eb12..684fb9c 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -19,11 +19,11 @@ $0 [-o file] [-u uid] [-g gid] {-d | cpio_source} 
...
-o file  Create gzipped initramfs file named file using
   gen_init_cpio and gzip
-u uid   User ID to map to user ID 0 (root).
-  uid is only meaningful if cpio_source
-  is a directory.
+  uid is only meaningful if cpio_source is a
+  directory.  squash forces all files to uid 0.
-g gid   Group ID to map to group ID 0 (root).
-  gid is only meaningful if cpio_source
-  is a directory.
+  gid is only meaningful if cpio_source is a
+  directory.  squash forces all files to gid 0.
cpio_source  File list or directory for cpio archive.
   If cpio_source is a .cpio file it will be used
   as direct input to initramfs.
@@ -113,8 +113,8 @@ parse() {
local gid=$4
local ftype=$(filetype ${location})
# remap uid/gid to 0 if necessary
-   [ $uid -eq $root_uid ]  uid=0
-   [ $gid -eq $root_gid ]  gid=0
+   [ $root_uid = squash ]  uid=0 || [ $uid -eq $root_uid ]  
uid=0
+   [ $root_gid = squash ]  gid=0 || [ $gid -eq $root_gid ]  
gid=0
local str=${mode} ${uid} ${gid}
 
[ ${ftype} == invalid ]  return 0
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 12/19] kbuild: The .paravirtprobe section is obsolete, so modpost doesn't need to handle it

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 12/19] kbuild: The .paravirtprobe section is obsolete, so 
modpost doesn't need to handle it
From: Jeremy Fitzhardinge [EMAIL PROTECTED]
Date: Tue, 29 May 2007 13:33:01 -0700

The .paravirtprobe section is obsolete, so modpost doesn't need to handle it.

Signed-off-by: Jeremy Fitzhardinge [EMAIL PROTECTED]
Cc: Rusty Russell [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/mod/modpost.c |   11 ---
 1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index f6bae03..662deba 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -637,12 +637,6 @@ static int strrcmp(const char *s, const char *sub)
  *  fromsec= .text*
  *  refsymname = logo_
  *
- * Pattern 8:
- *  Symbols contained in .paravirtprobe may safely reference .init.text.
- *  The pattern is:
- *  tosec   = .init.text
- *  fromsec  = .paravirtprobe
- *
  * Pattern 10:
  *  ia64 has machvec table for each platform and
  *  powerpc has a machine desc table for each platform.
@@ -726,11 +720,6 @@ static int secref_whitelist(const char *modname, const 
char *tosec,
(strncmp(refsymname, logo_, strlen(logo_)) == 0))
return 1;
 
-   /* Check for pattern 8 */
-   if ((strcmp(tosec, .init.text) == 0) 
-   (strcmp(fromsec, .paravirtprobe) == 0))
-   return 1;
-
/* Check for pattern 10 */
if ((strcmp(fromsec, .machvec) == 0) ||
(strcmp(fromsec, .machine.desc) == 0))
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 13/19] kbuild: ignore section mismatch warnings originating from .note section

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 13/19] kbuild: ignore section mismatch warnings originating 
from .note section
From: Sam Ravnborg [EMAIL PROTECTED]
Date: Tue, 29 May 2007 23:09:35 +0200

.note* sections are ELF notes, which are typically used by external
tools to examine the kernel image.  Since this is removed from any
runtime consideration, it's OK to reference any section from a .note*
section.

Signed-off-by: Jeremy Fitzhardinge [EMAIL PROTECTED]
Cc: Eric W. Biederman [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/mod/modpost.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 662deba..b824198 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1139,6 +1139,7 @@ static int init_section_ref_ok(const char *name)
.debug,
.parainstructions,
.rodata,
+   .note,/* ignore ELF notes - may contain 
anything */
NULL
};
/* part of section name */
@@ -1214,6 +1215,7 @@ static int exit_section_ref_ok(const char *name)
/* Start of section names */
const char *namelist2[] = {
.debug,
+   .note,/* ignore ELF notes - may contain 
anything */
NULL
};
/* part of section name */
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 14/19] kbuild: refactor code in modpost to improve maintainability

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 14/19] kbuild: refactor code in modpost to improve 
maintainability
From: Sam Ravnborg [EMAIL PROTECTED]
Date: Sat, 2 Jun 2007 21:18:51 +0200

There were a great deal of overlap between the two functions
that check which sections may reference .init.text and .exit.text.
Factor out common check to a separate function and
sort entries in the original functions.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/mod/modpost.c |  140 +++-
 1 files changed, 67 insertions(+), 73 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index b824198..2b881c2 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -858,14 +858,6 @@ static void warn_sec_mismatch(const char *modname, const 
char *fromsec,
 elf-strtab + before-st_name, refsymname))
return;
 
-   /* fromsec whitelist - without a valid 'before'
-* powerpc has a GOT table in .got2 section
-* and also a .toc section */
-   if (strcmp(fromsec, .got2) == 0)
-   return;
-   if (strcmp(fromsec, .toc) == 0)
-   return;
-
if (before  after) {
warn(%s(%s+0x%llx): Section mismatch: reference to %s:%s 
 (between '%s' and '%s')\n,
@@ -1075,6 +1067,60 @@ static void check_sec_ref(struct module *mod, const char 
*modname,
}
 }
 
+/*
+ * Identify sections from which references to either a
+ * .init or a .exit section is OK.
+ *
+ * [OPD] Keith Ownes [EMAIL PROTECTED] commented:
+ * For our future {in}sanity, add a comment that this is the ppc .opd
+ * section, not the ia64 .opd section.
+ * ia64 .opd should not point to discarded sections.
+ * [.rodata] like for .init.text we ignore .rodata references -same reason
+ **/
+static int initexit_section_ref_ok(const char *name)
+{
+   const char **s;
+   /* Absolute section names */
+   const char *namelist1[] = {
+   __bug_table,  /* used by powerpc for BUG() */
+   __ex_table,
+   .altinstructions,
+   .fixup,
+   .opd, /* See comment [OPD] */
+   .parainstructions,
+   .pdr,
+   .plt, /* seen on ARCH=um build on x86_64. 
Harmless */
+   .smp_locks,
+   .stab,
+   NULL
+   };
+   /* Start of section names */
+   const char *namelist2[] = {
+   .debug,
+   .eh_frame,
+   .note,/* ignore ELF notes - may contain 
anything */
+   .got, /* powerpc - global offset table */
+   .toc, /* powerpc - table of contents */
+   NULL
+   };
+   /* part of section name */
+   const char *namelist3 [] = {
+   .unwind,  /* Sample: IA_64.unwind.exit.text */
+   NULL
+   };
+
+   for (s = namelist1; *s; s++)
+   if (strcmp(*s, name) == 0)
+   return 1;
+   for (s = namelist2; *s; s++)
+   if (strncmp(*s, name, strlen(*s)) == 0)
+   return 1;
+   for (s = namelist3; *s; s++)
+   if (strstr(name, *s) != NULL)
+   return 1;
+   return 0;
+}
+
 /**
  * Functions used only during module init is marked __init and is stored in
  * a .init.text section. Likewise data is marked __initdata and stored in
@@ -,52 +1157,32 @@ static int init_section_ref_ok(const char *name)
const char **s;
/* Absolute section names */
const char *namelist1[] = {
+   __ftr_fixup,  /* powerpc cpu feature fixup */
+   __fw_ftr_fixup,   /* powerpc firmware feature fixup */
+   __param,
+   .data.rel.ro, /* used by parisc64 */
.init,
-   .opd,   /* see comment [OPD] at exit_section_ref_ok() */
-   .toc1,  /* used by ppc64 */
-   .stab,
-   .data.rel.ro, /* used by parisc64 */
-   .parainstructions,
-   .text.lock,
-   __bug_table, /* used by powerpc for BUG() */
.pci_fixup_header,
.pci_fixup_final,
-   .pdr,
-   __param,
-   __ex_table,
-   .fixup,
-   .smp_locks,
-   .plt,  /* seen on ARCH=um build on x86_64. Harmless */
-   __ftr_fixup,  /* powerpc cpu feature fixup */
-   __fw_ftr_fixup,   /* powerpc firmware feature fixup */
+   .text.lock,
NULL
};
/* Start of section names */
const char *namelist2[] = {
.init.,
-   .altinstructions,
-   .eh_frame,
-   .debug,
-   .parainstructions,
.rodata,
-   .note

[kbuild-devel] [PATCH 15/19] kbuild: warn about references from .init.text to .exit.text

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 15/19] kbuild: warn about references from .init.text to 
.exit.text
From: Sam Ravnborg [EMAIL PROTECTED]
Date: Sat, 2 Jun 2007 21:29:20 +0200

The .exit.text section may be discarded either at build or at runtime.
So let modpost warn if this situation is detected.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/mod/modpost.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 2b881c2..0f9130f 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1216,7 +1216,6 @@ static int exit_section_ref_ok(const char *name)
.exit.data,
.exit.text,
.exitcall.exit,
-   .init.text,
.rodata,
NULL
};
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 16/19] kbuild: remove hardcoded apic_es7000 from modpost

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 16/19] kbuild: remove hardcoded apic_es7000 from modpost
From: Sam Ravnborg [EMAIL PROTECTED]
Date: Sun, 3 Jun 2007 00:05:10 +0200

Replace the hardcoded variable name apic_es7000 in modpost
with a __initdata_refok marker.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 arch/i386/mach-generic/es7000.c |2 +-
 scripts/mod/modpost.c   |1 -
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/i386/mach-generic/es7000.c b/arch/i386/mach-generic/es7000.c
index b47f951..4742626 100644
--- a/arch/i386/mach-generic/es7000.c
+++ b/arch/i386/mach-generic/es7000.c
@@ -66,4 +66,4 @@ static int __init acpi_madt_oem_check(char *oem_id, char 
*oem_table_id)
 }
 #endif
 
-struct genapic apic_es7000 = APIC_INIT(es7000, probe_es7000);
+struct genapic __initdata_refok apic_es7000 = APIC_INIT(es7000, 
probe_es7000);
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 0f9130f..877ed0c 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -657,7 +657,6 @@ static int secref_whitelist(const char *modname, const char 
*tosec,
_probe,
_probe_one,
_console,
-   apic_es7000,
NULL
};
 
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 17/19] kbuild: refactor code in modpost

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 17/19] kbuild: refactor code in modpost
From: Sam Ravnborg [EMAIL PROTECTED]
Date: Sun, 3 Jun 2007 00:41:22 +0200

Move more checks from whitelist to the section check functions
Renumber the patterns.
No functional changes.
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/mod/modpost.c |   33 +++--
 1 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 877ed0c..f0474a9 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -612,14 +612,10 @@ static int strrcmp(const char *s, const char *sub)
  *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console
  *
  * Pattern 3:
- *   Whitelist all references from .pci_fixup* section to .init.text
- *   This is part of the PCI init when built-in
- *
- * Pattern 4:
  *   Whitelist all refereces from .text.head to .init.data
  *   Whitelist all refereces from .text.head to .init.text
  *
- * Pattern 5:
+ * Pattern 4:
  *   Some symbols belong to init section but still it is ok to reference
  *   these from non-init sections as these symbols don't have any memory
  *   allocated for them and symbol address and value are same. So even
@@ -628,7 +624,7 @@ static int strrcmp(const char *s, const char *sub)
  *   This pattern is identified by
  *   refsymname = __init_begin, _sinittext, _einittext
  *
- * Pattern 7:
+ * Pattern 5:
  *  Logos used in drivers/video/logo reside in __initdata but the
  *  funtion that references them are EXPORT_SYMBOL() so cannot be
  *  marker __init. So we whitelist them here.
@@ -636,12 +632,6 @@ static int strrcmp(const char *s, const char *sub)
  *  tosec  = .init.data
  *  fromsec= .text*
  *  refsymname = logo_
- *
- * Pattern 10:
- *  ia64 has machvec table for each platform and
- *  powerpc has a machine desc table for each platform.
- *  It is mixture of function pointers of .init.text and .text.
- *  fromsec  = .machvec | .machine.desc
  **/
 static int secref_whitelist(const char *modname, const char *tosec,
const char *fromsec, const char *atsym,
@@ -698,32 +688,22 @@ static int secref_whitelist(const char *modname, const 
char *tosec,
return 1;
 
/* Check for pattern 3 */
-   if ((strncmp(fromsec, .pci_fixup, strlen(.pci_fixup)) == 0) 
-   (strcmp(tosec, .init.text) == 0))
-   return 1;
-
-   /* Check for pattern 4 */
if ((strcmp(fromsec, .text.head) == 0) 
((strcmp(tosec, .init.data) == 0) ||
(strcmp(tosec, .init.text) == 0)))
return 1;
 
-   /* Check for pattern 5 */
+   /* Check for pattern 4 */
for (s = pat3refsym; *s; s++)
if (strcmp(refsymname, *s) == 0)
return 1;
 
-   /* Check for pattern 7 */
+   /* Check for pattern 5 */
if ((strcmp(tosec, .init.data) == 0) 
(strncmp(fromsec, .text, strlen(.text)) == 0) 
(strncmp(refsymname, logo_, strlen(logo_)) == 0))
return 1;
 
-   /* Check for pattern 10 */
-   if ((strcmp(fromsec, .machvec) == 0) ||
-   (strcmp(fromsec, .machine.desc) == 0))
-   return 1;
-
return 0;
 }
 
@@ -1085,6 +1065,8 @@ static int initexit_section_ref_ok(const char *name)
__ex_table,
.altinstructions,
.fixup,
+   .machvec, /* ia64 + powerpc uses these */
+   .machine.desc,
.opd, /* See comment [OPD] */
.parainstructions,
.pdr,
@@ -1161,14 +1143,13 @@ static int init_section_ref_ok(const char *name)
__param,
.data.rel.ro, /* used by parisc64 */
.init,
-   .pci_fixup_header,
-   .pci_fixup_final,
.text.lock,
NULL
};
/* Start of section names */
const char *namelist2[] = {
.init.,
+   .pci_fixup,
.rodata,
NULL
};
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 18/19] kbuild: remove hardcoded _logo names from modpost

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 18/19] kbuild: remove hardcoded _logo names from modpost
From: Sam Ravnborg [EMAIL PROTECTED]
Date: Sun, 3 Jun 2007 00:47:53 +0200

Replaced this with a __init_refok marker
in front of fb_find_logo().

I think that the __initdata marker for the logo's are
wrong but I have not justified this so I did not remove it.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 drivers/video/logo/logo.c |7 +--
 scripts/mod/modpost.c |   14 --
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c
index 80c0361..2b0f799 100644
--- a/drivers/video/logo/logo.c
+++ b/drivers/video/logo/logo.c
@@ -34,8 +34,11 @@ extern const struct linux_logo logo_superh_vga16;
 extern const struct linux_logo logo_superh_clut224;
 extern const struct linux_logo logo_m32r_clut224;
 
-
-const struct linux_logo *fb_find_logo(int depth)
+/* logo's are marked __initdata. Use __init_refok to tell
+ * modpost that it is intended that this function uses data
+ * marked __initdata.
+ */
+const struct linux_logo * __init_refok fb_find_logo(int depth)
 {
const struct linux_logo *logo = NULL;
 
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index f0474a9..96078bb 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -624,14 +624,6 @@ static int strrcmp(const char *s, const char *sub)
  *   This pattern is identified by
  *   refsymname = __init_begin, _sinittext, _einittext
  *
- * Pattern 5:
- *  Logos used in drivers/video/logo reside in __initdata but the
- *  funtion that references them are EXPORT_SYMBOL() so cannot be
- *  marker __init. So we whitelist them here.
- *  The pattern is:
- *  tosec  = .init.data
- *  fromsec= .text*
- *  refsymname = logo_
  **/
 static int secref_whitelist(const char *modname, const char *tosec,
const char *fromsec, const char *atsym,
@@ -698,12 +690,6 @@ static int secref_whitelist(const char *modname, const 
char *tosec,
if (strcmp(refsymname, *s) == 0)
return 1;
 
-   /* Check for pattern 5 */
-   if ((strcmp(tosec, .init.data) == 0) 
-   (strncmp(fromsec, .text, strlen(.text)) == 0) 
-   (strncmp(refsymname, logo_, strlen(logo_)) == 0))
-   return 1;
-
return 0;
 }
 
-- 
1.5.1.rc3.1544.g8a923


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 19/19] kbuild: whitelist references from variables named _timer to .init.text

2007-06-03 Thread Sam Ravnborg
Subject: [PATCH 19/19] kbuild: whitelist references from variables named _timer 
to .init.text
From: Sam Ravnborg [EMAIL PROTECTED]
Date: Sun, 3 Jun 2007 22:19:24 +0200

arm uses a lot of ops structures named *_timer that has legitimite
references to .init.text.
So let's add this variable to the list of variables that may reference
.init.text without causing any warning.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---
 scripts/mod/modpost.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 96078bb..51921aa 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -609,7 +609,7 @@ static int strrcmp(const char *s, const char *sub)
  *   the pattern is identified by:
  *   tosec   = .init.text | .exit.text | .init.data
  *   fromsec = .data
- *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console
+ *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, 
*_console, *_timer
  *
  * Pattern 3:
  *   Whitelist all refereces from .text.head to .init.data
@@ -634,6 +634,7 @@ static int secref_whitelist(const char *modname, const char 
*tosec,
const char *pat2sym[] = {
driver,
_template, /* scsi uses *_template a lot */
+   _timer,/* arm uses ops structures named _timer a lot */
_sht,  /* scsi also used *_sht to some extent */
_ops,
_probe,
@@ -1149,6 +1150,10 @@ static int init_section_ref_ok(const char *name)
for (s = namelist2; *s; s++)
if (strncmp(*s, name, strlen(*s)) == 0)
return 1;
+
+   /* If section name ends with .init we allow references
+* as is the case with .initcallN.init, .early_param.init, 
.taglist.init etc
+*/
if (strrcmp(name, .init) == 0)
return 1;
return 0;
-- 
1.5.1.rc3.1544.g8a923

- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] kbuild update

2007-06-03 Thread Sam Ravnborg
Hmm, the patch serie should have been chained.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [rfe] easier customization of kconfig for non-Linux projects

2007-05-24 Thread Sam Ravnborg
Hi Mike.

Forwarding this to Roman Zippel which is the kconfig maintainer.

The intent with this is clear but the solution you suggest albeit simple
does not really match where we could end up with kconfig.
Recently Roman added support for options in the kconfig language
and I would assume we could deal with most of this just using options.

One example could be to support options for the mainmenu entrye like this:

mainmenu Busybow config system
option project=Busybox
option version=$VERSION   = Where '$' signify an environment variable

etc etc.

In this way we could later distribute kconfig as a binary instead
of building it into the source as today.

Sam

On Thu, May 24, 2007 at 01:17:39AM -0400, Mike Frysinger wrote:
 since kconfig is such a nice build system, more projects other than the Linux
 kernel have started to integrate it (like uClibc and busybox) ... it'd be nice
 if it were easier to customize for each project so that when we pull down the
 latest version, we dont have to go through and tweak all of the strings again.
 what do you think of something like the attached patch ?  i doubt i caught all
 the places that'd need to be changed, but this should give a pretty good
 picture of what we'd like to have.
 
 Signed-off-by: Mike Frysinger [EMAIL PROTECTED]
 ---
 --- a/scripts/kconfig/lkc_local.h
 +++ b/scripts/kconfig/lkc_local.h
 @@ -0,0 +1,15 @@
 +/*
 + * Customize kconfig to your project.
 + *
 + * Released under the terms of the GNU GPL v2.0.
 + */
 +
 +#ifndef LKC_LOCAL_H
 +#define LKC_LOCAL_H
 +
 +#define PROJECT   Linux Kernel
 +#define PROJECT_INFORMAL  kernel
 +#define VERSION_SYMBOLKERNELVERSION
 +#define AUTOCONF_DEFINE   AUTOCONF_INCLUDED
 +
 +#endif
 diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
 index 1199baf..a5f5102 100644
 --- a/scripts/kconfig/conf.c
 +++ b/scripts/kconfig/conf.c
 @@ -557,8 +557,8 @@ int main(int ac, char **av)
   case ask_silent:
   if (stat(.config, tmpstat)) {
   printf(_(***\n
 - *** You have not yet configured your kernel!\n
 - *** (missing kernel .config file)\n
 + *** You have not yet configured your  
 PROJECT_INFORMAL !\n
 + *** (missing  PROJECT_INFORMAL  .config 
 file)\n
   ***\n
   *** Please run some configurator (e.g. \make 
 oldconfig\ or\n
   *** \make menuconfig\ or \make 
 xconfig\).\n
 @@ -604,7 +604,7 @@ int main(int ac, char **av)
   } else if (conf_get_changed()) {
   name = getenv(KCONFIG_NOSILENTUPDATE);
   if (name  *name) {
 - fprintf(stderr, _(\n*** Kernel configuration requires 
 explicit update.\n\n));
 + fprintf(stderr, _(\n***  PROJECT  configuration 
 requires explicit update.\n\n));
   return 1;
   }
   } else
 @@ -615,12 +615,12 @@ int main(int ac, char **av)
   check_conf(rootmenu);
   } while (conf_cnt);
   if (conf_write(NULL)) {
 - fprintf(stderr, _(\n*** Error during writing of the kernel 
 configuration.\n\n));
 + fprintf(stderr, _(\n*** Error during writing of the  
 PROJECT_INFORMAL  configuration.\n\n));
   return 1;
   }
  skip_check:
   if (input_mode == ask_silent  conf_write_autoconf()) {
 - fprintf(stderr, _(\n*** Error during writing of the kernel 
 configuration.\n\n));
 + fprintf(stderr, _(\n*** Error during writing of the  
 PROJECT_INFORMAL  configuration.\n\n));
   return 1;
   }
  
 diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
 index 664fe29..06366ed 100644
 --- a/scripts/kconfig/confdata.c
 +++ b/scripts/kconfig/confdata.c
 @@ -416,7 +416,7 @@ int conf_write(const char *name)
   if (!out)
   return 1;
  
 - sym = sym_lookup(KERNELVERSION, 0);
 + sym = sym_lookup(VERSION_SYMBOL, 0);
   sym_calc_value(sym);
   time(now);
   env = getenv(KCONFIG_NOTIMESTAMP);
 @@ -425,7 +425,7 @@ int conf_write(const char *name)
  
   fprintf(out, _(#\n
  # Automatically generated make config: don't edit\n
 -# Linux kernel version: %s\n
 +#  PROJECT  version: %s\n
  %s%s
  #\n),
sym_get_string_value(sym),
 @@ -672,21 +672,21 @@ int conf_write_autoconf(void)
   return 1;
   }
  
 - sym = sym_lookup(KERNELVERSION, 0);
 + sym = sym_lookup(VERSION_SYMBOL, 0);
   sym_calc_value(sym);
   time(now);
   fprintf(out, #\n
# Automatically generated make config: don't edit\n
 -  # Linux kernel version: %s\n
 +  #  PROJECT  version: %s\n
# %s

Re: [kbuild-devel] [rfe] easier customization of kconfig for non-Linux projects

2007-05-24 Thread Sam Ravnborg
On Thu, May 24, 2007 at 09:23:40AM -0400, Mike Frysinger wrote:
 On Thursday 24 May 2007, Sam Ravnborg wrote:
  The intent with this is clear but the solution you suggest albeit simple
  does not really match where we could end up with kconfig.
  Recently Roman added support for options in the kconfig language
  and I would assume we could deal with most of this just using options.
 
 that certainly sounds nicer :)
 
  One example could be to support options for the mainmenu entrye like this:
 
  mainmenu Busybow config system
  option project=Busybox
  option version=$VERSION   = Where '$' signify an environment variable
 
 this is doable now ?  if so, i'll test it out in uClibc ...
No - it was just a proposal.
Would like to have a word from Roman before looking deeper into it.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] vmlinux.lds not marked for update when building on OS X and changing config options

2007-05-22 Thread Sam Ravnborg
On Mon, May 21, 2007 at 05:08:23PM -0400, Mike Frysinger wrote:
 i'm not terribly familiar with the kconfig/kbuild system so i'm
 looking for some pointers so i can track down the root cause here ...
 
 some people like to cross-compile the Blackfin kernel on OS X hosts
 and we noticed that in some cases the vmlinux.lds linker script is not
 properly regenerated when changing some options in the kernel config
 menu ... it works just fine on all our Linux hosts :)
 
 linux/arch/blackfin/kernel/vmlinux.lds.S has this:
 MEMORY
 {
 ram : ORIGIN = CONFIG_BOOT_LOAD,
 ...
 
 and in linux/arch/blackfin/Kconfig, we have:
 config BOOT_LOAD
 hex Kernel load address
 default 0x1000
 
 if vmlinux.lds does not exist yet, running `make` generates the proper
 file.  but if we do `make menuconfig` and update just BOOT_LOAD to say
 0x4000 and then run `make`, vmlinux.lds is not regenerated.
 
 doing `rm -f` on vmlinux.lds and re-running `make` once again produces
 the correct file
 
 any pointers on where to dig ? :)

The file arch/blackfin/kernel/.vmlinux.lds.cmd should look like this:
cmd_arch/i386/kernel/vmlinux.lds := i686-unknown-linux-gnu-gcc -m32 -E 
-Wp,-MD,arch/i386/kernel/.vmlinux.lds.d  -nostdinc -isystem 
/opt/crosstool/gcc-4.1.0-glibc-2.3.6/i686-unknown-linux-gnu/lib/gcc/i686-unknown-linux-gnu/4.1.0/include
 -D__KERNEL__ -I/home/sam/kernel/kbuild-fix.git/include -Iinclude 
-I/home/sam/kernel/kbuild-fix.git/include2 -Iinclude2  
-I/home/sam/kernel/kbuild-fix.git/include -include include/linux/autoconf.h -P 
-C -Ui386 -D__ASSEMBLY__ -o arch/i386/kernel/vmlinux.lds 
/home/sam/kernel/kbuild-fix.git/arch/i386/kernel/vmlinux.lds.S

deps_arch/i386/kernel/vmlinux.lds := \
  /home/sam/kernel/kbuild-fix.git/arch/i386/kernel/vmlinux.lds.S \
$(wildcard include/config/blk/dev/initrd.h) \
  /home/sam/kernel/kbuild-fix.git/include/asm-generic/vmlinux.lds.h \
  include2/asm/thread_info.h \
$(wildcard include/config/4kstacks.h) \
$(wildcard include/config/debug/stack/usage.h) \
  /home/sam/kernel/kbuild-fix.git/include/linux/compiler.h \
  

Could you please check this.

The line that says:
deps_arch/blackfin/kernel/vmlinux.lds := \ 
list all the files that the .lds file is dependent on (the prerequisites).
For the config option BOOT_LOAD look for include/config/boot/load

Check that this file gets properly update on OS X.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [PATCH] Fix mconf segmentation fault

2007-05-06 Thread Sam Ravnborg
On Sat, May 05, 2007 at 10:49:00PM +0200, Marcin Garski wrote:
 Hi,
 
 I have found small bug in mconf, when you run it without any argument it 
 will sigsegv.
 
 Without patch:
 $ scripts/kconfig/mconf
 Segmentation fault
 
 With patch:
 $ scripts/kconfig/mconf
 can't find file (null)
 
 Signed-off-by: Marcin Garski [EMAIL PROTECTED]

Thanks, applied.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [PATCH 1/2] kbuild: prepare for using code from different dir

2007-05-06 Thread Sam Ravnborg
On Sat, May 05, 2007 at 01:43:22PM -0700, H. Peter Anvin wrote:
 Sam Ravnborg wrote:
  
  This will likely appear in my kbuild.git tree but only
  when next mergewindow opens I think.
  My current batch (35 commits) has not yet been pulled
  and this would no see exposure in -mm first.
  
 
 Cool.  I have a workaround (the old trick of building sideways objects
 as used by for example oprofile) for the moment.  It turns out Andi has
 changes in his tree which means boot/compressed cannot be unified, so
 this works for me for the time being, and we can clean it up later.

I decided to push this before current merge window closed so hopefully
it is in within a few days so you can rebase.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] [PATCH 1/2] kbuild: prepare for using code from different dir

2007-05-05 Thread Sam Ravnborg
To introduce support for source in one directory but output files
in another directory during a non O= build prefix all paths
with $(src) repsectively $(obj).

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---

This will likely appear in my kbuild.git tree but only
when next mergewindow opens I think.
My current batch (35 commits) has not yet been pulled
and this would no see exposure in -mm first.

I have compiled i386 + x86_64 in an allmodconfig with
no problems so the common stuff works.

Sam

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e2ad2dc..a525112 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -131,13 +131,13 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi)
 quiet_cmd_cc_s_c = CC $(quiet_modtag)  $@
 cmd_cc_s_c   = $(CC) $(c_flags) -fverbose-asm -S -o $@ $
 
-%.s: %.c FORCE
+$(obj)/%.s: $(src)/%.c FORCE
$(call if_changed_dep,cc_s_c)
 
 quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@
 cmd_cc_i_c   = $(CPP) $(c_flags)   -o $@ $
 
-%.i: %.c FORCE
+$(obj)/%.i: $(src)/%.c FORCE
$(call if_changed_dep,cc_i_c)
 
 quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
@@ -146,7 +146,7 @@ cmd_cc_symtypes_c  = \
| $(GENKSYMS) -T $@ /dev/null; \
test -s $@ || rm -f $@
 
-%.symtypes : %.c FORCE
+$(obj)/%.symtypes : $(src)/%.c FORCE
$(call if_changed_dep,cc_symtypes_c)
 
 # C (.c) files
@@ -198,14 +198,13 @@ define rule_cc_o_c
 endef
 
 # Built-in and composite module parts
-
-%.o: %.c FORCE
+$(obj)/%.o: $(src)/%.c FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)
 
 # Single-part modules are special since we need to mark them in $(MODVERDIR)
 
-$(single-used-m): %.o: %.c FORCE
+$(single-used-m): $(obj)/%.o: $(src)/%.c FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)
@{ echo $(@:.o=.ko); echo $@; }  $(MODVERDIR)/$(@F:.o=.mod)
@@ -215,7 +214,7 @@ quiet_cmd_cc_lst_c = MKLST   $@
 $(CONFIG_SHELL) $(srctree)/scripts/makelst $*.o \
 System.map $(OBJDUMP)  $@
 
-%.lst: %.c FORCE
+$(obj)/%.lst: $(src)/%.c FORCE
$(call if_changed_dep,cc_lst_c)
 
 # Compile assembler sources (.S)
@@ -229,13 +228,13 @@ $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
 quiet_cmd_as_s_S = CPP $(quiet_modtag) $@
 cmd_as_s_S   = $(CPP) $(a_flags)   -o $@ $ 
 
-%.s: %.S FORCE
+$(obj)/%.s: $(src)/%.S FORCE
$(call if_changed_dep,as_s_S)
 
 quiet_cmd_as_o_S = AS $(quiet_modtag)  $@
 cmd_as_o_S   = $(CC) $(a_flags) -c -o $@ $
 
-%.o: %.S FORCE
+$(obj)/%.o: $(src)/%.S FORCE
$(call if_changed_dep,as_o_S)
 
 targets += $(real-objs-y) $(real-objs-m) $(lib-y)
@@ -246,7 +245,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(always)
 quiet_cmd_cpp_lds_S = LDS $@
   cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $
 
-%.lds: %.lds.S FORCE
+$(obj)/%.lds: $(src)/%.lds.S FORCE
$(call if_changed_dep,cpp_lds_S)
 
 # Build the compiled-in targets
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 575afbe..6943a7a 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -114,7 +114,7 @@ hostcxx_flags  = -Wp,-MD,$(depfile) $(__hostcxx_flags)
 quiet_cmd_host-csingle = HOSTCC  $@
   cmd_host-csingle = $(HOSTCC) $(hostc_flags) -o $@ $ \
$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-csingle): %: %.c FORCE
+$(host-csingle): $(obj)/%: $(src)/%.c FORCE
$(call if_changed_dep,host-csingle)
 
 # Link an executable based on list of .o files, all plain c
@@ -123,14 +123,14 @@ quiet_cmd_host-cmulti = HOSTLD  $@
   cmd_host-cmulti  = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
  $(addprefix $(obj)/,$($(@F)-objs)) \
  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE
+$(host-cmulti): $(obj)/%: $(host-cobjs) $(host-cshlib) FORCE
$(call if_changed,host-cmulti)
 
 # Create .o file from a single .c file
 # host-cobjs - .o
 quiet_cmd_host-cobjs   = HOSTCC  $@
   cmd_host-cobjs   = $(HOSTCC) $(hostc_flags) -c -o $@ $
-$(host-cobjs): %.o: %.c FORCE
+$(host-cobjs): $(obj)/%.o: $(src)/%.c FORCE
$(call if_changed_dep,host-cobjs)
 
 # Link an executable based on list of .o files, a mixture of .c and .cc
@@ -140,20 +140,20 @@ quiet_cmd_host-cxxmulti   = HOSTLD  $@
  $(foreach o,objs cxxobjs,\
  $(addprefix $(obj)/,$($(@F)-$(o \
  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cxxmulti): %: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE
+$(host-cxxmulti): $(obj)/%: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE
$(call if_changed,host-cxxmulti)
 
 # Create .o file from a single .cc (C++) file
 quiet_cmd_host-cxxobjs = HOSTCXX $@
   cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $
-$(host-cxxobjs

[kbuild-devel] [PATCH 2/2] newsetup: let x86_64 and i386 share same Makefile

2007-05-05 Thread Sam Ravnborg
Using the possibility to assing src to another dir we can now
share the same code for i386 and x86_64 with output files
located in the dir of the architecture.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---

We could have avoided the arch/x86_64/boot/Makefile
by changes all $(MAKE) invocations from
arch/x86_64/Makefile but addind an almost empty
Makefile seemed to be less 'magic'.

Sam


 i386/boot/Makefile   |   23 +++
 x86_64/boot/Makefile |  163 +--
 3 files changed, 18 insertions(+), 172 deletions(-)


diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile
index 4ebdc68..0a812ef 100644
--- a/arch/i386/boot/Makefile
+++ b/arch/i386/boot/Makefile
@@ -1,9 +1,5 @@
 #
-# arch/i386/boot/Makefile
-#
-# This file is subject to the terms and conditions of the GNU General Public
-# License.  See the file COPYING in the main directory of this archive
-# for more details.
+# Makefile for boot part of x86
 #
 # Copyright (C) 1994 by Linus Torvalds
 #
@@ -37,7 +33,10 @@ setup-y  += printf.o string.o tty.o video.o 
version.o voyager.o
 setup-y+= video-vga.o
 setup-y+= video-vesa.o
 
-hostprogs-y:= tools/build
+targets += $(setup-y)
+
+buildtool  := tools/build
+hostprogs-y:= $(buildtool)
 
 HOSTCFLAGS_build.o := $(LINUXINCLUDE)
 
@@ -46,8 +45,9 @@ HOSTCFLAGS_build.o := $(LINUXINCLUDE)
 # How to compile the 16-bit code.  Note we always compile for -march=i386,
 # that way we can complain to the user if the CPU is insufficient.
 CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP \
-  -march=i386 -mregparm=3 -fno-strict-aliasing \
-  $(call cc-option, -ffreestanding)
+  -m32 -march=i386 -mregparm=3 -fno-strict-aliasing \
+  $(call cc-option, -ffreestanding) \
+   $(call cc-option, -fno-stack-protector)
 AFLAGS := $(CFLAGS) -D__ASSEMBLY__
 
 $(obj)/zImage:  IMAGE_OFFSET := 0x1000
@@ -57,11 +57,11 @@ $(obj)/bzImage: EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK) 
-D__BIG_KERNEL__
 $(obj)/bzImage: BUILDFLAGS   := -b
 
 quiet_cmd_image = BUILD   $@
-cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/setup.bin \
+cmd_image = $(obj)/$(buildtool) $(BUILDFLAGS) $(obj)/setup.bin \
$(obj)/vmlinux.bin $(ROOT_DEV)  $@
 
 $(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \
- $(obj)/vmlinux.bin $(obj)/tools/build FORCE
+ $(obj)/vmlinux.bin $(obj)/$(buildtool) FORCE
$(call if_changed,image)
@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
 
@@ -154,4 +154,5 @@ zlilo: $(BOOTIMAGE)
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
 
 install:
-   sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) 
System.map $(INSTALL_PATH)
+   sh $(srctree)/$(src)/install.sh \
+   $(KERNELRELEASE) $(BOOTIMAGE) System.map $(INSTALL_PATH)
diff --git a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile
index f5c500d..6d8afcb 100644
--- a/arch/x86_64/boot/Makefile
+++ b/arch/x86_64/boot/Makefile
@@ -1,161 +1,6 @@
 #
-# arch/x86_64/boot/Makefile
+# boot infrastructure shared with i386
+# Use src from i386 but locate all object files here
 #
-# This file is subject to the terms and conditions of the GNU General Public
-# License.  See the file COPYING in the main directory of this archive
-# for more details.
-#
-# Copyright (C) 1994 by Linus Torvalds
-#
-
-# ROOT_DEV specifies the default root-device when making the image.
-# This can be either FLOPPY, CURRENT, /dev/ or empty, in which case
-# the default of FLOPPY is used by 'build'.
-
-ROOT_DEV := CURRENT
-
-# If you want to preset the SVGA mode, uncomment the next line and
-# set SVGA_MODE to whatever number you want.
-# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
-# The number is the same as you would ordinarily press at bootup.
-
-SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
-
-# If you want the RAM disk device, define this to be the size in blocks.
-
-#RAMDISK := -DRAMDISK=512
-
-targets:= vmlinux.bin setup.bin setup.elf zImage bzImage
-subdir-:= compressed
-
-Setup-y+= a20.o apm.o cmdline.o copy.o cpu.o edd.o
-Setup-y+= header.o main.o mca.o memory.o pm.o pmjump.o
-Setup-y+= printf.o string.o tty.o video.o version.o voyager.o
-
-# The link order of the video-*.o modules can matter.  In particular,
-# video-vga.o *must* be listed first.
-Setup-y+= video-vga.o
-Setup-y+= video-vesa.o
-
-setup-y= $(addprefix ../../i386/boot/, $(Setup-y))
-
-buildtool  := ../../i386/boot/tools/build
-hostprogs-y:= $(buildtool)
-
-HOSTCFLAGS_build.o := $(LINUXINCLUDE)
-
-# ---
-
-# How to compile the 16-bit code.  Note we always compile for -march=i386

Re: [kbuild-devel] Building out of a different source branch

2007-05-03 Thread Sam Ravnborg
On Thu, May 03, 2007 at 10:47:48AM -0700, H. Peter Anvin wrote:
 Hello,
 
 I would like to get rid of arch/x86_64/boot, which *should* be binary
 identical with arch/i386/boot (it's not right now, but I'm fixing that.)
 
 Is there a way to make Kbuild decend so that src=arch/i386/boot but
 obj=arch/x86_64/boot (which may entail having to create directories even
 when not compiling with O=?)  It seems the infrastructure is already there.

There is no way to do that today - despite some part of the
infrastructure is prepared as you have noticed.

Would it be OK if we have arch/x86_64/boot present and have stub Makefiles
in all directories?
If thats OK I can try to cook up something.

It has been discussed to put all common stuff in arch/x86 which would anyway
call for a generic solution. For kbuild it does not matter if src shall be
located in i386 or x86 directory structure.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Override autoconf.h fixdep intelligence

2007-04-24 Thread Sam Ravnborg
On Tue, Apr 24, 2007 at 04:15:54PM +1000, John Williams wrote:
 Hello,
 
 Is there a sensible way of forcing a .c file to be explicitly dependent 
 on autoconf.h, thus bypassing the CONFIG_ dependency intelligence built 
 into fixdep?

The easy trick is to add an explicit dependency on .config like this:

$(obj)/foobar.o: .config

We use a similar way of doing things in kernel/Makefile whre we parse up
the content of the .config file.

That said I would question your use of CONFIG variables but without
knowing the actual context it is hard to see why such obsfucating is needed.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] make install with nfs root_squash

2007-04-19 Thread Sam Ravnborg
On Thu, Apr 19, 2007 at 10:59:23AM -0400, Frank Mori Hess wrote:
 On Wednesday 18 April 2007 16:39 pm, you wrote:
   Is there any reason that a make modules_install has to modify files in
   the source tree?
 
  This should not happen. (I do not know the root_squash option but that
  should not matter).
  Can you please try:
  make V=1 modules_install
  and post the output.
 
 Oops, it turns out the problem was actually occurring during make modules 
 not make modules_install.  I'm calling kbuild through some autoconf 
 generated Makefiles, and autoconf always wants the install target to depend 
 on the all target.  This results in the kernel's make modules getting 
 re-run as root before make modules_install.  This fails due to 
 the .tmp_versions and similar getting unconditionally rebuilt during make 
 modules (output attached).  
 
 I've worked around it by having the autoconf make all target ignore errors 
 from the invocation of the kernel's make modules.

OK - thanks for reporting back the real issue.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] make install with nfs root_squash

2007-04-18 Thread Sam Ravnborg
On Wed, Apr 18, 2007 at 03:27:53PM -0400, Frank Mori Hess wrote:
 Hi,
 
 I'm encountering some annoyances building (out-of-tree) modules on an NFS 
 filesystem.  The NFS filesystem is exported with the default root_squash 
 option.  When I build as a normal user, then su to root to do the final make 
 modules_install, it fails with permission denied.  For example, 
 modules_install tries to delete all the files in the .tmp_versions 
 subdirectory, or tries to write to Module.symvers, but the nfs root_squash 
 prevents root from having any special write permissions.  I've verified this 
 problem with 2.6.18 and 2.6.20 kernels.  It didn't happen with the old kernel 
 I was using (2.6.8).
 
 Is there any reason that a make modules_install has to modify files in the 
 source tree?
This should not happen. (I do not know the root_squash option but that should
not matter).
Can you please try:
make V=1 modules_install
and post the output.

Sam

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] thoughts on an official Kconfig maturity option

2007-04-12 Thread Sam Ravnborg
On Thu, Apr 12, 2007 at 11:35:21AM -0400, Robert P. J. Day wrote:
 
   rather than post to the LKML, is this the right forum to ask about
 implementing an actual maturity directive in the build
 infrastructure?  thanks.

Hi rday.
No this is not the right forum for this question - lkml is a much better
forum due to the wider audience.

Today we have a number of related config's:
BROKEN, BROKEN_ON_SMP
EXPERIMENTAL

Reality tells us that the Code maturity level configs are often
mis maintained. As an example many drivers tagged EXPERIMENTAL
are used in production environments and distributions often define
EXPERIMENTAL.

And the actual value of more fine grained maturity level is questionable.
It needs to be used consistently or it will not be of any real value.
And we cannot make thet work with the single EXPERIMENTAL so making
it more fine-tuned will have little possibility for success.

Sam

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [PATCH] kbuild: move tags from ARCH and include/ ahead of drivers

2007-03-17 Thread Sam Ravnborg
On Thu, Jan 04, 2007 at 10:14:52AM -0800, Don Mullis wrote:
 Move tags extracted from the ARCH and include/ sub-trees ahead of
 those from device drivers, so that the former will appear first
 during searches. 
 
 Saves user time during interactive searches for certain patterns
 that happen to find unwanted matches in driver files.
 
 Example in emacs:
M-x find-tag PAGE_SIZE
M-1 M-. (repeated until definition from asm-i386/page.h appears)
 
 Signed-off-by: Don Mullis [EMAIL PROTECTED]

Applied, thanks.

Sam

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [PATCH 1/4] kconfig: implement setter/getter functions and change callback for sym_change_count

2006-10-06 Thread Sam Ravnborg
On Fri, Oct 06, 2006 at 08:44:29PM +0200, Karsten Wiese wrote:
 
 Just gave it a try and stumbled over already existing sym_set_changed().
 
 find output (see below) shows the most hits
 for sym_change_count in confdata.c.
 
 So how about replacing
   sym_change_count by bool conf_dirty
 and adding
   bool conf_get_dirty(void),
   void conf_set_dirty(bool)
Naming is always of difficult...
In kconfig we use changed when somethign is changed - we do not use dirty.
And sym refers to a symbol - so that is not adequate.

conf refer to a full config (at least in some cases).
So I would suggest:
bool conf_changed(void)
void conf_set_changed()

or something like that.

Sam

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Problems with Kconfig

2006-09-13 Thread Sam Ravnborg
On Wed, Sep 13, 2006 at 03:57:11PM +0100, [EMAIL PROTECTED] wrote:
 Hello,
 
 I'm using gcc-2.95.3, libc2.2. I've using kernel 2.6.10 for quite a long time 
 now, though it may have been after some upgrading that I cannot compile it 
 anylonger.
 
 I have my own built linux system, and almost last versions of software 
 (despite of the veryold compiler version), so I don't know where the problem 
 is. 
 
 Appart from some software packages whose programmers seems to like being out 
 of c standards, I don't use to have a single problem compiling anything.
 
 The last I remember to have upgraded is ncurses to it's last version at the 
 time of this writting (5.5), although as you could see bellow, the problem 
 comes from the parser for the menus (scripts/kconfig/conf), yacc or bison 
 files.
 
 I just wonder if anybody can tell me something about. What you see is the 
 output after untarring the kernel tree, and copying ../.config to ./.config. 
 Though I cannot make oldconfig, menconfig, or anythingelse.
 
 Kind Regards,
 
 [EMAIL PROTECTED] make
   CHK include/linux/version.h
   UPD include/linux/version.h
   SYMLINK include/asm - include/asm-i386
   HOSTCC  scripts/basic/fixdep
   HOSTCC  scripts/basic/split-include
   HOSTCC  scripts/basic/docproc
   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  scripts/kconfig/zconf.tab.o
   HOSTLD  scripts/kconfig/conf
 scripts/kconfig/conf -s arch/i386/Kconfig
 arch/i386/kernel/cpu/cpufreq/Kconfig:238: 'endmenu' in different file than 
 'menu'
 arch/i386/kernel/cpu/cpufreq/Kconfig:238: location of the 'menu'

This looks strange. Primary suspect is a bad Kconfig file.
A simple check would be to fire up mconf on a smaller Kconfig file.
Try: 
rm .config
touch .config
scripts/kconfig/mconf init/Kconfig

This should spit out a few warnings about an unknown symbol being selected,
but otherwise it should look ok.

If this fails then something more subtle is going on..

I assume you have tried to rebuild your kernel from scratch??

Sam

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Converter from Config.in to Kconfig

2006-08-01 Thread Sam Ravnborg
On Mon, Apr 10, 2006 at 03:33:16PM -0500, Karicheri, Muralidharan wrote:
 Is there a generic script to convert from Config.in format to Kconfig
 format? I have a build system 
 
 which was based on old Config.in and needs a converter badly. 

If you search this list or linux-kernel you will find the converter
that Roman Zippel created to deal with this.
It was not perfect and the resulting Kconfig files needed a few tweaks
before they were OK - but it was a great help.

Sam

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Kconfig source syntax - how to add a prefix variable to the Kconfig source path ?

2006-08-01 Thread Sam Ravnborg
  I am working to build a Kconfig based configuration menu and I need to
  include a prefix variable
  to source command. How do I do this? Kconfig-language.txt doesn't
  explain this. Your 
  response will be highly appreciated...
 Not supported today.
 I recall I did this some time ago but that patch is long gone.
 It is trivially to add.
Found my old patch...
It is one year old or more so may not apply cleanly.

Sam

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index ccd4513..4be63d9 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -44,7 +44,7 @@ static void conf_warning(const char *fmt
conf_warnings++;
 }
 
-static char *conf_expand_value(const char *in)
+char *conf_expand_value(const char *in)
 {
struct symbol *sym;
const char *src;
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 527f60c..95b7f44 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -61,7 +61,7 @@ char *zconf_curname(void);
 
 /* confdata.c */
 extern const char conf_def_filename[];
-
+char *conf_expand_value(const char*);
 char *conf_get_default_confname(void);
 
 /* kconfig_load.c */
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index cfa4607..ba55e87 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -293,14 +293,14 @@ void zconf_initscan(const char *name)
 
 void zconf_nextfile(const char *name)
 {
-   struct file *file = file_lookup(name);
+   struct file *file = file_lookup(conf_expand_value(name));
struct buffer *buf = malloc(sizeof(*buf));
memset(buf, 0, sizeof(*buf));
 
current_buf-state = YY_CURRENT_BUFFER;
-   yyin = zconf_fopen(name);
+   yyin = zconf_fopen(file-name);
if (!yyin) {
-   printf(%s:%d: can't open file \%s\\n, zconf_curname(), 
zconf_lineno(), name);
+   printf(%s:%d: can't open file \%s\\n, zconf_curname(), 
zconf_lineno(), file-name);
exit(1);
}
yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
@@ -308,11 +308,11 @@ void zconf_nextfile(const char *name)
current_buf = buf;
 
if (file-flags  FILE_BUSY) {
-   printf(recursive scan (%s)?\n, name);
+   printf(recursive scan (%s)?\n, file-name);
exit(1);
}
if (file-flags  FILE_SCANNED) {
-   printf(file %s already scanned?\n, name);
+   printf(file %s already scanned?\n, file-name);
exit(1);
}
file-flags |= FILE_BUSY;

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] RFC - kconfig date must die

2006-07-01 Thread Sam Ravnborg
On Mon, Jun 26, 2006 at 04:04:24PM -0600, Jim Cromie wrote:
 
 IOW:   can we switch the default of CONFIG_NODATESTAMP ?
 
 
 Clearly, somebody has already thought about stripping the date from 
 .configs,
 but it seems to me that this has been forgotten, and warrants a fresh look.
 
 - I searched http://marc.theaimsgroup.com/?l=kbuild-develr=1b=200604w=2
 for  CONFIG_NODATESTAMP, got *no* hits.   How long ago was this added ?
Try searching linux-kernel.

And at linux-kernel try to locate:
[rfc] Compressing those annoying .configs which is a nice tool for
reporting your .config compressed and readable.

That said it is hard to realise what real-life problem you try to solve.

Sam

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [PATCH 1/1] Minor changes to allow static analysis checkers besides sparse

2006-07-01 Thread Sam Ravnborg
On Tue, May 23, 2006 at 03:57:23PM -0500, Dustin Kirkland wrote:
 On Tue, 2006-05-23 at 22:17 +0200, Sam Ravnborg wrote:
  On Tue, May 23, 2006 at 12:20:46PM -0500, Dustin Kirkland wrote:
   Minor changes to allow static analysis checkers besides sparse
   
   This patch allows CHECK and CHECKFLAGS to be passed in on the make
   invocation, such that one could specify a checker other than sparse,
   and/or different flags. 
  This is alread possible.
  Try 
  make C=1 CHECK=checker_executable CHECKFLAGS=
  from your example and see that it works.
 
 No kidding, yep...I just tried that and it worked like a charm.  Thanks.
 
 The inline documentation was misleading.
 
 How about this simple patch to more clearly enunciate this in the inline
 Makefile documentation?
Look good, applied.

Sam

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] [PATCH 1/1] Minor changes to allow static analysis checkers besides sparse

2006-05-23 Thread Sam Ravnborg
On Tue, May 23, 2006 at 12:20:46PM -0500, Dustin Kirkland wrote:
 Minor changes to allow static analysis checkers besides sparse
 
 This patch allows CHECK and CHECKFLAGS to be passed in on the make
 invocation, such that one could specify a checker other than sparse,
 and/or different flags. 
This is alread possible.
Try 
make C=1 CHECK=checker_executable CHECKFLAGS=
from your example and see that it works.

The assignment:
foo := bar
will be overrided if you do:
make foo=viggo

But it will not be overridded if you have foo=sammy in your environment.

Sam


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnkkid=107521bid=248729dat=121642
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: [PATCH] make: add modules_update target

2006-04-16 Thread Sam Ravnborg
On Sat, Apr 15, 2006 at 11:02:08AM -0400, Theodore Ts'o wrote:
 On Sat, Apr 15, 2006 at 10:40:58AM +0200, Sam Ravnborg wrote:
  The problem to be solved is the long time it takes to do
  make modules_install when working on a single module.
  Instead of bringing in more or less complex solutions what about
  extending make dir/module.ko to include the installation of the
  module.
  
  Something like:
  make MI=1 dir/module.ko
  where MI=1 tells us to install the said module.
 
 Um, wouldn't that imply that either (a) the compile is being done as
 root, or (b) the /lib/modules/* is writeable by a non-root userid?  I
 suppose the install command could be prefixed by sudo, but that seems
 awkward (and not everyone uses sudo).

kbuild has support for the above scenario already - I just forgot.
Say you are hacking ext3.
Do a successfull make and install all modules.
Manually remove the ext3 module from /lib/modules/...
And use the external module support in kbuild like this:

# Got to relevant directory
$ cd fs/ext3

# To build the module:
$ make -C ../.. M=`pwd`

# To install the module:
$ make -C ../.. M=`pwd` modules_install

Sam


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: [PATCH] make: add modules_update target

2006-04-15 Thread Sam Ravnborg
On Fri, Apr 14, 2006 at 07:33:39PM -0500, Dustin Kirkland wrote:
 It looks like it may not be easy to drop in modules_update as a more
 efficient alternative to modules_install, but note that is not the patch
 that Kylie submitted...
The problem to be solved is the long time it takes to do
make modules_install when working on a single module.
Instead of bringing in more or less complex solutions what about
extending make dir/module.ko to include the installation of the
module.

Something like:
make MI=1 dir/module.ko
where MI=1 tells us to install the said module.

I'm not particular found of the syntax - anyone with a better proposal?

Untested sample patch below.

Sam

diff --git a/Makefile b/Makefile
index fc8e08c..0c0649c 100644
--- a/Makefile
+++ b/Makefile
@@ -1312,6 +1312,11 @@ # Modules
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
$(build)=$(build-dir) $(@:.ko=.o)
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
+ifneq ($(MI),)
+   cp $@ $(MODLIB)/kernel/$(dir $@)
+   if [ -r System.map -a -x $(DEPMOD) ]; then \
+$(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
+endif
 
 # FIXME Should go into a make.lib or something 
 # ===


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] RE: Kconfig source syntax - how to add a prefix variable to the Kconfig source path ?

2006-04-10 Thread Sam Ravnborg
On Mon, Apr 10, 2006 at 03:30:26PM -0500, Karicheri, Muralidharan wrote:
 
 Hi,
 
  
 
 I am working to build a Kconfig based configuration menu and I need to
 include a prefix variable
 to source command. How do I do this? Kconfig-language.txt doesn't
 explain this. Your 
 response will be highly appreciated...
Not supported today.
I recall I did this some time ago but that patch is long gone.
It is trivially to add.

Sam


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: kbuild: Problem with latest GNU make rc

2006-03-05 Thread Sam Ravnborg
[linux-kernel added. Please keep both bug-make and linux-kernel]

On Wed, Mar 01, 2006 at 10:46:25AM -0500, [EMAIL PROTECTED] wrote:
Content-Description: message body text
 Hi all.  I've set Reply-To: to the bug-make@gnu.org list; I'm hoping we
 can keep the discussion there since I don't subscribe to kbuild-devel.
 
 
 I'm working on getting the next release of GNU make, 3.81, out the door
 (amazing!)  The weekend before last I released 3.81rc1 for people to
 test.  A day or two ago, Art Haas [EMAIL PROTECTED] emailed me that he
 was having problems using kbuild with this version.  The previous
 version, 3.81beta4, works fine.
 
 The symptoms are that much of the kernel was rebuilding over gain
 every time he ran make, even after he'd just done a top-down build.
 
 I pulled the 2.6.15 kernel and sure enough, I see the same behavior.  I
 delved into the kbuild infrastructure and I found the problem.
 
 
 The kbuild system uses a trick to force rebuilds if the command line
 changes for a given target (normally make only rebuilds if the target is
 out of date--some versions of make, like Solaris make, have a
 .KEEP_STATE feature but GNU make does not support this).  Here's a
 stripped-down example of what kbuild does:
 
 .PHONY: FORCE
 
 %.o : %.c FORCE
 $(if_changed_rule ...)
 
 if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) 
 ),\
 @set -e; \
 $(rule_$(1)))
 
 The FORCE prerequisite causes ALL .o targets that match this rule to be
 considered by make to be out of date (because FORCE is always
 out-of-date and it's a prerequisite of the .o).
 
 The trick is in the if_changed_rule macro: it tests whether any
 prerequisites have changed ($? is the changed prerequisites; it'll be
 empty if none have changed) and whether the command lines have changed
 (the call to arg-check).  If those values are true (non-empty) it
 expands to the rule.  Otherwise it expands to nothing.
 
 GNU make takes several shortcuts to provide efficiency in places where
 it doesn't matter, and so if it sees an empty command it doesn't try to
 run a shell.  In this way, kbuild gets the benefit of checking the
 command line for every target without paying a price for useless shells
 being invoked during the build.
 
 
 However, this trick as implemented is accidentally relying on what may
 be a misbehavior on GNU make's part: one that was changed in the latest
 rc release.  This is causing rebuilds to happen.
 
 In previous versions of GNU make, prerequisites that didn't exist were
 not included in the $? variable.  In the new version that's been changed
 (fixed?) so that all out-of-date prerequisites are included in the $?
 variable, even if they don't exist.
 
 
 The old behavior allowed this rule to work, because even though FORCE
 was out-of-date and would normally always appear in $?, it didn't exist
 as a file and this exception caused it to be left out.  So, the value of
 $? was empty in the old version if the only prerequisite that was
 considered out-of-date was the non-existent file FORCE.
 
 In the new version of GNU make, the value of $? is FORCE in that
 situation, so the test in if_changed_rule is always true and it always
 evaluates to the compile line, and rebuilds.
 
 
 Neither the GNU make manual nor the POSIX definition of make gives us
 clear direction as to the correct behavior in this particular situation.
 SuS says:
 
   $?
   The $? macro shall evaluate to the list of prerequisites that are
   newer than the current target. It shall be evaluated for both target
   and inference rules.
 
 The GNU make manual says:
 
   $?
   The names of all the prerequisites that are newer than the target,
   with spaces between them.
 
 So... is a non-existent file newer than the target?  This specific
 situation is not addressed.  However, other versions of make (SysV make
 for example) interpret a non-existent file as out-of-date and DO include
 it in $?.  Given the meaning of newer than the current target to make
 (that it causes the target to be rebuilt) and the implied meaning of $?
 (a list of the prerequisites that cause the target to be rebuilt), I
 feel that the new behavior is correct and the old behavior is incorrect.
 
 
 So.  If the change is correct, how should we proceed?  Obviously it's
 not hard to change kbuild to fix the majority of the problem; replace
 the above macro with something like:
 
   if_changed_rule = $(if $(strip $(filter-out FORCE,$?) $(call arg-check, 
 $(cmd_$(1)), $(cmd_$@)) ),\
 @set -e; \
 $(rule_$(1)))
 
 and all will be well.  There are other, similar macros that need this
 change as well.

 And, there are other places where this $(filter-out
 FORCE,...) is already done, so it's apparently come up before.
Current use of $(filter-out FORCE, ...) is always with $^ where FORCE
correctly are included.

 I attach a patch here which makes this fix in kbuild.
 
 The above solution is 

[kbuild-devel] Re: kbuild: Problem with latest GNU make rc

2006-03-05 Thread Sam Ravnborg
On Sun, Mar 05, 2006 at 05:21:08PM -0500, Paul D. Smith wrote:
 %% Sam Ravnborg [EMAIL PROTECTED] writes:
 
   sr I foresee a lot of mails to lkml the next year or more with this
   sr issue if kept. People do build older kernels and continue to do so
   sr the next long time. Especially the embedded market seem keen to
   sr stay at 2.4 (wonder why), and as such we will see many systems
   sr that keep older kernel src but never make behaviour.
 
 Well, this behavior doesn't exist in 2.4 kernels, since the kernel build
 in 2.4 was very different.  Nevertheless there are plenty of 2.6 kernels
 out there :-).
OK, I did not actually look at 2.4. But you are right that the build
system has seen a few updates since then.

   sr Suggestion:
   sr We are now warned about an incompatibility in kbuild and we will
   sr fix this asap. But that you postpone this particular behaviour
   sr change until next make release. Maybe you add in this change as
   sr the first thing after the stable relase so all bleeding edge make
   sr users see it and can report issues.
 
 I am willing to postpone this change.  However, I can't say how much of
 a window this delay will give you: I can say that it's extremely
 unlikely that it will be another 3 years before GNU make 3.82 comes out.

One year would be good. The fixed kernel build will be available in an
official kernel in maybe two or three months form now. With current pace
we will have maybe 3 more kernel relase until this hits us. And only on
bleeding edge machines.

   sr It is not acceptable that the kernel links each time we do a make.
   sr We keep track of a version number, we do partly jobs as root etc.
   sr So any updates on an otherwise build tree is a bug - and will be
   sr reported and has to get fixed.
 
 I've modified the kbuild system to collect .PHONY files into a variable,
 PHONY, and then used that in the if_changed* macros.
 
 Using this method I've determined that the new version of GNU make works
 exactly like the old version under various tests (build from scratch,
 rebuild without any changes, rebuild with simple changes, etc.)
 
 I've submitted a patch to linux-kernel implementing this change, with
 an appropriate Signed-off-by line.

GNU make is used and abused in several ways in the kbuild files.
If you found something prticular fishy then please let me know, there
may well be better solutions for part of the build system that I am not
aware of.

Sam


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: Does git belong in root's $PATH?

2006-01-07 Thread Sam Ravnborg
On Sat, Jan 07, 2006 at 10:31:52AM -0800, Linus Torvalds wrote:
 
 
 On Sat, 7 Jan 2006, walt wrote:
 
  When updated my kernel this morning, the same way I've been doing
  it for many months, I noticed that the -gxxx localversion
  string was missing from the new kernel's name.
  
  I finally figured out that this happened because /usr/local/bin
  is not in my root's $PATH, and the setlocalversion script depends
  on git.  (The only thing I do as root is 'make install').
 
 Ok, sounds like a build buglet to me. If you've done a make as a regular 
 user, and just do a make install as root, I'd argue that the make 
 install should do as little as humanly possible, and literally just 
 install the kernel. If it starts changing the version, that sounds a bit 
 fishy.
 
 Sam, anything we can do?
Today kbuild uses same method to build KERNELRELEASE no matter what
target is used, and I recently committed a change that used git tools as
replacement for direct manipulation with .git/*
What I did not realise was that we now require git during make install
time - which is obviously plain wrong.

I will try to look into a cleaner solution tomorrow where KERNELRELEASE
is fetched somewhere else during make install time.

 
 That said:
 
  I suppose I'm asking a philosophical question here:  do you
  guys install git where root can find it (as a system tool)?
 
 I don't, but I don't use make install anyway, I just do make 
 modules_install. I install the kernel by hand, I always have.
 
 Of course, that's partly because I've always felt that make install does 
 too much (I think make modules_install is better - it really only 
 installs the already-built modules).
The big difference here is that make modules_install is part of
kbuild, whereas make install almost just call installkernel which is
distribution specific - and the distributions does all sort of stuff in
installkernel :-(

 
 Maybe it would be best to remove the vmlinux dependency from make 
 install (so that make install will do exactly that: just install).  I 
 think all the documentation already tells you to do a make and then a 
 make install.

I had a short chat with David Miller about something similar.
What I really liked to do was to tell user if vmlinux needed an update.
But the implmentation of kbuild does make this almost impossible - I
have at least not seen how to do it.

When I during early 2.6.12 removed the dependency on vmlinux from
the install target people were complaining that there scripts broke and
the solution that was implmented was a new target:
make kernel_install and make install got back the vmlinux
dependency.

Only difference between the two are that make kernel_install does NOT
have vmlinux as prerequisite. This was btw only done for i386 and
the only other architecture that have kernel_install is parisc with a
vmlinux dependency.


So no, I'm very unlikely to remove the vmlinux dependency from the
make install target - it results in too many suprises.

 
 The other make targets really _are_ different: make fdimage depends on 
 vmlinux, but that's because it literally just builds the image. make 
 install is special.
 
 Sam, what say you? I forget what the kbuild mailing list is, but maybe 
 you can forward this suggestion there..

These days it is named linux-kernel@vger.kernel.org ;-)
kbuild-devel@lists.sourceforge.net is seldom used though I still monitor
it. Talked with mec about discontinue it but he liked to keep it
araound. He is btw still moderator on that list filtering away all spam.

Sam


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: [PATCH 0/3] Link lxdialog with mconf directly

2005-12-16 Thread Sam Ravnborg
On Mon, Dec 12, 2005 at 09:08:17PM +0100, Petr Baudis wrote:
 
 Ok. I didn't want to pollute scripts/kconfig/ too much, but if it's ok
 by you, I can do it that way. I will submit another series later in the
 evening.

I've just done the renaming and relevant updates.
So you will deal with much smaller patches.

My kbuild tree is updated with the changes and will soon mirror out.

Sam


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: [PATCH 0/3] Link lxdialog with mconf directly

2005-12-12 Thread Sam Ravnborg
On Mon, Dec 12, 2005 at 01:41:59AM +0100, Petr Baudis wrote:
   The following series revives one three years old patch, turning lxdialog
 to a library and linking it directly to mconf, making menuconfig nicer and
 things in general quite simpler and cleaner.
 
   The first two patches make slight adjustements to kbuild in order to make
 liblxdialog possible. The third patch does the libification itself and
 appropriate modifications to mconf.c.

Why not just copy over relevant files to scripts/kconfig?
Then no playing tricks with libaries etc. is needed, and everythings
just works.

It is only 8 files and prefixing them with lx* would make them
stand out compared to the rest. It is not like there is any user planned
for the lxdialog functionality in the kernel, and kconfig users outside
the kernel I beleive copy lxdialog with rest of kconfig files.

Btw. the work you are doing are clashing with a general cleanup effort
of lxdialog I have in -mm at the moment.
I received only very limited feedback = looks ok.
Integrating principles from your old patch was on my TODO list.

I have something in the works that uses linked list instead of a
preallocated array, to keep the dynamic behaviour. I will probarly make
a version with the linked list approach but otherwise use your changes
to mconf.c. But it will take a few days until I get to it.

Sam


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: [PATCH 0/3] Link lxdialog with mconf directly

2005-12-12 Thread Sam Ravnborg
On Mon, Dec 12, 2005 at 09:08:17PM +0100, Petr Baudis wrote:
  It is only 8 files and prefixing them with lx* would make them
  stand out compared to the rest. It is not like there is any user planned
  for the lxdialog functionality in the kernel, and kconfig users outside
  the kernel I beleive copy lxdialog with rest of kconfig files.
 
 Ok. I didn't want to pollute scripts/kconfig/ too much, but if it's ok
 by you, I can do it that way. I will submit another series later in the
 evening.
In the end this is Roman's call, not mine.
Keeping the lxdialog functionality close to the users though makes
total sense. We do not have to take special care of dependencies etc.
 
  Btw. the work you are doing are clashing with a general cleanup effort
  of lxdialog I have in -mm at the moment.
  I received only very limited feedback = looks ok.
  Integrating principles from your old patch was on my TODO list.
 
 Do you mean the series you posted at Nov 21? Should I just rebase my
 patches on top of that?
Please do so. I did not post the biggest one where I Lindented all of
lxdialog, but they are all in
git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git

 FWIW, the changes there look fine to me. I actually wanted to change the
 indentation of the menus as well; it looks horrible especially in the
 singlemenu mode.
 
  I have something in the works that uses linked list instead of a
  preallocated array, to keep the dynamic behaviour. I will probarly make
  a version with the linked list approach but otherwise use your changes
  to mconf.c. But it will take a few days until I get to it.
 
 I can do it and include it in the updated series.
Would be perfect!

I will then do a proper review of next round of patches.

Sam


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] error about rp_filter

2005-08-05 Thread Sam Ravnborg
Hi Adrian.
This is better suited for netdev, so I've forwarded your mail there.
[It was originally sent to kbuild-devel]

Sam

On Fri, Aug 05, 2005 at 06:44:59PM +0300, Adrian Buciuman wrote:
 Hello,
 
 rp-filter is default off (see ip-sysctl.txt and proc.txt or test it),
 but comments in
 
 
 Documentation/Configure/help--- 2.4 kernels
 net/ipv4/Kconfig --- 2.6 kernels
 
 
 have led some (look at /etc/rc.d/rc.ip_forward on Slackware)  to
 believe it is default on.
 
 
 Regards,
 Adrian Buciuman
 


---
SF.Net email is Sponsored by the Better Software Conference  EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile  Plan-Driven Development * Managing Projects  Teams * Testing  QA
Security * Process Improvement  Measurement * http://www.sqe.com/bsce5sf
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: [RFD] kconfig - introduce cond-source

2005-07-31 Thread Sam Ravnborg
On Sun, Jul 31, 2005 at 02:50:03AM +0200, Roman Zippel wrote:
 Hi,
 
 On Sun, 31 Jul 2005, Sam Ravnborg wrote:
 
  In a couple of cases I have had the need to include a Kconfig file only
  if present.
  The current 'source' directive works as one would expect. It bails out
  if the file is missing.
 
 I don't really like it, it's an open invitation to abuse.
 I'd rather like to see the user first, which might need it.
Understood.
I will save this until I have a very good example where I need it.

Sam


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: kconfig: trivial cleanup

2005-07-28 Thread Sam Ravnborg
On Thu, Jul 28, 2005 at 05:56:25PM +0200, [EMAIL PROTECTED] wrote:
 Replace all menu_add_prop mimicking menu_add_prompt with the latter func. I've
 had to add a return value to menu_add_prompt for one usage.
 
 I've rebuilt scripts/kconfig/zconf.tab.c_shipped by hand to reflect changes
 in the source (I've not the same Bison version so regenerating it wouldn't
 have been not a good idea), and compared it with what Roman itself did some
 time ago, and it's the same.
 
 So I guess this can be finally merged.

I've applied the aptch - despite the strange formatting. See menu.c.

Sam


---
SF.Net email is Sponsored by the Better Software Conference  EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile  Plan-Driven Development * Managing Projects  Teams * Testing  QA
Security * Process Improvement  Measurement * http://www.sqe.com/bsce5sf
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Doubt what is the difference of compiling module in SuSE and Redhad , Mandrake

2005-05-08 Thread Sam Ravnborg
On Fri, May 06, 2005 at 12:27:12PM -0700, karthik wrote:
 Hi ,
 
   Can anybody tell me what is the difference in compiling a module in 
 SuSE distribution and other LInux distribution like Redhad or Mandrake.
 
   In 2.6 kernel  a module compiled in one version(say 2.6.4) of SuSE is 
 not loading in another version(say 2.6.8) of SuSE, even when we convert the 
 module.o to module.ko in the latest version of SUSE.
Please read Documentation/kbuild/modules.txt
If you follow instructions herein you will no longer:
convert module.o to module.ko.
And as long as you do wrong stuff like that you are lucky that your
module actually loaded with some kernel version.

Sam


---
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] RE: kbuild-devel digest, Vol 1 #594 - 4 msgs

2005-05-08 Thread Sam Ravnborg
On Mon, May 09, 2005 at 10:03:21AM -0700, karthik r wrote:
 Hi ,
 
  But the problem with me is that we cannot release the source code.
That does not in any way prevent you from creating a Makefile according
to text in modules.txt?

Or is it so that you only have access to the .o file and no access to
source. If the altter is the case than you are in trouble and I doubt
you will succeed.

Sam


---
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Help in Makefile for Kernel module

2005-04-19 Thread Sam Ravnborg
Hi Suzzane

However I would like to know if it is possible to have a Makefile
 inside the foobard directory that will link foobar1.o and foobar2.o
 into one say foobar.o and have the below line as:

The lowest granularity the kbuild system works with is a module.
So what you can do is to define a module in the foobard/ directory.
Then you would stick a dependency on this module in your top-level
module in maind/.

The Makefile's would look like this:

Makefile (stripped all the conditional stuff):

obj-m := maind/ foobard/

foobard/Makefile:
obj-m := foobard.o
foobard-y := foobar1.o foobar2.o

maind/Makefile:
obj-m := main.o


Sam



---
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] How to convert a .o file to .ko module for 2.6 kernel

2005-03-14 Thread Sam Ravnborg

 Hi,
   In Documentation/kbuild/ its only written how to make a .ko file
 from
 Source file.But i need to know to make a .ko file from a .o file not from
 source file.

In modules.txt there is a section about including a .o file in a module.
This is what you need. You cannot just randomly convert a .o file to a .ko
file.

   Sam



---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Cannot compile linux-2.4.29

2005-02-06 Thread Sam Ravnborg
On Sun, Feb 06, 2005 at 02:56:55PM -0800, David Butcher wrote:
 Hello, I am able to compile (and run) linux-2.4.27 successfully.
 
 I downloaded the soruce for linux-2.4.29 from www.kernel.org on Feb 6 2005
 and unpacked it in a directory adjacent to the built\d directory for 2.4.27
 
 All previous builds from www.kernel.org have built successfully. This build
 fails with what looks like a recursive call to a macro. 
 
 I executed:
 
 make oldconfig
 make dep
 make
Please save your .config,
Do a make mrproper
and follow the above stpes once more.

That may very well cure it.

Sam


---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] sorting out the kerntypes mess

2005-01-30 Thread Sam Ravnborg
Hi Christoph

 The various dumping projects like lkcd and the s390 VM dump require
 debug information for the kernel, and they're using a mechanism
 that compiles a small file containing nothing but includes for
 interesting types into a Kerntypes file for the debugger.
 
 Unfortunately the various current ways to generate it are a little
 messy and thus we don't have support for it in mainline.
 
 As a clean way to implement it and supports multiple files that
 can be linked into Kerntypes (e.g. arch or subsystem-specific)
 I'd like to suggest the following additions to the kernel
 build system:
 
 kerntypes-y   += object files
 KERNTYPEFLAGS += compile flags
 
 Which build all objects listed in kerntypes-y with the CFLAGS from
 KERNTYPEFLAGS (defaulting to CFLAGS) into a top-level Kerntypes
 file.

First trying to understand exactly what you want.

So you expect kerntypes-y := file.o
to be present in one or a few places outside arch/
And then in one or a few files within arch/ the arch
specific types are brought in with kerntypes-y := archfile.o

And kbuild shall link the resuting files to a single kerntypes.o file
to be located in the root of the kernel output dir.

There are a few (solveable) issue with this.
- kbuild needs to keep track of all kerntypes.y files. This is done for
  the kernel with a built-in.o file that links all .o files for a given
  dir and subdirs. In this was the final link is just a few built-in.o
  files (+ a bitmore).
- Addind kerntypes-y would make kbuild infrastructure even more scary
  than today. There most be some very good reasons to add more
  complexity to the current implmentation.

Maybe a simpler solution could be deployed:
One file for all of the kernel located in kernel/kerntypes.o
Then the arch makefile can link in their relevant files
in a post processing step like when we build bzImage and the like.
This requires much less support in common kbuild files.

 Unfortunately I'm a little lost in the current kbuild infrastructure
 so some help would be very welcome.

If we can agree on something I will give it a try.

Sam


---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Re: [PATCH] make 'make help' show all *config targets and update descriptions slightly.

2005-01-30 Thread Sam Ravnborg
On Mon, Jan 24, 2005 at 10:05:48PM +0100, Jesper Juhl wrote:
 
 make help doesn't show make randconfig nor make config as options 
 and the description of oldconfig could be better (IMHO). Patch below adds 
 the missing targets to the help and updates the description of oldconfig.

Applied - the help for oldconfig definitely got better.

Sam


---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


  1   2   >