kbuild updates - second round
Subsystems (5)
Following are the accumulated kbuild updates.
A mixture of new stuff and fixes.
The cc-cross-prefix is new and developed on request from Geert Uytterhoeven. With cc-cross-prefix it is now much easier to have a few default cross compile prefixes and defaulting to none - if none of them were present. ARCH maintainers are expected to pick up this feature soon.
The other noteworthy change is the move of the mailing list for kbuild/kconfig. Subscribe to the new list like this:
Send a mail to [email protected]
Subject: whatever
subscribe linux-kbuild
Then you will receive a confirmation mail and when you have answered that mail you are subscribed to the new unmoderated list.
Please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git
Full diff below - because it is so little. See individual patches in the git tree.
Sam
Documentation/kbuild/kconfig-language.txt | 14 ++++++++- Documentation/kbuild/makefiles.txt | 22 ++++++++++++++ MAINTAINERS | 3 +- Makefile | 45 +++++++++++++---------------- scripts/Kbuild.include | 11 +++++++ scripts/basic/docproc.c | 11 ++++++- scripts/kconfig/Makefile | 2 +- scripts/mod/modpost.c | 3 ++ scripts/package/builddeb | 2 + 9 files changed, 83 insertions(+), 30 deletions(-)
Randy Dunlap (1):
kconfig: update kconfig-language text
Rob Landley (2):
kbuild: stop docproc segfaulting when SRCTREE isn't set.
kconfig: comment typo in scripts/kconfig/Makefile.
Sam Ravnborg (4):
kbuild: mailing list has moved
kbuild: disable depmod in cross-compile kernel build
kbuild: introduce cc-cross-prefix
kbuild: fix first module build
Trent Piepho (1):
kbuild: modpost problem when symbols move from one module to another
Yinghai Lu (1):
kbuild: cscope - filter out .tmp_* in find_sources
[email protected] (1):
kbuild: make deb-pkg - add 'Provides:' line
Documentation/kbuild/kconfig-language.txt +13 -1
@@ -77,7 +77,12 @@ applicable everywhere (see syntax). Optionally, dependencies only for this default value can be added with "if". -- dependencies: "depends on"/"requires" <expr> +- type definition + default value: + "def_bool"/"def_tristate" <expr> ["if" <expr>] + This is a shorthand notation for a type definition plus a value. + Optionally dependencies for this default value can be added with "if". + +- dependencies: "depends on" <expr> This defines a dependency for this menu entry. If multiple dependencies are defined, they are connected with '&&'. Dependencies are applied to all other options within this menu entry (which also
@@ -289,3 +294,10 @@ source: "source" <prompt> This reads the specified configuration file. This file is always parsed. + +mainmenu: + + "mainmenu" <prompt> + +This sets the config program's title bar if the config program chooses +to use it.
Documentation/kbuild/makefiles.txt +22 -0
@@ -518,6 +518,28 @@ more details, with real examples. In this example for a specific GCC version the build will error out explaining to the user why it stops. + cc-cross-prefix + cc-cross-prefix is used to check if there exist a $(CC) in path with + one of the listed prefixes. The first prefix where there exist a + prefix$(CC) in the PATH is returned - and if no prefix$(CC) is found + then nothing is returned. + Additional prefixes are separated by a single space in the + call of cc-cross-prefix. + This functionality is usefull for architecture Makefile that try + to set CROSS_COMPILE to well know values but may have several + values to select between. + It is recommended only to try to set CROSS_COMPILE is it is a cross + build (host arch is different from target arch). And is CROSS_COMPILE + is already set then leave it with the old value. + + Example: + #arch/m68k/Makefile + ifneq ($(SUBARCH),$(ARCH)) + ifeq ($(CROSS_COMPILE),) + CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu-) + endif + endif + === 4 Host Program support Kbuild supports building executables on the host for use during the
MAINTAINERS +2 -1
@@ -2178,7 +2178,7 @@ S: Maintained KCONFIG P: Roman Zippel M: [email protected] -L: [email protected] +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
Makefile +20 -25
94 lines not on this page · raw message
scripts/Kbuild.include +11 -0
@@ -56,6 +56,17 @@ endef # gcc support functions # See documentation in Documentation/kbuild/makefiles.txt +# cc-cross-prefix +# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) +# Return first prefix where a prefix$(CC) is found in PATH. +# If no $(CC) found in PATH with listed prefixes return nothing +cc-cross-prefix = \ + $(word 1, $(foreach c,$(1), \ + $(shell set -e; \ + if (which $(strip $(c))$(CC)) > /dev/null 2>&1 ; then \ + echo $(c); \ + fi))) + # output directory for tests below TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
scripts/basic/docproc.c +9 -2
@@ -66,12 +66,15 @@ FILELINE * entity_system;#define FUNCTION "-function"#define NOFUNCTION "-nofunction" +char *srctree; +void usage (void ) {fprintf (stderr,"Usage: docproc {doc|depend} file\n" );fprintf (stderr,"Input is read from file.tmpl. Output is sent to stdout\n" );fprintf (stderr,"doc: frontend when generating kernel documentation\n" );fprintf (stderr,"depend: generate list of files referenced within file\n" ); +fprintf (stderr,"Environment variable SRCTREE: absolute path to kernel source tree.\n" ); }/*
@@ -90,7 +93,7 @@ void exec_kernel_doc(char **svec)exit (1 );case 0 :memset (real_filename,0 ,sizeof (real_filename)); -strncat (real_filename,getenv ("SRCTREE" ),PATH_MAX ); +strncat (real_filename, srctree,PATH_MAX ); strncat(real_filename, KERNELDOCPATH KERNELDOC,PATH_MAX -strlen (real_filename));execvp (real_filename, svec);
@@ -171,7 +174,7 @@ void find_export_symbols(char * filename)if (filename_exist (filename) ==NULL ) {char real_filename[PATH_MAX +1 ];memset (real_filename,0 ,sizeof (real_filename)); -strncat (real_filename,getenv ("SRCTREE" ),PATH_MAX ); +strncat (real_filename, srctree,PATH_MAX );strncat (real_filename, filename,PATH_MAX -strlen (real_filename)); sym =add_new_file (filename);
@@ -338,6 +341,10 @@ void parse_file(FILE *infile)int main (int argc,char *argv[]) {FILE * infile; + + srctree =getenv ("SRCTREE" ); +if (!srctree) + srctree =getcwd (NULL ,0 );if (argc !=3 ) {usage ();exit (1 );
scripts/kconfig/Makefile +1 -1
@@ -84,7 +84,7 @@ help: # lxdialog stuff check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh -# Use reursively expanded variables so we do not call gcc unless +# Use recursively expanded variables so we do not call gcc unless # we really need to do so. (Do not call gcc as part of make mrproper) HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
scripts/mod/modpost.c +3 -0
@@ -268,6 +268,9 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod,"was in %s%s\n" , mod->name, name, s->module->name, is_vmlinux(s->module->name) ?"":".ko"); + }else { +/* In case Modules.symvers was out of date */ + s->module = mod; } } s->preloaded =0 ;
scripts/package/builddeb +2 -0
@@ -83,6 +83,7 @@ Maintainer: $name Standards-Version: 3.6.1 Package: $packagename +Provides: kernel-image-$version, linux-image-$version Architecture: any Description: User Mode Linux kernel, version $version User-mode Linux is a port of the Linux kernel to its own system call
@@ -104,6 +105,7 @@ Maintainer: $name Standards-Version: 3.6.1 Package: $packagename +Provides: kernel-image-$version, linux-image-$version Architecture: any Description: Linux kernel, version $version This package contains the Linux kernel, modules and corresponding other
Geert Uytterhoeven
maintainerPATCH 1/1 cc-cross-prefix spelling (was: Re: [GI:wqT PULL] kbuild updates - second round)
Quoted 1 line · Sam Ravnborg
The cc-cross-prefix is new and developed on request from Geert Uytterhoeven.
Spelling fixes for cc-cross-prefix documentation
--- Documentation/kbuild/makefiles.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Documentation/kbuild/makefiles.txt +5 -5
@@ -519,17 +519,17 @@ more details, with real examples. to the user why it stops. cc-cross-prefix - cc-cross-prefix is used to check if there exist a $(CC) in path with + cc-cross-prefix is used to check if there exists a $(CC) in path with one of the listed prefixes. The first prefix where there exist a prefix$(CC) in the PATH is returned - and if no prefix$(CC) is found then nothing is returned. Additional prefixes are separated by a single space in the call of cc-cross-prefix. - This functionality is usefull for architecture Makefile that try - to set CROSS_COMPILE to well know values but may have several + This functionality is useful for architecture Makefiles that try + to set CROSS_COMPILE to well-known values but may have several values to select between. - It is recommended only to try to set CROSS_COMPILE is it is a cross - build (host arch is different from target arch). And is CROSS_COMPILE + It is recommended only to try to set CROSS_COMPILE if it is a cross + build (host arch is different from target arch). And if CROSS_COMPILE is already set then leave it with the old value. Example:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH] cc-cross-prefix spelling (was: Re: [GI:wqT PULL] kbuild updates - second round)
Quoted 4 lines · Geert Uytterhoeven
Quoted 1 line · Sam Ravnborg
The cc-cross-prefix is new and developed on request from Geert Uytterhoeven.
Spelling fixes for cc-cross-prefix documentation
Thanks - all my speling erros distracts people wehn reading the documentation I actualy write ;-)
Sam
Geert Uytterhoeven
maintainerPATCH 1/1 m68k: Use cc-cross-prefix (was: Re: [GI:wqT PULL] kbuild updates - second round)
In reply to Sam RavnborgQuoted 4 lines · Sam Ravnborg
The cc-cross-prefix is new and developed on request from Geert Uytterhoeven. With cc-cross-prefix it is now much easier to have a few default cross compile prefixes and defaulting to none - if none of them were present. ARCH maintainers are expected to pick up this feature soon.
Thanks, seems to work fine!
m68k: Use cc-cross-prefix
--- arch/m68k/Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
arch/m68k/Makefile +3 -5
@@ -13,16 +13,14 @@ # Copyright (C) 1994 by Hamish Macdonald # -# test for cross compiling -COMPILE_ARCH = $(shell uname -m) - # override top level makefile AS += -m68020 LDFLAGS := -m m68kelf LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds ifneq ($(COMPILE_ARCH),$(ARCH)) - # prefix for cross-compiling binaries - CROSS_COMPILE = m68k-linux-gnu- + ifeq ($(CROSS_COMPILE),) + CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) + endif endif ifdef CONFIG_SUN3
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH] m68k: Use cc-cross-prefix (was: Re: [GI:wqT PULL] kbuild updates - second round)
Quoted 25 lines · Geert Uytterhoeven
Quoted 4 lines · Sam Ravnborg
The cc-cross-prefix is new and developed on request from Geert Uytterhoeven. With cc-cross-prefix it is now much easier to have a few default cross compile prefixes and defaulting to none - if none of them were present. ARCH maintainers are expected to pick up this feature soon.
Thanks, seems to work fine!
m68k: Use cc-cross-prefix
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)arch/m68k/Makefile +0
-3@@ -13,16 +13,14 @@ # Copyright (C) 1994 by Hamish Macdonald # -# test for cross compiling -COMPILE_ARCH = $(shell uname -m) - # override top level makefile
arch/m68k/Makefile line 24
Quoted 10 lines
arch/m68k/Makefile +3
-2AS += -m68020 LDFLAGS := -m m68kelf LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds ifneq ($(COMPILE_ARCH),$(ARCH)) - # prefix for cross-compiling binaries - CROSS_COMPILE = m68k-linux-gnu- + ifeq ($(CROSS_COMPILE),) + CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) + endif endif
Patch seems bogus.
You kill the assignment to COMPILE_ARCH yet you
refer to it in the line:
ifneq ($(COMPILE_ARCH),...
Did you mean to use $(SUBARCH) here?
Sam
Geert Uytterhoeven
maintainerRe: [PATCH] m68k: Use cc-cross-prefix (was: Re: [GI:wqT PULL] kbuild updates - second round)
Quoted 41 lines · Sam Ravnborg
Quoted 25 lines · Geert Uytterhoeven
Quoted 4 lines · Sam Ravnborg
The cc-cross-prefix is new and developed on request from Geert Uytterhoeven. With cc-cross-prefix it is now much easier to have a few default cross compile prefixes and defaulting to none - if none of them were present. ARCH maintainers are expected to pick up this feature soon.
Thanks, seems to work fine!
m68k: Use cc-cross-prefix
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)arch/m68k/Makefile +0
-3@@ -13,16 +13,14 @@ # Copyright (C) 1994 by Hamish Macdonald # -# test for cross compiling -COMPILE_ARCH = $(shell uname -m) - # override top level makefilearch/m68k/Makefile line 24
Quoted 10 lines
arch/m68k/Makefile +3
-2AS += -m68020 LDFLAGS := -m m68kelf LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds ifneq ($(COMPILE_ARCH),$(ARCH)) - # prefix for cross-compiling binaries - CROSS_COMPILE = m68k-linux-gnu- + ifeq ($(CROSS_COMPILE),) + CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) + endif endifPatch seems bogus.
You kill the assignment toCOMPILE_ARCHyet you
refer to it in the line:
ifneq ($(COMPILE_ARCH),...
Quoted 1 line
Did you mean to use $(SUBARCH) here?
Oops, indeed. Sorry, here's a new one...
m68k: Use cc-cross-prefix
--- arch/m68k/Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
arch/m68k/Makefile +4 -6
@@ -13,16 +13,14 @@ # Copyright (C) 1994 by Hamish Macdonald # -# test for cross compiling -COMPILE_ARCH = $(shell uname -m) - # override top level makefile AS += -m68020 LDFLAGS := -m m68kelf LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds -ifneq ($(COMPILE_ARCH),$(ARCH)) - # prefix for cross-compiling binaries - CROSS_COMPILE = m68k-linux-gnu- +ifneq ($(SUB_ARCH),$(ARCH)) + ifeq ($(CROSS_COMPILE),) + CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) + endif endif ifdef CONFIG_SUN3
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH] m68k: Use cc-cross-prefix (was: Re: [GI:wqT PULL] kbuild updates - second round)
arch/m68k/Makefile line 22
Quoted 3 lines · Geert Uytterhoeven
arch/m68k/Makefile +3
-0+ifneq ($(SUB_ARCH),$(ARCH)) + ifeq ($(CROSS_COMPILE),) + CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
I've not paid much attention to discussion over this (I tend to build natively, less stress :) ), so pardon my ignorance. Does the above make any difference for me when I use CROSS_COMPILE=m68k-unknown-linux-gnu-, or does it just detect m68k-linux-gnu- and m68k-linux-?
-- kolla, that gentoo/m68k lunatic :)
Geert Uytterhoeven
maintainerRe: [PATCH] m68k: Use cc-cross-prefix (was: Re: [GI:wqT PULL] kbuild updates - second round)
Quoted 9 lines · Kolbjørn Barmen
arch/m68k/Makefile line 22
Quoted 3 lines · Geert Uytterhoeven
arch/m68k/Makefile +3
-0+ifneq ($(SUB_ARCH),$(ARCH)) + ifeq ($(CROSS_COMPILE),) + CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)I've not paid much attention to discussion over this (I tend to build natively, less stress :) ), so pardon my ignorance. Does the above make any difference for me when I use CROSS_COMPILE=m68k-unknown-linux-gnu-, or does it just detect m68k-linux-gnu- and m68k-linux-?
No, it makes no difference if you explicitly pass
CROSS_COMPILE=m68k-unknown-linux-gnu-.
If you want, we can add m68k-unknown-linux-gnu- to the list in arch/m68k/Makefile, so it cab be autodetected.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH] m68k: Use cc-cross-prefix (was: Re: [GI:wqT PULL] kbuild updates - second round)
Quoted 11 lines · Geert Uytterhoeven
Quoted 9 lines · Kolbjørn Barmen
arch/m68k/Makefile line 22
Quoted 3 lines · Geert Uytterhoeven
arch/m68k/Makefile +3
-0+ifneq ($(SUB_ARCH),$(ARCH)) + ifeq ($(CROSS_COMPILE),) + CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)I've not paid much attention to discussion over this (I tend to build natively, less stress :) ), so pardon my ignorance. Does the above make any difference for me when I use CROSS_COMPILE=m68k-unknown-linux-gnu-, or does it just detect m68k-linux-gnu- and m68k-linux-?
Quoted 5 lines
No, it makes no difference if you explicitly pass
CROSS_COMPILE=m68k-unknown-linux-gnu-.If you want, we can add m68k-unknown-linux-gnu- to the list in
arch/m68k/Makefile, so it cab be autodetected.
Sure, that would be excellent - thanks :)
-- kolla
Re: [PATCH] m68k: Use cc-cross-prefix (was: Re: [GI:wqT PULL] kbuild updates - second round)
In reply to Geert UytterhoevenQuoted 1 line · Geert Uytterhoeven
Quoted 1 line
Did you mean to use $(SUBARCH) here?
^^^^^^^
Quoted 16 lines
Oops, indeed. Sorry, here's a new one...
m68k: Use cc-cross-prefix
Signed-off-by Geert Uytterhoeven <[email protected]>--- arch/m68k/Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)arch/m68k/Makefile +0
-1@@ -13,16 +13,14 @@ # Copyright (C) 1994 by Hamish Macdonald # -# test for cross compiling
arch/m68k/Makefile line 20
Quoted 10 lines
arch/m68k/Makefile +1
-5-COMPILE_ARCH = $(shell uname -m) - # override top level makefile AS += -m68020 LDFLAGS := -m m68kelf LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds -ifneq ($(COMPILE_ARCH),$(ARCH)) - # prefix for cross-compiling binaries - CROSS_COMPILE = m68k-linux-gnu- +ifneq ($(SUB_ARCH),$(ARCH))
^^^^^^^^
You did test it, didn't you?
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Geert Uytterhoeven
maintainerRe: [PATCH] m68k: Use cc-cross-prefix (was: Re: [GI:wqT PULL] kbuild updates - second round)
Quoted 9 lines · Andreas Schwab
Quoted 1 line · Geert Uytterhoeven
Quoted 1 line
Did you mean to use $(SUBARCH) here?
^^^^^^^Quoted 3 lines
Oops, indeed. Sorry, here's a new one...
+ifneq ($(SUB_ARCH),$(ARCH))
^^^^^^^^You did test it, didn't you?
Bummer, I only tested a cross-compile build, as I don't have access to a native m68k machine at this moment. Third time, good time? I also added m68k-unknown-linux-gnu- to please Kolbjørn Barmen and the other Gentoo people.
---
m68k: Use cc-cross-prefix
--- arch/m68k/Makefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
arch/m68k/Makefile +5 -6
@@ -13,16 +13,15 @@ # Copyright (C) 1994 by Hamish Macdonald # -# test for cross compiling -COMPILE_ARCH = $(shell uname -m) - # override top level makefile AS += -m68020 LDFLAGS := -m m68kelf LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds -ifneq ($(COMPILE_ARCH),$(ARCH)) - # prefix for cross-compiling binaries - CROSS_COMPILE = m68k-linux-gnu- +ifneq ($(SUBARCH),$(ARCH)) + ifeq ($(CROSS_COMPILE),) + CROSS_COMPILE := $(call cc-cross-prefix, \ + m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-) + endif endif ifdef CONFIG_SUN3
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds