linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/18] kbuild fixes
@ 2006-07-29  7:15 Sam Ravnborg
  2006-07-29  7:19 ` [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x sam
  0 siblings, 1 reply; 14+ messages in thread
From: Sam Ravnborg @ 2006-07-29  7:15 UTC (permalink / raw)
  To: Linus Torvalds, LKML, Andrew Morton

Hi Linus.

Here is a number of small and smaller kbuild fixes for -rc2. Please add
them before -rc3.
The list got larger than expected since I missed -rc1 with half a day.

Most noteworthy:

o fix build on ubuntu - breakage caused by -fno-stack-protector enabled
  on ubuntu
o fix building out-of-tree modules
o fix 'make headers_install' to work with a non-configured kernel
o added unifdef to the kernel tree. It is not a widely distributed tool
  author has acked this

Patches has been in -mm for a while with no bugs reported.
Exception is the 'linguistic fixes' - but they did not cause any
compile/boot issues ;-)

Please pull from:
	git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuld.git

diffstat + shortlog + full log below.

	Sam

git diff --stat:
 .gitignore                                |    5 
 Documentation/kbuild/kconfig-language.txt |   12 
 Documentation/kbuild/makefiles.txt        |  184 +++--
 Documentation/kbuild/modules.txt          |  119 ++-
 Kbuild                                    |    2 
 Makefile                                  |    9 
 drivers/scsi/aic7xxx/aicasm/Makefile      |    2 
 scripts/Kbuild.include                    |   55 +-
 scripts/Makefile                          |    3 
 scripts/Makefile.build                    |    5 
 scripts/Makefile.headersinst              |    2 
 scripts/Makefile.modpost                  |    2 
 scripts/kconfig/confdata.c                |   10 
 scripts/mod/file2alias.c                  |   62 +-
 scripts/unifdef.c                         | 1005 +++++++++++++++++++++++++++++
 usr/Makefile                              |    2 
 16 files changed, 1269 insertions(+), 210 deletions(-)

git shortlog:

Dave Jones:
      kbuild: fix typo in modpost

Jan Engelhardt:
      kbuild: linguistic fixes for Documentation/kbuild/makefiles.txt
      kconfig: linguistic fixes for Documentation/kbuild/kconfig-language.txt
      kbuild: linguistic fixes for Documentation/kbuild/modules.txt

Matthew Wilcox:
      kconfig: support DOS line endings

Olaf Hering:
      remove RPM_BUILD_ROOT from asm-offsets.h

Qi Yong:
      gitignore: gitignore quilt's files

Roman Zippel:
      kconfig: correct oldconfig for unset choice options

Sam Ravnborg:
      kbuild: hardcode value of YACC&LEX for aic7-triple-x
      kbuild: version.h and new headers_* targets does not require a kernel config
      kbuild: .gitignore utsrelease.h
      kbuild: improve error from file2alias
      kbuild: -fno-stack-protector is not good
      kbuild: consistently decide when to rebuild a target
      kbuild: always use $(CC) for $(call cc-version)
      kbuild: add unifdef
      kbuild: replace use of strlcpy with a dedicated implmentation in unifdef
      kbuild: use in-kernel unifdef

git log:
commit b193a8c70628aecdbccac81f710cec2bf2dd3592
Author: Jan Engelhardt <jengelh@linux01.gwdg.de>
Date:   Thu Jul 27 22:14:29 2006 +0200

    kbuild: linguistic fixes for Documentation/kbuild/modules.txt
    
    I have done a look-through through Documentation/kbuild/ and my corrections
    (proposed) are attached.
    
    Cc'ed are original author Michael (responsible for comitting changes to
    these files?), Sam (kbuild maintainer), Adrian (-trivial maintainer).
    
    Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 Documentation/kbuild/modules.txt |  119 +++++++++++++++++++-------------------
 1 files changed, 60 insertions(+), 59 deletions(-)

commit 665cf3bbd09375ea7520083704ce8b8c1bcc54a9
Author: Jan Engelhardt <jengelh@linux01.gwdg.de>
Date:   Thu Jul 27 22:14:29 2006 +0200

    kconfig: linguistic fixes for Documentation/kbuild/kconfig-language.txt
    
    I have done a look-through through Documentation/kbuild/ and my corrections
    (proposed) are attached.
    
    Cc'ed are original author Michael (responsible for comitting changes to
    these files?), Sam (kbuild maintainer), Adrian (-trivial maintainer).
    
    Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 Documentation/kbuild/kconfig-language.txt |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

commit e2dbd0d4c86f364640429718ce20fbe9aafe979e
Author: Jan Engelhardt <jengelh@linux01.gwdg.de>
Date:   Thu Jul 27 22:14:29 2006 +0200

    kbuild: linguistic fixes for Documentation/kbuild/makefiles.txt
    
    I have done a look-through through Documentation/kbuild/ and my corrections
    (proposed) are attached.
    
    Cc'ed are original author Michael (responsible for comitting changes to
    these files?), Sam (kbuild maintainer), Adrian (-trivial maintainer).
    
    Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 Documentation/kbuild/makefiles.txt |  184 ++++++++++++++++++------------------
 1 files changed, 94 insertions(+), 90 deletions(-)

commit 5dd5cc7558046806ef29e4057bbb309b1b248634
Author: Olaf Hering <olh@suse.de>
Date:   Tue Jul 25 18:42:26 2006 -0700

    remove RPM_BUILD_ROOT from asm-offsets.h
    
    No file in rpm binary package should have the RPM_BUILD_ROOT string in it.
    To simplify building of external modules, our kernel-source package
    contains some temp files from the Kbuild system.  asm/asm-offsets.h is one
    of the files that contains the absolute path if make O=$O is used.
    
      * This file was generated by /var/tmp/kernel-source-2.6.14_rc4-build/usr/src/linux-2.6.14-rc4-2/Kbuild
    
    Remove the $RPM_BUILD_ROOT string in the shipped tempfile.
    
    Signed-off-by: Olaf Hering <olh@suse.de>
    Signed-off-by: Andrew Morton <akpm@osdl.org>
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 Kbuild |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 81ec74898bbc68bd0818cb86faa7016ae9e68445
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Sun Jul 23 20:47:50 2006 +0200

    kbuild: use in-kernel unifdef
    
    Let headers_install use in-kernel unifdef
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 Makefile                     |    4 ++--
 scripts/Makefile             |    3 +++
 scripts/Makefile.headersinst |    2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

commit 070ab8cc933596133db55816818c477729f007dd
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Sun Jul 23 20:41:30 2006 +0200

    kbuild: replace use of strlcpy with a dedicated implmentation in unifdef
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 scripts/unifdef.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

commit b70bca202c920feebc618aaee473bfd14003a46e
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Sun Jul 23 20:39:59 2006 +0200

    kbuild: add unifdef
    
    This patch contains a raw copy of unifdef.c
    Next patch will modify it and add infrastructure to use it
    Adding unifdef to the kernel is acked by the author.
    
    The reason to add unifdef as part of the kernel source is that it is not
    yet a common utility on most distributions.
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 scripts/unifdef.c |  998 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 998 insertions(+), 0 deletions(-)

commit ecbe2c133024f9a852e9852197cc77c2884e64bb
Author: Qi Yong <qiyong@fc-cn.com>
Date:   Mon Jul 17 13:37:06 2006 +0800

    gitignore: gitignore quilt's files
    
    gitignore: ignore quilt's files.
    
    Signed-off-by: Qi Yong <qiyong@fc-cn.com>
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 .gitignore |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

commit 045cfddb5f89722259c90fb742e201d289d94092
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Sun Jul 23 19:49:45 2006 +0200

    kbuild: always use $(CC) for $(call cc-version)
    
    The possibility to specify an optional parameter did not work out as
    expected and it was not used - so remove the possibility.
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 scripts/Kbuild.include |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

commit 0b5d8d55caf9a844401cf5b3f534a50d9aa105af
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Sun Jul 23 19:37:44 2006 +0200

    kbuild: consistently decide when to rebuild a target
    
    Consistently decide when to rebuild a target across all of
    if_changed, if_changed_dep, if_changed_rule.
    PHONY targets are now treated alike (ignored) for all targets
    
    While add it make Kbuild.include almost readable by factoring out a few
    bits to some common variables and reuse this in Makefile.build.
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 scripts/Kbuild.include |   52 ++++++++++++++++++++++++++++--------------------
 scripts/Makefile.build |    5 +++--
 usr/Makefile           |    2 ++
 3 files changed, 35 insertions(+), 24 deletions(-)

commit 24c56d80c676a79c161821fc928f903ff0f03241
Author: Matthew Wilcox <matthew@wil.cx>
Date:   Thu Jul 13 12:54:07 2006 -0600

    kconfig: support DOS line endings
    
    Kconfig doesn't currently handle config files with DOS line endings.
    While these are, of course, an abomination, etc, etc, it can be handy
    to not have to convert them first.  It's also a tiny patch and even adds
    support for lines ending in just \r or even \n\r.
    
    Signed-off-by: Matthew Wilcox <matthew@wil.cx>
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 scripts/kconfig/confdata.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

commit a014a91bb01be9cce0d2dc292a8488fb81b0cd3b
Author: Roman Zippel <zippel@linux-m68k.org>
Date:   Thu Jul 13 13:22:38 2006 +0200

    kconfig: correct oldconfig for unset choice options
    
    oldconfig currently ignores unset choice options and doesn't ask for them.
    Correct the SYMBOL_DEF_USER flag of the choice symbol to be only set if
    it's set for all values.
    
    Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 scripts/kconfig/confdata.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit ca1b67b522896b8f59be6e5fd81f53987a94695f
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Thu Jul 13 20:27:27 2006 +0200

    kbuild: -fno-stack-protector is not good
    
    Ubuntu gcc has hardcoded -fstack-protector - but does not understand
    -fno-stack-protector-all. So only try -fno-stack-protector.
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

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

commit b1c34ea9a006ad0deb828921996f071d925d79de
Author: Dave Jones <davej@redhat.com>
Date:   Thu Jul 13 00:44:15 2006 -0400

    kbuild: fix typo in modpost
    
    Reported by a Fedora user when they tried to build some out of tree module..
    
    Signed-off-by: Dave Jones <davej@redhat.com>
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 scripts/Makefile.modpost |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 48d2f630d921ba92cc5d5f75b97a2bf1092277eb
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Sun Jul 9 16:26:07 2006 +0200

    kbuild: improve error from file2alias
    
    The original errormessage was just plain unreadable.
    
    Sample error message after this update (not for real - I provoked it):
    
    FATAL: drivers/net/s2io: sizeof(struct pci_device_id)=33 is not a modulo of the
    size of section __mod_pci_device_table=160.
    Fix definition of struct pci_device_id in mod_devicetable.h
    
    Before a warning was generated - this is now a fatal error.
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 scripts/mod/file2alias.c |   62 ++++++++++++++++++++++++++++++++--------------
 1 files changed, 43 insertions(+), 19 deletions(-)

commit 6ce316b37017dc83d1e3b16113c6a01750d3d554
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Sun Jul 9 16:07:44 2006 +0200

    kbuild: .gitignore utsrelease.h
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 .gitignore |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit 3a029538f8135e3416ea9973f3e2d3ae61bbb153
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Sat Jul 8 00:46:25 2006 +0200

    kbuild: version.h and new headers_* targets does not require a kernel config
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

commit 073be037e1615993ed925a28c3f731756b668fdc
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date:   Sat Jul 8 00:27:49 2006 +0200

    kbuild: hardcode value of YACC&LEX for aic7-triple-x
    
    When we introduced -rR then aic7xxx no loger could pick up definition
    of YACC&LEX from make - so do it explicit now.
    
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

 drivers/scsi/aic7xxx/aicasm/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

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

* [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x
  2006-07-29  7:15 [PATCH 0/18] kbuild fixes Sam Ravnborg
@ 2006-07-29  7:19 ` sam
  2006-07-29  7:19   ` [PATCH] kbuild: version.h and new headers_* targets does not require a kernel config sam
  2006-07-29  9:07   ` [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x Alexey Dobriyan
  0 siblings, 2 replies; 14+ messages in thread
From: sam @ 2006-07-29  7:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sam Ravnborg, Sam Ravnborg

From: Sam Ravnborg <sam@mars.ravnborg.org>

When we introduced -rR then aic7xxx no loger could pick up definition
of YACC&LEX from make - so do it explicit now.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 drivers/scsi/aic7xxx/aicasm/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aicasm/Makefile b/drivers/scsi/aic7xxx/aicasm/Makefile
index 8c91fda..b98c5c1 100644
--- a/drivers/scsi/aic7xxx/aicasm/Makefile
+++ b/drivers/scsi/aic7xxx/aicasm/Makefile
@@ -14,6 +14,8 @@ LIBS=	-ldb
 clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
 # Override default kernel CFLAGS.  This is a userland app.
 AICASM_CFLAGS:= -I/usr/include -I.
+LEX= flex
+YACC= bison
 YFLAGS= -d
 
 NOMAN=	noman
-- 
1.4.1.rc2.gfc04


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

* [PATCH] kbuild: version.h and new headers_* targets does not require a kernel config
  2006-07-29  7:19 ` [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x sam
@ 2006-07-29  7:19   ` sam
  2006-07-29  7:19     ` [PATCH] kbuild: .gitignore utsrelease.h sam
  2006-07-29  9:07   ` [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x Alexey Dobriyan
  1 sibling, 1 reply; 14+ messages in thread
From: sam @ 2006-07-29  7:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sam Ravnborg, Sam Ravnborg

From: Sam Ravnborg <sam@mars.ravnborg.org>

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 7c010f3..60e09f2 100644
--- a/Makefile
+++ b/Makefile
@@ -368,6 +368,7 @@ # of make so .config is not included in 
 
 no-dot-config-targets := clean mrproper distclean \
 			 cscope TAGS tags help %docs check% \
+			 include/linux/version.h headers_% \
 			 kernelrelease kernelversion
 
 config-targets := 0
-- 
1.4.1.rc2.gfc04


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

* [PATCH] kbuild: .gitignore utsrelease.h
  2006-07-29  7:19   ` [PATCH] kbuild: version.h and new headers_* targets does not require a kernel config sam
@ 2006-07-29  7:19     ` sam
  2006-07-29  7:19       ` [PATCH] kbuild: improve error from file2alias sam
  0 siblings, 1 reply; 14+ messages in thread
From: sam @ 2006-07-29  7:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sam Ravnborg, Sam Ravnborg

From: Sam Ravnborg <sam@mars.ravnborg.org>

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 .gitignore |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 27fd376..3f9bb5e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,7 @@ include/config
 include/linux/autoconf.h
 include/linux/compile.h
 include/linux/version.h
+include/linux/utsrelease.h
 
 # stgit generated dirs
 patches-*
-- 
1.4.1.rc2.gfc04


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

* [PATCH] kbuild: improve error from file2alias
  2006-07-29  7:19     ` [PATCH] kbuild: .gitignore utsrelease.h sam
@ 2006-07-29  7:19       ` sam
  2006-07-29  7:19         ` [PATCH] kbuild: fix typo in modpost sam
  0 siblings, 1 reply; 14+ messages in thread
From: sam @ 2006-07-29  7:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sam Ravnborg, Sam Ravnborg

From: Sam Ravnborg <sam@mars.ravnborg.org>

The original errormessage was just plain unreadable.

Sample error message after this update (not for real - I provoked it):

FATAL: drivers/net/s2io: sizeof(struct pci_device_id)=33 is not a modulo of the
size of section __mod_pci_device_table=160.
Fix definition of struct pci_device_id in mod_devicetable.h

Before a warning was generated - this is now a fatal error.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/mod/file2alias.c |   62 ++++++++++++++++++++++++++++++++--------------
 1 files changed, 43 insertions(+), 19 deletions(-)

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 37f67c2..4431292 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -52,6 +52,23 @@ do {                                    
                 sprintf(str + strlen(str), "*");                \
 } while(0)
 
+/**
+ * Check that sizeof(device_id type) are consistent with size of section
+ * in .o file. If in-consistent then userspace and kernel does not agree
+ * on actual size which is a bug.
+ **/
+static void device_id_size_check(const char *modname, const char *device_id,
+				 unsigned long size, unsigned long id_size)
+{
+	if (size % id_size || size < id_size) {
+		fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
+		      "of the size of section __mod_%s_device_table=%lu.\n"
+		      "Fix definition of struct %s_device_id "
+		      "in mod_devicetable.h\n",
+		      modname, device_id, id_size, device_id, size, device_id);
+	}
+}
+
 /* USB is special because the bcdDevice can be matched against a numeric range */
 /* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */
 static void do_usb_entry(struct usb_device_id *id,
@@ -152,10 +169,8 @@ static void do_usb_table(void *symval, u
 	unsigned int i;
 	const unsigned long id_size = sizeof(struct usb_device_id);
 
-	if (size % id_size || size < id_size) {
-		warn("%s ids %lu bad size "
-		     "(each on %lu)\n", mod->name, size, id_size);
-	}
+	device_id_size_check(mod->name, "usb", size, id_size);
+
 	/* Leave last one: it's the terminator. */
 	size -= id_size;
 
@@ -434,6 +449,7 @@ static inline int sym_is(const char *sym
 
 static void do_table(void *symval, unsigned long size,
 		     unsigned long id_size,
+		     const char *device_id,
 		     void *function,
 		     struct module *mod)
 {
@@ -441,10 +457,7 @@ static void do_table(void *symval, unsig
 	char alias[500];
 	int (*do_entry)(const char *, void *entry, char *alias) = function;
 
-	if (size % id_size || size < id_size) {
-		warn("%s ids %lu bad size "
-		     "(each on %lu)\n", mod->name, size, id_size);
-	}
+	device_id_size_check(mod->name, device_id, size, id_size);
 	/* Leave last one: it's the terminator. */
 	size -= id_size;
 
@@ -476,40 +489,51 @@ void handle_moddevtable(struct module *m
 		+ sym->st_value;
 
 	if (sym_is(symname, "__mod_pci_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct pci_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct pci_device_id), "pci",
 			 do_pci_entry, mod);
 	else if (sym_is(symname, "__mod_usb_device_table"))
 		/* special case to handle bcdDevice ranges */
 		do_usb_table(symval, sym->st_size, mod);
 	else if (sym_is(symname, "__mod_ieee1394_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct ieee1394_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct ieee1394_device_id), "ieee1394",
 			 do_ieee1394_entry, mod);
 	else if (sym_is(symname, "__mod_ccw_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct ccw_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct ccw_device_id), "ccw",
 			 do_ccw_entry, mod);
 	else if (sym_is(symname, "__mod_serio_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct serio_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct serio_device_id), "serio",
 			 do_serio_entry, mod);
 	else if (sym_is(symname, "__mod_pnp_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct pnp_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct pnp_device_id), "pnp",
 			 do_pnp_entry, mod);
 	else if (sym_is(symname, "__mod_pnp_card_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct pnp_card_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct pnp_card_device_id), "pnp_card",
 			 do_pnp_card_entry, mod);
 	else if (sym_is(symname, "__mod_pcmcia_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct pcmcia_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct pcmcia_device_id), "pcmcia",
 			 do_pcmcia_entry, mod);
         else if (sym_is(symname, "__mod_of_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct of_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct of_device_id), "of",
 			 do_of_entry, mod);
         else if (sym_is(symname, "__mod_vio_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct vio_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct vio_device_id), "vio",
 			 do_vio_entry, mod);
 	else if (sym_is(symname, "__mod_i2c_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct i2c_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct i2c_device_id), "i2c",
 			 do_i2c_entry, mod);
 	else if (sym_is(symname, "__mod_input_device_table"))
-		do_table(symval, sym->st_size, sizeof(struct input_device_id),
+		do_table(symval, sym->st_size,
+			 sizeof(struct input_device_id), "input",
 			 do_input_entry, mod);
 }
 
-- 
1.4.1.rc2.gfc04


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

* [PATCH] kbuild: fix typo in modpost
  2006-07-29  7:19       ` [PATCH] kbuild: improve error from file2alias sam
@ 2006-07-29  7:19         ` sam
  2006-07-29  7:19           ` [PATCH] kbuild: -fno-stack-protector is not good sam
  0 siblings, 1 reply; 14+ messages in thread
From: sam @ 2006-07-29  7:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dave Jones, Sam Ravnborg

From: Dave Jones <davej@redhat.com>

Reported by a Fedora user when they tried to build some out of tree module..

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/Makefile.modpost |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index a495502..0a64688 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -40,7 +40,7 @@ include scripts/Kbuild.include
 include scripts/Makefile.lib
 
 kernelsymfile := $(objtree)/Module.symvers
-modulesymfile := $(KBUILD_EXTMOD)/Modules.symvers
+modulesymfile := $(KBUILD_EXTMOD)/Module.symvers
 
 # Step 1), find all modules listed in $(MODVERDIR)/
 __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
-- 
1.4.1.rc2.gfc04


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

* [PATCH] kbuild: -fno-stack-protector is not good
  2006-07-29  7:19         ` [PATCH] kbuild: fix typo in modpost sam
@ 2006-07-29  7:19           ` sam
  2006-07-29  7:19             ` [PATCH] kconfig: correct oldconfig for unset choice options sam
  0 siblings, 1 reply; 14+ messages in thread
From: sam @ 2006-07-29  7:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sam Ravnborg, Sam Ravnborg

From: Sam Ravnborg <sam@mars.ravnborg.org>

Ubuntu gcc has hardcoded -fstack-protector - but does not understand
-fno-stack-protector-all. So only try -fno-stack-protector.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 60e09f2..07b8f34 100644
--- a/Makefile
+++ b/Makefile
@@ -310,8 +310,8 @@ CPPFLAGS        := -D__KERNEL__ $(LINUXI
 CFLAGS          := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
                    -fno-strict-aliasing -fno-common
 # Force gcc to behave correct even for buggy distributions
-CFLAGS          += $(call cc-option, -fno-stack-protector-all \
-                                     -fno-stack-protector)
+CFLAGS          += $(call cc-option, -fno-stack-protector)
+
 AFLAGS          := -D__ASSEMBLY__
 
 # Read KERNELRELEASE from include/config/kernel.release (if it exists)
-- 
1.4.1.rc2.gfc04


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

* [PATCH] kconfig: correct oldconfig for unset choice options
  2006-07-29  7:19           ` [PATCH] kbuild: -fno-stack-protector is not good sam
@ 2006-07-29  7:19             ` sam
  2006-07-29  7:19               ` [PATCH] kconfig: support DOS line endings sam
  0 siblings, 1 reply; 14+ messages in thread
From: sam @ 2006-07-29  7:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Roman Zippel, Sam Ravnborg

From: Roman Zippel <zippel@linux-m68k.org>

oldconfig currently ignores unset choice options and doesn't ask for them.
Correct the SYMBOL_DEF_USER flag of the choice symbol to be only set if
it's set for all values.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/kconfig/confdata.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 2ee48c3..a69d8ac 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -357,7 +357,7 @@ int conf_read(const char *name)
 		for (e = prop->expr; e; e = e->left.expr)
 			if (e->right.sym->visible != no)
 				flags &= e->right.sym->flags;
-		sym->flags |= flags & SYMBOL_DEF_USER;
+		sym->flags &= flags | ~SYMBOL_DEF_USER;
 	}
 
 	sym_change_count += conf_warnings || conf_unsaved;
-- 
1.4.1.rc2.gfc04


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

* [PATCH] kconfig: support DOS line endings
  2006-07-29  7:19             ` [PATCH] kconfig: correct oldconfig for unset choice options sam
@ 2006-07-29  7:19               ` sam
  2006-07-29  7:19                 ` [PATCH] kbuild: consistently decide when to rebuild a target sam
  0 siblings, 1 reply; 14+ messages in thread
From: sam @ 2006-07-29  7:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Matthew Wilcox, Sam Ravnborg

From: Matthew Wilcox <matthew@wil.cx>

Kconfig doesn't currently handle config files with DOS line endings.
While these are, of course, an abomination, etc, etc, it can be handy
to not have to convert them first.  It's also a tiny patch and even adds
support for lines ending in just \r or even \n\r.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/kconfig/confdata.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index a69d8ac..69f96b3 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -193,8 +193,11 @@ load:
 				continue;
 			*p++ = 0;
 			p2 = strchr(p, '\n');
-			if (p2)
-				*p2 = 0;
+			if (p2) {
+				*p2-- = 0;
+				if (*p2 == '\r')
+					*p2 = 0;
+			}
 			if (def == S_DEF_USER) {
 				sym = sym_find(line + 7);
 				if (!sym) {
@@ -266,6 +269,7 @@ load:
 				;
 			}
 			break;
+		case '\r':
 		case '\n':
 			break;
 		default:
-- 
1.4.1.rc2.gfc04


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

* [PATCH] kbuild: consistently decide when to rebuild a target
  2006-07-29  7:19               ` [PATCH] kconfig: support DOS line endings sam
@ 2006-07-29  7:19                 ` sam
  0 siblings, 0 replies; 14+ messages in thread
From: sam @ 2006-07-29  7:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sam Ravnborg, Sam Ravnborg

From: Sam Ravnborg <sam@mars.ravnborg.org>

Consistently decide when to rebuild a target across all of
if_changed, if_changed_dep, if_changed_rule.
PHONY targets are now treated alike (ignored) for all targets

While add it make Kbuild.include almost readable by factoring out a few
bits to some common variables and reuse this in Makefile.build.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/Kbuild.include |   52 ++++++++++++++++++++++++++++--------------------
 scripts/Makefile.build |    5 +++--
 usr/Makefile           |    2 ++
 3 files changed, 35 insertions(+), 24 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 2180c88..7a18353 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -8,9 +8,13 @@ empty   :=
 space   := $(empty) $(empty)
 
 ###
+# Name of target with a '.' as filename prefix. foo/bar.o => foo/.bar.o
+dot-target = $(dir $@).$(notdir $@)
+
+###
 # The temporary file to save gcc -MD generated dependencies must not
 # contain a comma
-depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
+depfile = $(subst $(comma),_,$(dot-target).d)
 
 ###
 # filename of target with directory and extension stripped
@@ -113,40 +117,44 @@ # See Documentation/kbuild/makefiles.txt
 ifneq ($(KBUILD_NOCMDDEP),1)
 # Check if both arguments has same arguments. Result in empty string if equal
 # User may override this check using make KBUILD_NOCMDDEP=1
-arg-check = $(strip $(filter-out $(1), $(2)) $(filter-out $(2), $(1)) )
+arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
+                    $(filter-out $(cmd_$@),   $(cmd_$(1))) )
 endif
 
 # echo command. Short version is $(quiet) equals quiet, otherwise full command
 echo-cmd = $(if $($(quiet)cmd_$(1)), \
 	echo '  $(call escsq,$($(quiet)cmd_$(1)))';)
 
+# >'< substitution is for echo to work,
+# >$< substitution to preserve $ when reloading .cmd file
+# note: when using inline perl scripts [perl -e '...$$t=1;...']
+# in $(cmd_xxx) double $$ your perl vars
 make-cmd = $(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1)))))
 
-# function to only execute the passed command if necessary
-# >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file
-# note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars
+# Find any prerequisites that is newer than target or that does not exist.
+# PHONY targets skipped in both cases.
+any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
+
+# Execute command if command has changed or prerequisitei(s) are updated
 #
-if_changed = $(if $(strip $(filter-out $(PHONY),$?)          \
-		$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
-	@set -e; \
-	$(echo-cmd) $(cmd_$(1)); \
-	echo 'cmd_$@ := $(make-cmd)' > $(@D)/.$(@F).cmd)
+if_changed = $(if $(strip $(any-prereq) $(arg-check)),                       \
+	@set -e;                                                             \
+	$(echo-cmd) $(cmd_$(1));                                             \
+	echo 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
 
 # execute the command and also postprocess generated .d dependencies
 # file
-if_changed_dep = $(if $(strip $(filter-out $(PHONY),$?)  \
-		$(filter-out FORCE $(wildcard $^),$^)    \
-	$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),     \
-	@set -e; \
-	$(echo-cmd) $(cmd_$(1)); \
-	scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(@D)/.$(@F).tmp; \
-	rm -f $(depfile); \
-	mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)
+if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ),                  \
+	@set -e;                                                             \
+	$(echo-cmd) $(cmd_$(1));                                             \
+	scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\
+	rm -f $(depfile);                                                    \
+	mv -f $(dot-target).tmp $(dot-target).cmd)
 
 # Usage: $(call if_changed_rule,foo)
 # will check if $(cmd_foo) changed, or any of the prequisites changed,
 # and if so will execute $(rule_foo)
-if_changed_rule = $(if $(strip $(filter-out $(PHONY),$?)            \
-			$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\
-			@set -e; \
-			$(rule_$(1)))
+if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ),                 \
+	@set -e;                                                             \
+	$(rule_$(1)))
+
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 3cb445c..e2ad2dc 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -191,9 +191,10 @@ define rule_cc_o_c
 	$(call echo-cmd,checksrc) $(cmd_checksrc)			  \
 	$(call echo-cmd,cc_o_c) $(cmd_cc_o_c);				  \
 	$(cmd_modversions)						  \
-	scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > $(@D)/.$(@F).tmp;  \
+	scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' >    \
+	                                              $(dot-target).tmp;  \
 	rm -f $(depfile);						  \
-	mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
+	mv -f $(dot-target).tmp $(dot-target).cmd
 endef
 
 # Built-in and composite module parts
diff --git a/usr/Makefile b/usr/Makefile
index e938242..2c8f362 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -3,6 +3,8 @@ # kbuild file for usr/ - including initr
 #
 
 klibcdirs:;
+PHONY += klibcdirs
+
 
 # Generate builtin.o based on initramfs_data.o
 obj-y := initramfs_data.o
-- 
1.4.1.rc2.gfc04


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

* Re: [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x
  2006-07-29  7:19 ` [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x sam
  2006-07-29  7:19   ` [PATCH] kbuild: version.h and new headers_* targets does not require a kernel config sam
@ 2006-07-29  9:07   ` Alexey Dobriyan
  2006-07-30 19:31     ` Sam Ravnborg
  2006-08-01 22:00     ` H. Peter Anvin
  1 sibling, 2 replies; 14+ messages in thread
From: Alexey Dobriyan @ 2006-07-29  9:07 UTC (permalink / raw)
  To: sam; +Cc: linux-kernel, Sam Ravnborg

On Sat, Jul 29, 2006 at 09:19:33AM +0200, sam@ravnborg.org wrote:
> When we introduced -rR then aic7xxx no loger could pick up definition
> of YACC&LEX from make - so do it explicit now.

> --- a/drivers/scsi/aic7xxx/aicasm/Makefile
> +++ b/drivers/scsi/aic7xxx/aicasm/Makefile
> @@ -14,6 +14,8 @@ LIBS=	-ldb
>  clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
>  # Override default kernel CFLAGS.  This is a userland app.
>  AICASM_CFLAGS:= -I/usr/include -I.
> +LEX= flex
> +YACC= bison
>  YFLAGS= -d
>  
>  NOMAN=	noman

SuSv3 lists "lex" and "yacc" as _the_ names. Is there any distro which
doesn't install compat symlinks?


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

* Re: [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x
  2006-07-29  9:07   ` [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x Alexey Dobriyan
@ 2006-07-30 19:31     ` Sam Ravnborg
  2006-08-01 22:00       ` H. Peter Anvin
  2006-08-01 22:00     ` H. Peter Anvin
  1 sibling, 1 reply; 14+ messages in thread
From: Sam Ravnborg @ 2006-07-30 19:31 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: linux-kernel

On Sat, Jul 29, 2006 at 01:07:25PM +0400, Alexey Dobriyan wrote:
> On Sat, Jul 29, 2006 at 09:19:33AM +0200, sam@ravnborg.org wrote:
> > When we introduced -rR then aic7xxx no loger could pick up definition
> > of YACC&LEX from make - so do it explicit now.
> 
> > --- a/drivers/scsi/aic7xxx/aicasm/Makefile
> > +++ b/drivers/scsi/aic7xxx/aicasm/Makefile
> > @@ -14,6 +14,8 @@ LIBS=	-ldb
> >  clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
> >  # Override default kernel CFLAGS.  This is a userland app.
> >  AICASM_CFLAGS:= -I/usr/include -I.
> > +LEX= flex
> > +YACC= bison
> >  YFLAGS= -d
> >  
> >  NOMAN=	noman
> 
> SuSv3 lists "lex" and "yacc" as _the_ names. Is there any distro which
> doesn't install compat symlinks?
Other places in kernel hardcode bison/flex so to be consistent aic7xxx
does the same.

	Sam

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

* Re: [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x
  2006-07-29  9:07   ` [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x Alexey Dobriyan
  2006-07-30 19:31     ` Sam Ravnborg
@ 2006-08-01 22:00     ` H. Peter Anvin
  1 sibling, 0 replies; 14+ messages in thread
From: H. Peter Anvin @ 2006-08-01 22:00 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: sam, linux-kernel, Sam Ravnborg

Alexey Dobriyan wrote:
> On Sat, Jul 29, 2006 at 09:19:33AM +0200, sam@ravnborg.org wrote:
>> When we introduced -rR then aic7xxx no loger could pick up definition
>> of YACC&LEX from make - so do it explicit now.
> 
>> --- a/drivers/scsi/aic7xxx/aicasm/Makefile
>> +++ b/drivers/scsi/aic7xxx/aicasm/Makefile
>> @@ -14,6 +14,8 @@ LIBS=	-ldb
>>  clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
>>  # Override default kernel CFLAGS.  This is a userland app.
>>  AICASM_CFLAGS:= -I/usr/include -I.
>> +LEX= flex
>> +YACC= bison
>>  YFLAGS= -d
>>  
>>  NOMAN=	noman
> 
> SuSv3 lists "lex" and "yacc" as _the_ names. Is there any distro which
> doesn't install compat symlinks?
> 

At least on Red Hat/Fedora, "yacc" invokes BSD yacc, which produces 
worse code than bison.

	-hpa

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

* Re: [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x
  2006-07-30 19:31     ` Sam Ravnborg
@ 2006-08-01 22:00       ` H. Peter Anvin
  0 siblings, 0 replies; 14+ messages in thread
From: H. Peter Anvin @ 2006-08-01 22:00 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Alexey Dobriyan, linux-kernel

Sam Ravnborg wrote:
> Other places in kernel hardcode bison/flex so to be consistent aic7xxx
> does the same.

It would be better if this was centralized.

	-hpa

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

end of thread, other threads:[~2006-08-01 22:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-29  7:15 [PATCH 0/18] kbuild fixes Sam Ravnborg
2006-07-29  7:19 ` [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x sam
2006-07-29  7:19   ` [PATCH] kbuild: version.h and new headers_* targets does not require a kernel config sam
2006-07-29  7:19     ` [PATCH] kbuild: .gitignore utsrelease.h sam
2006-07-29  7:19       ` [PATCH] kbuild: improve error from file2alias sam
2006-07-29  7:19         ` [PATCH] kbuild: fix typo in modpost sam
2006-07-29  7:19           ` [PATCH] kbuild: -fno-stack-protector is not good sam
2006-07-29  7:19             ` [PATCH] kconfig: correct oldconfig for unset choice options sam
2006-07-29  7:19               ` [PATCH] kconfig: support DOS line endings sam
2006-07-29  7:19                 ` [PATCH] kbuild: consistently decide when to rebuild a target sam
2006-07-29  9:07   ` [PATCH] kbuild: hardcode value of YACC&LEX for aic7-triple-x Alexey Dobriyan
2006-07-30 19:31     ` Sam Ravnborg
2006-08-01 22:00       ` H. Peter Anvin
2006-08-01 22:00     ` H. Peter Anvin

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