mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PATCH] kbuild updates
@ 2008-01-28 21:26 Sam Ravnborg
  2008-01-28 22:04 ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Sam Ravnborg @ 2008-01-28 21:26 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton, LKML, linux-kbuild

Hi Linus.

Please pull following patches for kbuild/kconfig and a few other areas.

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

This time there are 79 patches.
The diffstat shows that several files outside usual kbuild/kconfig
areas are touched.

This is due to following reasons:
- Deleting comments that mentions 'make dep'
- Introducing __used all over the tree
- Small consolidation touching all arch .lds files

The note worthy things this time is:
o Added support for mecurial in setlocalversion
o Patches from the Linux Kernel Translation project has resurfaced
  We are mising wide char support, that will wait until next merge window
o We can now override symbols in .config simply by adding the new value
  in the bottom. It will only work if the dependencies are fulfilled.
o Added modules.order so we now can hand more info over to mod-utils
  about requested loading order of modules
o Use git describe for localversion tag
o Improved section mismatch support

The latter will cause a higher number of section mismatch warnings
to be shown initially. 45 with a defconfig build.
This is because the new setup are much less dependent on the actual
configuration and thus much more mismatched will be shown with a
typical configuration.

To help getting it all fixed a verbose mode can be enabled
if CONFIG_SECTION_MISMATCH is set equal to 'y' but due to the
high number of warnings I kept it default 'n'.

When we have x86.git and first one or two batches from Andrew
merged I hope to address most if not all of the remaning
section mismatches for the normal builds.

Randy Dunlap has done a very good job addressing many of
the section mismatches in various drivers already and many
of his fixes are coming in via different subsystem maintainers.
So despite the huge number we are in good shape.

	Sam


Adrian Bunk (4):
      Remove references to "make dep"
      kconfig: remove "enable"
      remove __attribute_used__
      asm-generic/vmlix.lds.h: simplify __mem{init,exit}* dependencies

Andi Kleen (3):
      kbuild: declare the modpost error functions as printf like
      kbuild: fix format string warnings in modpost
      kbuild: fix a buffer overflow in modpost

Andreas Mohr (1):
      kbuild: eradicate bashisms in scripts/patch-kernel

Andres Salomon (1):
      kconfig: use getopt() in conf.c for handling command line arguments

Aron Griffis (1):
      kbuild: support mercurial in setlocalversion

Daniel De Graaf (1):
      kbuild: support ARCH=x86 in buildtar

EGRY Gabor (10):
      kconfig: update-po-config info
      kconfig: whitespace removing
      kconfig: missing macros in gconfig
      kconfig: gettext support for gconfig
      kconfig: macro fix in menu.c
      kconfig: gettext support for xconfig
      kconfig: gettext support for menuconfig
      kconfig: gettext support for lxdialog
      kconfig: gettext support for config
      kconfig: gconfig: symbol fix

Geert Uytterhoeven (1):
      kbuild: Add missing srctree prefix for includecheck and versioncheck

Jan Beulich (2):
      kbuild: scripts/mkmakefile: dynamic determination of output directory
      kconfig: tristate choices with mixed tristate and boolean values

Jan Engelhardt (1):
      kconfig: allow overriding symbols

Johannes Berg (7):
      kernel-doc: fix xml output mode
      kernel-doc: init kernel version
      kernel-doc: single DOC: selection
      kernel-doc: process functions, not DOC:
      kernel-doc: use no-doc option
      kernel-doc: new P directive for DOC: sections
      convert drivers/base/power/Makefile to ccflags

Ladislav Michl (3):
      kconfig: make kconfig MinGW friendly
      kconfig: fix whitespace and sort includes in conf.c
      kconfig: use C89 random functions in conf.c

Mike Frysinger (1):
      kbuild: fixup genksyms usage/getopt

Randy Dunlap (3):
      kbuild: add 'includecheck' help text
      kconfig: add hints/tips/tricks to Documentation/kbuild/kconfig-language.txt
      kbuild: minor scripts/decodecode update

Robert P. J. Day (2):
      Kbuild: Clarify the rpm-related make packaging targets
      A few corrections to include/linux/Kbuild

Roman Zippel (3):
      kconfig: explicitly introduce expression list
      kconfig: environment symbol support
      kconfig: use environment option

Sam Ravnborg (25):
      kbuild: document versioncheck in make help
      kconfig: if ncurses-devel is missing then say so
      kbuild: fix buglet in gcc-version.sh
      kbuild: ignore *.order files
      kbuild: fix installing external modules
      kconfig: rename E_OR & friends to avoid name clash
      kconfig: delete unused FILE_ and SYMBOL_ flags
      kbuild: clean up modpost.c
      kbuild: fix so modpost can now check any .o file
      kbuild: try harder to find symbol names in modpost
      kbuild: code refactoring in modpost
      kbuild: introduce blacklisting in modpost
      kbuild: check section names consistently in modpost
      all archs: consolidate init and exit sections in vmlinux.lds.h
      compiler.h: introduce __section()
      Use separate sections for __dev/__cpu/__mem code/data
      kbuild: introduce new option to enhance section mismatch analysis
      kbuild: link vmlinux.o before kallsyms passes
      kbuild: use simpler section mismatch warnings in modpost
      kbuild: introduce a few helpers in modpost
      kbuild: simplified warning report in modpost
      kbuild: add verbose option to Section mismatch reporting in modpost
      kbuild: warn about ld added unique sections
      Introduce new section reference annotations tags: __ref, __refdata, __refconst
      kconfig: document use of HAVE_*

Tejun Heo (1):
      kbuild: implement modules.order

Theodore Ts'o (3):
      kbuild: change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format
      kbuild: fix scripts/setlocalversion to avoid erroneous -dirty tag
      kbuild: fix false positive -dirty tag caused by make-kpkg

Uwe Kleine-König (1):
      kbuild: ignore cache modifiers for generating the tags files

Valdis Kletnieks (1):
      kbuild: document 'make prepare' in 'make help'

