This patch adds a new (Kbuild) Makefile variable EXTRA_SYMBOLS. The space separated list of files assigned to EXTRA_SYMBOLS is used when calling scripts/mod/modpost during stage 2 of the Kbuild process for non-kernel-tree modules. When the previous patch 001/002 is applied to modpost.c, modpost loads these files during initialisation of its symbol table. Signed-off-by: Richard Hacker <lerichi@gmx.net> --- The previous patch in this series (001/002) added a new command line argument -E to scripts/mod/modpost.c, instructing modpost to process the symbols in that file during initialisation of its symbol tables. This patch introduces a new make variable EXTRA_SYMBOLS. The space separated list of files assigned to this variable is passed to modpost using the the new -E command line argument. This introduces the possibility to supply a set of Modules.symvers for modpost to load during initialisation of it symbol tables. I hope this patch is useful and finds its way into the kernel. o Changes from the previous attempt: - Documentation update diff -uprN -X linux-2.6.24/Documentation/dontdiff linux-2.6.24-vanilla/Documentation/kbuild/modules.txt linux-2.6.24/Documentation/kbuild/modules.txt --- linux-2.6.24-vanilla/Documentation/kbuild/modules.txt 2008-01-18 22:43:41.000000000 +0100 +++ linux-2.6.24/Documentation/kbuild/modules.txt 2008-02-28 09:30:55.000000000 +0100 @@ -486,7 +486,7 @@ Module.symvers contains a list of all ex Sometimes, an external module uses exported symbols from another external module. Kbuild needs to have full knowledge on all symbols to avoid spitting out warnings about undefined symbols. - Two solutions exist to let kbuild know all symbols of more than + Three solutions exist to let kbuild know all symbols of more than one external module. The method with a top-level kbuild file is recommended but may be impractical in certain situations. @@ -523,6 +523,12 @@ Module.symvers contains a list of all ex containing the sum of all symbols defined and not part of the kernel. + Use make variable EXTRA_SYMBOLS in the Makefile + If it is impractical to copy Module.symvers from another + module, you can assign a space separated list of files to + EXTRA_SYMBOLS in your Makfile. These files will be loaded + by modpost during the initialisation of its symbol tables. + === 8. Tips & Tricks --- 8.1 Testing for CONFIG_FOO_BAR diff -uprN -X linux-2.6.24/Documentation/dontdiff linux-2.6.24-vanilla/scripts/Makefile.modpost linux-2.6.24/scripts/Makefile.modpost --- linux-2.6.24-vanilla/scripts/Makefile.modpost 2008-01-18 22:47:09.000000000 +0100 +++ linux-2.6.24/scripts/Makefile.modpost 2008-02-27 21:14:36.000000000 +0100 @@ -41,6 +41,12 @@ _modpost: __modpost include include/config/auto.conf include scripts/Kbuild.include + +ifneq ($(KBUILD_EXTMOD),) +# Include the module's Makefile to find EXTRA_SYMBOLS +include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile) +endif + include scripts/Makefile.lib kernelsymfile := $(objtree)/Module.symvers @@ -61,6 +67,7 @@ modpost = scripts/mod/modpost $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ + $(if $(EXTRA_SYMBOLS), $(patsubst %, -E %,$(EXTRA_SYMBOLS))) \ $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) --
| David Newall | Re: Slow DOWN, please!!! |
| Linus Torvalds | Re: O_DIRECT question |
| Ingo Molnar | Re: 2.6.24-rc4-git5: Reported regressions from 2.6.23 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Junio C Hamano | Re: [RFC] Git User's Survey 2008 |
| Junichi Uekawa | Re: [ANNOUNCE] GIT 1.5.4 |
| Marcus Griep | [PATCH] git-svn: Make it scream by minimizing temp files |
| Bill Lear | Meaning of "fatal: protocol error: bad line length character"? |
| Richard Stallman | Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| farhan ahmed | Re: bash for root? (was: Re: libiconv problem ) |
| Tony Sarendal | bgpd causing black-holes with bgp-only setup |
| Krishna Kumar | [PATCH 9/10 REV5] [IPoIB] Implement batching |
| jamal | Re: [PATCH 2/3][NET_BATCH] net core use batching |
| Andi Kleen | [PATCH] Disable TSO for non standard qdiscs |
| James Chapman | Re: [PATCH][PPPOL2TP]: Fix SMP oops in pppol2tp driver |