WANG Cong (4):
      CRIS: Remove 'TOPDIR' from Makefiles
      INFINIBAND: Remove 'TOPDIR' from Makefiles
      FRV: Drop 'TOPDIR' from Makefiles
      FS: Remove dead code

 .gitignore                                  |    1 +
 Documentation/kbuild/kconfig-language.txt   |  111 +++-
 Makefile                                    |   28 +-
 arch/alpha/kernel/vmlinux.lds.S             |    8 +-
 arch/alpha/lib/dec_and_lock.c               |    3 +-
 arch/arm/kernel/vmlinux.lds.S               |   10 +-
 arch/arm/mach-imx/Makefile                  |    3 -
 arch/arm/mach-netx/Makefile                 |    3 -
 arch/avr32/kernel/vmlinux.lds.S             |    8 +-
 arch/blackfin/kernel/vmlinux.lds.S          |    8 +-
 arch/cris/arch-v10/vmlinux.lds.S            |    8 +-
 arch/cris/arch-v32/boot/compressed/Makefile |    2 +-
 arch/cris/arch-v32/vmlinux.lds.S            |    8 +-
 arch/frv/boot/Makefile                      |    8 +-
 arch/frv/kernel/gdb-stub.c                  |    2 +-
 arch/frv/kernel/vmlinux.lds.S               |   14 +-
 arch/h8300/kernel/vmlinux.lds.S             |    8 +-
 arch/ia64/kernel/vmlinux.lds.S              |    8 +-
 arch/m32r/kernel/vmlinux.lds.S              |   12 +-
 arch/m68k/kernel/vmlinux-std.lds            |    8 +-
 arch/m68k/kernel/vmlinux-sun3.lds           |    8 +-
 arch/m68knommu/kernel/vmlinux.lds.S         |    8 +-
 arch/mips/kernel/vmlinux.lds.S              |    8 +-
 arch/mips/tx4927/common/Makefile            |    4 -
 arch/mips/tx4938/common/Makefile            |    4 -
 arch/mips/tx4938/toshiba_rbtx4938/Makefile  |    4 -
 arch/parisc/kernel/vmlinux.lds.S            |    8 +-
 arch/powerpc/boot/Makefile                  |    2 +-
 arch/powerpc/kernel/sysfs.c                 |    2 +-
 arch/powerpc/kernel/vmlinux.lds.S           |   10 +-
 arch/powerpc/oprofile/op_model_power4.c     |    6 +-
 arch/ppc/kernel/vmlinux.lds.S               |    8 +-
 arch/s390/kernel/vmlinux.lds.S              |    8 +-
 arch/sh/kernel/vmlinux.lds.S                |    8 +-
 arch/sh64/kernel/Makefile                   |    4 -
 arch/sh64/kernel/vmlinux.lds.S              |    8 +-
 arch/sh64/lib/Makefile                      |    4 -
 arch/sh64/mach-cayman/Makefile              |    4 -
 arch/sh64/mm/Makefile                       |    4 -
 arch/sparc/kernel/vmlinux.lds.S             |    8 +-
 arch/sparc64/kernel/unaligned.c             |    2 +-
 arch/sparc64/kernel/vmlinux.lds.S           |    8 +-
 arch/um/include/init.h                      |   26 +-
 arch/um/kernel/dyn.lds.S                    |    4 +-
 arch/um/kernel/uml.lds.S                    |    4 +-
 arch/v850/kernel/vmlinux.lds.S              |   10 +-
 arch/x86/kernel/vmlinux_32.lds.S            |   14 +-
 arch/x86/kernel/vmlinux_64.lds.S            |   19 +-
 arch/xtensa/kernel/vmlinux.lds.S            |    9 +-
 arch/xtensa/mm/Makefile                     |    4 -
 arch/xtensa/platform-iss/Makefile           |    5 -
 drivers/base/power/Makefile                 |    8 +-
 drivers/infiniband/hw/cxgb3/Makefile        |    3 +-
 drivers/rapidio/rio.h                       |    4 +-
 fs/compat_ioctl.c                           |    2 +-
 fs/smbfs/Makefile                           |   20 -
 include/asm-avr32/setup.h                   |    2 +-
 include/asm-generic/vmlinux.lds.h           |   89 ++-
 include/asm-ia64/gcc_intrin.h               |    2 +-
 include/asm-sh/machvec.h                    |    2 +-
 include/asm-sh/thread_info.h                |    2 +-
 include/asm-x86/thread_info_32.h            |    2 +-
 include/linux/Kbuild                        |    8 +-
 include/linux/compiler-gcc3.h               |    2 -
 include/linux/compiler-gcc4.h               |    1 -
 include/linux/compiler.h                    |    9 +-
 include/linux/elfnote.h                     |    2 +-
 include/linux/init.h                        |  130 ++--
 include/linux/module.h                      |    4 +-
 include/linux/moduleparam.h                 |    4 +-
 include/linux/pci.h                         |    2 +-
 init/Kconfig                                |    8 +
 lib/Kconfig.debug                           |   32 +
 scripts/Makefile.build                      |   26 +-
 scripts/Makefile.lib                        |    6 +
 scripts/Makefile.modinst                    |    2 +-
 scripts/Makefile.modpost                    |    1 +
 scripts/basic/docproc.c                     |   44 +-
 scripts/decodecode                          |   17 +-
 scripts/gcc-version.sh                      |    5 +-
 scripts/genksyms/genksyms.c                 |   10 +-
 scripts/kconfig/Makefile                    |   39 +-
 scripts/kconfig/POTFILES.in                 |    7 +
 scripts/kconfig/conf.c                      |   69 +-
 scripts/kconfig/confdata.c                  |   24 +-
 scripts/kconfig/expr.c                      |   32 +-
 scripts/kconfig/expr.h                      |   16 +-
 scripts/kconfig/gconf.c                     |   16 +-
 scripts/kconfig/lex.zconf.c_shipped         |    5 +
 scripts/kconfig/lkc.h                       |    5 +
 scripts/kconfig/lxdialog/check-lxdialog.sh  |   16 +-
 scripts/kconfig/lxdialog/checklist.c        |    4 +-
 scripts/kconfig/lxdialog/dialog.h           |   11 +-
 scripts/kconfig/lxdialog/inputbox.c         |    4 +-
 scripts/kconfig/lxdialog/menubox.c          |    6 +-
 scripts/kconfig/lxdialog/textbox.c          |    2 +-
 scripts/kconfig/lxdialog/util.c             |   32 +-
 scripts/kconfig/lxdialog/yesno.c            |    4 +-
 scripts/kconfig/mconf.c                     |  112 +--
 scripts/kconfig/menu.c                      |   49 +-
 scripts/kconfig/qconf.cc                    |  109 ++--
 scripts/kconfig/symbol.c                    |   79 ++-
 scripts/kconfig/util.c                      |   23 +-
 scripts/kconfig/zconf.gperf                 |    2 +-
 scripts/kconfig/zconf.hash.c_shipped        |   19 +-
 scripts/kconfig/zconf.l                     |    5 +
 scripts/kernel-doc                          |   85 ++-
 scripts/mkmakefile                          |   10 +-
 scripts/mod/modpost.c                       | 1210 ++++++++++++++++-----------
 scripts/mod/modpost.h                       |    2 +
 scripts/package/Makefile                    |    5 +-
 scripts/package/buildtar                    |    4 +-
 scripts/patch-kernel                        |   22 +-
 scripts/setlocalversion                     |   29 +-
 114 files changed, 1833 insertions(+), 1159 deletions(-)

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

* Re: [GIT PATCH] kbuild updates
  2008-01-28 21:26 [GIT PATCH] kbuild updates Sam Ravnborg
@ 2008-01-28 22:04 ` Linus Torvalds
  2008-01-28 22:24   ` Sam Ravnborg
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2008-01-28 22:04 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Andrew Morton, LKML, linux-kbuild, Paul Mundt



On Mon, 28 Jan 2008, Sam Ravnborg wrote:
> 
> Please pull following patches for kbuild/kconfig and a few other areas.
> 
> Pull from:
> 	ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git

This conflicts with the SH updates (sh is also integrating 32/64-bit into 
one tree now).

Since I don't know the SH tree or your changes, the probably fairly 
trivial manual merge isn't an option (especially as I'm not at home and 
doing this on a laptop with a less than ideal keyboard and smaller screen 
than I'm used to).

So I hope you and Paul can resolve the conflicts and re-send.

		Linus

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

* Re: [GIT PATCH] kbuild updates
  2008-01-28 22:04 ` Linus Torvalds
@ 2008-01-28 22:24   ` Sam Ravnborg
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2008-01-28 22:24 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, LKML, linux-kbuild, Paul Mundt

On Tue, Jan 29, 2008 at 09:04:38AM +1100, Linus Torvalds wrote:
> 
> 
> On Mon, 28 Jan 2008, Sam Ravnborg wrote:
> > 
> > Please pull following patches for kbuild/kconfig and a few other areas.
> > 
> > Pull from:
> > 	ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git
> 
> This conflicts with the SH updates (sh is also integrating 32/64-bit into 
> one tree now).
> 
> Since I don't know the SH tree or your changes, the probably fairly 
> trivial manual merge isn't an option (especially as I'm not at home and 
> doing this on a laptop with a less than ideal keyboard and smaller screen 
> than I'm used to).
> 
> So I hope you and Paul can resolve the conflicts and re-send.

As expected the conflicts were trivial and I fixed it up.
It was:
- The edit of the vmlinux.lds files
- The removal of make dep

Please pull the updated tree.

	Sam

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

* [GIT PATCH] kbuild updates
@ 2006-07-01 10:58 Sam Ravnborg
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2006-07-01 10:58 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: Sam Ravnborg, LKML

Hi Linus.

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

It contains a few fixes and enhancements.
With this ia64 now builds cleanly again - and this fix may also help others since arguments specified by CFLAGS_file.o := xxx is now processed correct
in all cases. Previously it could cause problems when full path was specified.

It also introduces a nice modpost enhancement so we now warn if a module
uses a symbol that is marked UNUSED.

note - the changes in arch/um/ is related to the 'ia64' fix.

There are a few kbuild issues to be sorted out but that will be after
-rc1. The list as I recall it atm:
- kconfig is not preperly rebuild when kconfig changes
- A few more section checks needs to be introduced as per akpm request
- a few bugzilla entries needs to be addressed
- initramfs is attempted build when usign an external file as input
- mrproper left-overs in arch/arm (akpm)
- fix __FILE__ gets expanded to absolute pathname

	Sam

Sam Ravnborg:
      kbuild: fix ia64 breakage after introducing make -rR
      kbuild: fix segv in modpost
      kbuild: warn when a moduled uses a symbol marked UNUSED

Samuel Thibault:
      kconfig: enhancing accessibility of lxdialog

 Makefile                             |    2 -
 arch/um/scripts/Makefile.rules       |    4 +
 scripts/Kbuild.include               |    4 +
 scripts/Makefile.build               |    2 -
 scripts/Makefile.host                |    6 +-
 scripts/Makefile.lib                 |    6 +-
 scripts/Makefile.modpost             |    2 -
 scripts/kconfig/lxdialog/checklist.c |    7 ++-
 scripts/mod/modpost.c                |   94 +++++++++++++++++++++++++---------
 scripts/mod/modpost.h                |    2 +
 10 files changed, 91 insertions(+), 38 deletions(-)

Since all patches has been on lkml before as individual patches here is
a combined diff.


diff --git a/Makefile b/Makefile
index e9560c6..935a9d6 100644
--- a/Makefile
+++ b/Makefile
@@ -1352,7 +1352,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm
 
 a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \
 	  $(NOSTDINC_FLAGS) $(CPPFLAGS) \
-	  $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
+	  $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
 
 quiet_cmd_as_o_S = AS      $@
 cmd_as_o_S       = $(CC) $(a_flags) -c -o $@ $<
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index 1347dc6..813077f 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -8,7 +8,7 @@ USER_OBJS += $(filter %_user.o,$(obj-y) 
 USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
 
 $(USER_OBJS:.o=.%): \
-	c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(*F).o)
+	c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(basetarget).o)
 $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
 	-Dunix -D__unix__ -D__$(SUBARCH)__
 
@@ -17,7 +17,7 @@ # using it directly.
 UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file))
 
 $(UNPROFILE_OBJS:.o=.%): \
-	c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(*F).o)
+	c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o)
 $(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \
 	-Dunix -D__unix__ -D__$(SUBARCH)__
 
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index b0d067b..2180c88 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -13,6 +13,10 @@ # contain a comma
 depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
 
 ###
+# filename of target with directory and extension stripped
+basetarget = $(basename $(notdir $@))
+
+###
 # Escape single quote for use in echo statements
 escsq = $(subst $(squote),'\$(squote)',$1)
 
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 02a7eea..3cb445c 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -117,7 +117,7 @@ quiet_modtag := $(empty)   $(empty)
 $(obj-m)              : quiet_modtag := [M]
 
 # Default for not multi-part modules
-modname = $(*F)
+modname = $(basetarget)
 
 $(multi-objs-m)         : modname = $(modname-multi)
 $(multi-objs-m:.o=.i)   : modname = $(modname-multi)
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 2b066d1..18ecd4d 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -80,8 +80,10 @@ obj-dirs += $(host-objdirs)
 #####
 # Handle options to gcc. Support building with separate output directory
 
-_hostc_flags   = $(HOSTCFLAGS)   $(HOST_EXTRACFLAGS)   $(HOSTCFLAGS_$(*F).o)
-_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o)
+_hostc_flags   = $(HOSTCFLAGS)   $(HOST_EXTRACFLAGS)   \
+                 $(HOSTCFLAGS_$(basetarget).o)
+_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \
+                 $(HOSTCXXFLAGS_$(basetarget).o)
 
 ifeq ($(KBUILD_SRC),)
 __hostc_flags	= $(_hostc_flags)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 2cb4935..fc498fe 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -82,12 +82,12 @@ # Note: It's possible that one object ge
 #       than one module. In that case KBUILD_MODNAME will be set to foo_bar,
 #       where foo and bar are the name of the modules.
 name-fix = $(subst $(comma),_,$(subst -,_,$1))
-basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(*F)))"
+basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
 modname_flags  = $(if $(filter 1,$(words $(modname))),\
                  -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
 
-_c_flags       = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o)
-_a_flags       = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
+_c_flags       = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o)
+_a_flags       = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
 _cpp_flags     = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F))
 
 # If building the kernel in a separate objtree expand all occurrences
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 576cce5..a495502 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -72,7 +72,7 @@ # Declare generated files as targets for
 # Step 5), compile all *.mod.c files
 
 # modname is set to make c_flags define KBUILD_MODNAME
-modname = $(*F)
+modname = $(notdir $(@:.mod.o=))
 
 quiet_cmd_cc_o_c = CC      $@
       cmd_cc_o_c = $(CC) $(c_flags) $(CFLAGS_MODULE)	\
diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c
index be0200e..7988641 100644
--- a/scripts/kconfig/lxdialog/checklist.c
+++ b/scripts/kconfig/lxdialog/checklist.c
@@ -187,9 +187,12 @@ int dialog_checklist(const char *title, 
 
 	/* Print the list */
 	for (i = 0; i < max_choice; i++) {
-		print_item(list, items[(scroll + i) * 3 + 1],
-			   status[i + scroll], i, i == choice);
+		if (i != choice)
+			print_item(list, items[(scroll + i) * 3 + 1],
+				   status[i + scroll], i, 0);
 	}
+	print_item(list, items[(scroll + choice) * 3 + 1],
+		   status[choice + scroll], choice, 1);
 
 	print_arrows(dialog, choice, item_no, scroll,
 		     box_y, box_x + check_x + 5, list_height);
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 0dd1617..dfde0e8 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -24,7 +24,10 @@ static int all_versions = 0;
 /* If we are modposting external module set to 1 */
 static int external_module = 0;
 /* How a symbol is exported */
-enum export {export_plain, export_gpl, export_gpl_future, export_unknown};
+enum export {
+	export_plain,      export_unused,     export_gpl,
+	export_unused_gpl, export_gpl_future, export_unknown
+};
 
 void fatal(const char *fmt, ...)
 {
@@ -191,7 +194,9 @@ static struct {
 	enum export export;
 } export_list[] = {
 	{ .str = "EXPORT_SYMBOL",            .export = export_plain },
+	{ .str = "EXPORT_UNUSED_SYMBOL",     .export = export_unused },
 	{ .str = "EXPORT_SYMBOL_GPL",        .export = export_gpl },
+	{ .str = "EXPORT_UNUSED_SYMBOL_GPL", .export = export_unused_gpl },
 	{ .str = "EXPORT_SYMBOL_GPL_FUTURE", .export = export_gpl_future },
 	{ .str = "(unknown)",                .export = export_unknown },
 };
@@ -205,6 +210,8 @@ static const char *export_str(enum expor
 static enum export export_no(const char * s)
 {
 	int i;
+	if (!s)
+		return export_unknown;
 	for (i = 0; export_list[i].export != export_unknown; i++) {
 		if (strcmp(export_list[i].str, s) == 0)
 			return export_list[i].export;
@@ -216,8 +223,12 @@ static enum export export_from_sec(struc
 {
 	if (sec == elf->export_sec)
 		return export_plain;
+	else if (sec == elf->export_unused_sec)
+		return export_unused;
 	else if (sec == elf->export_gpl_sec)
 		return export_gpl;
+	else if (sec == elf->export_unused_gpl_sec)
+		return export_unused_gpl;
 	else if (sec == elf->export_gpl_future_sec)
 		return export_gpl_future;
 	else
@@ -366,8 +377,12 @@ static void parse_elf(struct elf_info *i
 			info->modinfo_len = sechdrs[i].sh_size;
 		} else if (strcmp(secname, "__ksymtab") == 0)
 			info->export_sec = i;
+		else if (strcmp(secname, "__ksymtab_unused") == 0)
+			info->export_unused_sec = i;
 		else if (strcmp(secname, "__ksymtab_gpl") == 0)
 			info->export_gpl_sec = i;
+		else if (strcmp(secname, "__ksymtab_unused_gpl") == 0)
+			info->export_unused_gpl_sec = i;
 		else if (strcmp(secname, "__ksymtab_gpl_future") == 0)
 			info->export_gpl_future_sec = i;
 
@@ -1085,38 +1100,64 @@ void buf_write(struct buffer *buf, const
 	buf->pos += len;
 }
 
-void check_license(struct module *mod)
+static void check_for_gpl_usage(enum export exp, const char *m, const char *s)
+{
+	const char *e = is_vmlinux(m) ?"":".ko";
+
+	switch (exp) {
+	case export_gpl:
+		fatal("modpost: GPL-incompatible module %s%s "
+		      "uses GPL-only symbol '%s'\n", m, e, s);
+		break;
+	case export_unused_gpl:
+		fatal("modpost: GPL-incompatible module %s%s "
+		      "uses GPL-only symbol marked UNUSED '%s'\n", m, e, s);
+		break;
+	case export_gpl_future:
+		warn("modpost: GPL-incompatible module %s%s "
+		      "uses future GPL-only symbol '%s'\n", m, e, s);
+		break;
+	case export_plain:
+	case export_unused:
+	case export_unknown:
+		/* ignore */
+		break;
+	}
+}
+
+static void check_for_unused(enum export exp, const char* m, const char* s)
+{
+	const char *e = is_vmlinux(m) ?"":".ko";
+
+	switch (exp) {
+	case export_unused:
+	case export_unused_gpl:
+		warn("modpost: module %s%s "
+		      "uses symbol '%s' marked UNUSED\n", m, e, s);
+		break;
+	default:
+		/* ignore */
+		break;
+	}
+}
+
+static void check_exports(struct module *mod)
 {
 	struct symbol *s, *exp;
 
 	for (s = mod->unres; s; s = s->next) {
 		const char *basename;
-		if (mod->gpl_compatible == 1) {
-			/* GPL-compatible modules may use all symbols */
-			continue;
-		}
 		exp = find_symbol(s->name);
 		if (!exp || exp->module == mod)
 			continue;
 		basename = strrchr(mod->name, '/');
 		if (basename)
 			basename++;
-		switch (exp->export) {
-			case export_gpl:
-				fatal("modpost: GPL-incompatible module %s "
-				      "uses GPL-only symbol '%s'\n",
-				 basename ? basename : mod->name,
-				exp->name);
-				break;
-			case export_gpl_future:
-				warn("modpost: GPL-incompatible module %s "
-				      "uses future GPL-only symbol '%s'\n",
-				      basename ? basename : mod->name,
-				      exp->name);
-				break;
-			case export_plain: /* ignore */ break;
-			case export_unknown: /* ignore */ break;
-		}
+		else
+			basename = mod->name;
+		if (!mod->gpl_compatible)
+			check_for_gpl_usage(exp->export, basename, exp->name);
+		check_for_unused(exp->export, basename, exp->name);
         }
 }
 
@@ -1271,7 +1312,7 @@ static void write_if_changed(struct buff
 }
 
 /* parse Module.symvers file. line format:
- * 0x12345678<tab>symbol<tab>module[<tab>export]
+ * 0x12345678<tab>symbol<tab>module[[<tab>export]<tab>something]
  **/
 static void read_dump(const char *fname, unsigned int kernel)
 {
@@ -1284,7 +1325,7 @@ static void read_dump(const char *fname,
 		return;
 
 	while ((line = get_next_line(&pos, file, size))) {
-		char *symname, *modname, *d, *export;
+		char *symname, *modname, *d, *export, *end;
 		unsigned int crc;
 		struct module *mod;
 		struct symbol *s;
@@ -1297,7 +1338,8 @@ static void read_dump(const char *fname,
 		*modname++ = '\0';
 		if ((export = strchr(modname, '\t')) != NULL)
 			*export++ = '\0';
-
+		if (export && ((end = strchr(export, '\t')) != NULL))
+			*end = '\0';
 		crc = strtoul(line, &d, 16);
 		if (*symname == '\0' || *modname == '\0' || *d != '\0')
 			goto fail;
@@ -1396,7 +1438,7 @@ int main(int argc, char **argv)
 	for (mod = modules; mod; mod = mod->next) {
 		if (mod->skip)
 			continue;
-		check_license(mod);
+		check_exports(mod);
 	}
 
 	for (mod = modules; mod; mod = mod->next) {
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index 2b00c60..d398c61 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -117,7 +117,9 @@ struct elf_info {
 	Elf_Sym      *symtab_start;
 	Elf_Sym      *symtab_stop;
 	Elf_Section  export_sec;
+	Elf_Section  export_unused_sec;
 	Elf_Section  export_gpl_sec;
+	Elf_Section  export_unused_gpl_sec;
 	Elf_Section  export_gpl_future_sec;
 	const char   *strtab;
 	char	     *modinfo;

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

* [GIT PATCH] kbuild updates
@ 2006-03-21 16:17 Sam Ravnborg
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2006-03-21 16:17 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton, LKML; +Cc: Sam Ravnborg

Hi Linus.

Here follows kbuild updates for 2.6.17.
Most noteworthy changes:
o Introduced section consistency checks during modpost.
    This generates a number of warnings for an allmodconfig build but it
    looks sane for most normal configs.
    There may be false positives around but they are getting less.
o Removed scripts/reference_* - they are replaced by the check for
  inconsistent section usage
o Introduced check for duplicated exported symbols
o Make kbuild compatible with a future gnu make change
o Improved support for external modules (depmod, exported symbols)
o Lindent a few files (modpost.c, genksyms.c) addidng to size of diff.

Almost all patches have been in -mm for a shorter or longer period.
Shortlog contains more details.
Patches (all 48) will follow as separate mails.

Please pull from:

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

	Sam

Diffstat:

 Documentation/DocBook/Makefile          |    8 
 Documentation/kbuild/makefiles.txt      |  173 +++--
 Documentation/kbuild/modules.txt        |   98 +++
 Documentation/smart-config.txt          |    4 
 Makefile                                |  234 +++-----
 arch/arm/Makefile                       |    5 
 arch/arm/boot/Makefile                  |    5 
 arch/arm/boot/bootp/Makefile            |    5 
 arch/arm26/Makefile                     |    7 
 arch/arm26/boot/Makefile                |    5 
 arch/i386/Makefile                      |    4 
 arch/i386/kernel/vmlinux.lds.S          |    4 
 arch/ia64/Makefile                      |    5 
 arch/m32r/Makefile                      |    5 
 arch/powerpc/Makefile                   |    2 
 arch/ppc/Makefile                       |    2 
 arch/ppc/boot/Makefile                  |    5 
 arch/ppc/boot/openfirmware/Makefile     |    7 
 arch/sh/Makefile                        |    2 
 arch/um/Makefile                        |    7 
 arch/x86_64/Makefile                    |    4 
 drivers/atm/.gitignore                  |    5 
 drivers/video/matrox/matroxfb_DAC1064.c |    1 
 drivers/video/matrox/matroxfb_DAC1064.h |    1 
 drivers/video/matrox/matroxfb_Ti3026.c  |    1 
 drivers/video/matrox/matroxfb_Ti3026.h  |    1 
 drivers/video/matrox/matroxfb_base.c    |    1 
 drivers/video/matrox/matroxfb_misc.c    |    1 
 init/Kconfig                            |   38 -
 scripts/Kbuild.include                  |   68 +-
 scripts/Makefile.build                  |   29 
 scripts/Makefile.clean                  |   10 
 scripts/Makefile.modinst                |   10 
 scripts/Makefile.modpost                |   19 
 scripts/basic/fixdep.c                  |   15 
 scripts/checkconfig.pl                  |   66 --
 scripts/genksyms/genksyms.c             |  935 ++++++++++++++------------------
 scripts/genksyms/genksyms.h             |   58 -
 scripts/kconfig/Makefile                |    7 
 scripts/kconfig/confdata.c              |    3 
 scripts/kconfig/lxdialog/Makefile       |    6 
 scripts/mkmakefile                      |    9 
 scripts/mod/file2alias.c                |   17 
 scripts/mod/mk_elfconfig.c              |    4 
 scripts/mod/modpost.c                   |  838 +++++++++++++++++++++-------
 scripts/mod/modpost.h                   |   27 
 scripts/mod/sumversion.c                |   34 -
 scripts/namespace.pl                    |    5 
 scripts/package/Makefile                |   30 -
 scripts/reference_discarded.pl          |  112 ---
 scripts/reference_init.pl               |  109 ---
 sound/oss/.gitignore                    |    5 
 52 files changed, 1624 insertions(+), 1432 deletions(-)

Shortlog:
Aaron Brooks:
      kbuild: make namespace.pl CROSS_COMPILE happy

Adrian Bunk:
      kbuild: remove a tab from an empty line
      Kconfig: remove the CONFIG_CC_ALIGN_* options

Andrew Morton:
      kbuild: fix modpost compile with older gcc

Brian Gerst:
      kbuild: remove checkconfig.pl

Chuck Ebbert:
      kbuild: add -fverbose-asm to i386 Makefile

Jan Beulich:
      kbuild: consolidate command line escaping
      kbuild: fix mkmakefile
      kbuild: version.h should depend on .kernelrelease
      kconfig: fix time ordering of writes to .kconfig.d and include/linux/autoconf.h

Jesper Juhl:
      kbuild: small update of allnoconfig description

Luke Yang:
      kbuild: Fix bug in crc symbol generating of kernel and modules

Martin Michlmayr:
      kbuild: Accept various mips sub-types in SUBARCH

Mattia Dongili:
      kbuild: fix a cscope bug (make cscope segfaults)

Paul Smith:
      kbuild: change kbuild to not rely on incorrect GNU make behavior

Sam Ravnborg:
      kbuild: support building individual files for external modules
      kbuild: use warn()/fatal() consistent in modpost
      kbuild: apply CodingStyle to modpost.c
      kbuild: improved modversioning support for external modules
      kbuild: warn about duplicate exported symbols
      kbuild: avoid stale modules in $(MODVERDIR) for external modules
      kbuild: run depmod when installing external modules
      kbuild: check for section mismatch during modpost stage
      kbuild: make cc-version available in kbuild files
      kbuild: fix comment in Kbuild.include
      kbuild: do not segfault in modpost if MODVERDIR is not defined
      kbuild: fix segfault in modpost
      kbuild: include symbol names in section mismatch warnings
      kbuild: do not warn when unwind sections references .init/.exit sections
      kbuild: Add copyright to modpost.c
      kbuild: ignore all generated files for make allmodconfig (x86_64)
      kbuild: whitelist false section mismatch warnings
      kbuild: kill trailing whitespace in modpost & friends
      kbuild: kill false positives from section mismatch warnings for powerpc
      kbuild: fix section mismatch check for unwind on IA64
      kbuild: in the section mismatch check try harder to find symbols
      kbuild: fix make dir/file.xx when asm symlink is missing
      kbuild: when warning symbols exported twice now tell user this is the problem
      kbuild: replace PHONY with FORCE
      kbuild: in makefile.txt note that Makefile is preferred name for kbuild files
      kbuild: fix genksyms build error
      kbuild: Lindent genksyms.c
      kbuild: clean-up genksyms
      kbuild: fix make help & make *pkg
      kbuild: remove obsoleted scripts/reference_* files

Zach Brown:
      x86: align per-cpu section to configured cache bytes


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

end of thread, other threads:[~2008-01-28 22:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-28 21:26 [GIT PATCH] kbuild updates Sam Ravnborg
2008-01-28 22:04 ` Linus Torvalds
2008-01-28 22:24   ` Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2006-07-01 10:58 Sam Ravnborg
2006-03-21 16:17 Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome