kbuild: fix genksyms build error
Subsystems (9)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 22/46 kbuild: do not warn when unwind sections references .init/.exit sections
Andrew Morton reported a number of false positives for ia64 - like these:
WARNING: drivers/acpi/button.o - Section mismatch: reference to .init.text: from .IA_64.unwind.init.text after '' (at offset 0x0)
WARNING: drivers/acpi/button.o - Section mismatch: reference to .exit.text: from .IA_64.unwind.exit.text after '' (at offset 0x0)
WARNING: drivers/acpi/processor.o - Section mismatch: reference to .init.text: from .IA_64.unwind after '' (at offset 0x1e8)
They are all false positives - or at least the .c code looks OK. It is not known why sometimes a section name is appended and sometimes not.
Fix is to accept references from all sections that includes "unwind." in the name.
---
scripts/mod/modpost.c | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-)
6e10133fa4b2366e8ef18bc2ce34afe727b1c4ba
scripts/mod/modpost.c +17 -1
@@ -671,13 +671,21 @@ static int init_section_ref_ok(const cha".debug" , NULL }; - +/* part of section name */ +const char *namelist3 [] = { +".unwind" ,/* sample: IA_64.unwind.init.text */ +NULL + }; +for (s = namelist1; *s; s++)if (strcmp (*s, name) ==0 )return 1 ;for (s = namelist2; *s; s++)if (strncmp (*s, name,strlen (*s)) ==0 )return 1 ; +for (s = namelist3; *s; s++) +if (strstr (*s, name) !=NULL ) +return 1 ;return 0 ; }
@@ -727,6 +735,11 @@ static int exit_section_ref_ok(const cha".debug" , NULL }; +/* part of section name */ +const char *namelist3 [] = { +".unwind" ,/* Sample: IA_64.unwind.exit.text */ +NULL + };for (s = namelist1; *s; s++)if (strcmp (*s, name) ==0 )
@@ -734,6 +747,9 @@ static int exit_section_ref_ok(const chafor (s = namelist2; *s; s++)if (strncmp (*s, name,strlen (*s)) ==0 )return 1 ; +for (s = namelist3; *s; s++) +if (strstr (*s, name) !=NULL ) +return 1 ;return 0 ; }
Signature · 1 line
1.0.GIT
PATCH 23/46 kbuild: version.h should depend on .kernelrelease
Rebuilding a previously built tree while using make's -j options from time to time results in the version.h check running at the same time as the updating of .kernelrelease, resulting in UTS_RELEASE remaining an empty string (and as a side effect causing the entire kernel to be rebuilt).
---
Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
c3f9da90b6e63c968070aa72057fe15356b3f7b5
Makefile +1 -1
@@ -852,7 +852,7 @@ define filechk_version.h ) endef -include/linux/version.h: $(srctree)/Makefile .config FORCE +include/linux/version.h: $(srctree)/Makefile .config .kernelrelease FORCE $(call filechk,version.h) # ---------------------------------------------------------------------------
Signature · 1 line
1.0.GIT
PATCH 24/46 kbuild: Add copyright to modpost.c
It seems popular to protect your work with copyright, so I decided to do so for modpost which I patch a great deal atm.
---
scripts/mod/modpost.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
382168f4791822de7d44d9c634fbfdf8bc08c91b
scripts/mod/modpost.c +1 -1
@@ -2,7 +2,7 @@* * Copyright 2003 Kai Germaschewski * Copyright 2002-2004 Rusty Russell, IBM Corporation -* +* Copyright 2006 Sam Ravnborg * Based in part on module-init-tools/depmod.c,file2alias * * This software may be used and distributed according to the terms
Signature · 1 line
1.0.GIT
PATCH 25/46 kbuild: ignore all generated files for make allmodconfig (x86_64)
With following patch we now ignore all generated files for make allmodconfig for x86_64.
---
drivers/atm/.gitignore | 5 +++++ sound/oss/.gitignore | 4 ++++ 2 files changed, 9 insertions(+), 0 deletions(-) create mode 100644 drivers/atm/.gitignore create mode 100644 sound/oss/.gitignore
cc006288fb538005a14ca4297250abbf0beeb0b9
drivers/atm/.gitignore new file +5 -0
@@ -0,0 +1,5 @@ +# Ignore generated files +fore200e_mkfirm +fore200e_pca_fw.c +pca200e.bin +
sound/oss/.gitignore new file +4 -0
@@ -0,0 +1,4 @@ +#Ignore generated files +maui_boot.h +pss_boot.h +trix_boot.h
Signature · 1 line
1.0.GIT
PATCH 26/46 kbuild: whitelist false section mismatch warnings
In several cases the section mismatch check triggered false warnings. Following patch introduce a whitelist to 'false positives' are not warned of. Two types of patterns are recognised:
1) Typical case when a module parameter is _initdata
2) When a function pointer is assigned to a driver structure
In both patterns we rely on the actual name of the variable assigned
---
scripts/mod/modpost.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 89 insertions(+), 0 deletions(-)
4c8fbca5836aaafd165aa8732d92ab5d4f3a6841
scripts/mod/modpost.c +89 -0
@@ -452,6 +452,89 @@ static char *get_modinfo(void *modinfo, }/** +* Test if string s ends in string sub +* return 0 if match +**/ +static int strrcmp (const char *s,const char *sub) +{ +int slen, sublen; + +if (!s || !sub) +return 1 ; + + slen =strlen (s); + sublen =strlen (sub); + +if ((slen ==0 ) || (sublen ==0 )) +return 1 ; + +if (sublen > slen) +return 1 ; + +return memcmp (s + slen - sublen, sub, sublen); +} + +/** +* Whitelist to allow certain references to pass with no warning. +* Pattern 1: +* If a module parameter is declared __initdata and permissions=0 +* then this is legal despite the warning generated. +* We cannot see value of permissions here, so just ignore +* this pattern. +* The pattern is identified by: +* tosec = .init.data +* fromsec = .data +* atsym =__param* +* +* Pattern 2: +* Many drivers utilise a *_driver container with references to +* add, remove, probe functions etc. +* These functions may often be marked __init and we do not want to +* warn here. +* the pattern is identified by: +* tosec = .init.text | .exit.text +* fromsec = .data +* atsym = *_driver, *_ops, *_probe, *probe_one +**/ +static int secref_whitelist (const char *tosec,const char *fromsec, +const char *atsym) +{ +int f1 =1 , f2 =1 ; +const char **s; +const char *pat2sym[] = { +"_driver" , +"_ops" , +"_probe" , +"_probe_one" , +NULL + }; + +/* Check for pattern 1 */ +if (strcmp (tosec,".init.data" ) !=0 ) + f1 =0 ; +if (strcmp (fromsec,".data" ) !=0 ) + f1 =0 ; +if (strncmp (atsym,"__param" ,strlen ("__param" )) !=0 ) + f1 =0 ; + +if (f1) +return f1; + +/* Check for pattern 2 */ +if ((strcmp (tosec,".init.text" ) !=0 ) && + (strcmp (tosec,".exit.text" ) !=0 )) + f2 =0 ; +if (strcmp (fromsec,".data" ) !=0 ) + f2 =0 ; + +for (s = pat2sym; *s; s++) +if (strrcmp (atsym, *s) ==0 ) + f1 =1 ; + +return f1 && f2; +} + +/** * Find symbol based on relocation record info. * In some cases the symbol supplied is a valid symbol so * return refsym. If st_name != 0 we assume this is a valid symbol.
@@ -518,6 +601,7 @@ static void find_symbols_between(struct/** * Print a warning about a section mismatch. * Try to find symbols near it so user can find it. +* Check whitelist before warning - it may be a false positive. **/ static void warn_sec_mismatch (const char *modname,const char *fromsec,struct elf_info *elf,Elf_Sym *sym,Elf_Rela r)
@@ -536,6 +620,11 @@ static void warn_sec_mismatch(const char refsym =find_elf_symbol (elf, r.r_addend, sym);if (refsym &&strlen (elf->strtab + refsym->st_name)) refsymname = elf->strtab + refsym->st_name; + +/* check whitelist - we may ignore it */ +if (before && +secref_whitelist (secname, fromsec, elf->strtab + before->st_name)) +return ;if (before && after) { warn("%s - Section mismatch: reference to %s:%s from %s "
Signature · 1 line
1.0.GIT
PATCH 27/46 kbuild: make namespace.pl CROSS_COMPILE happy
Using the fixed path to /usr/bin/{nm,objdump} does not allow CROSS_COMPILE environments to use namespace.pl. This patch causes namespace.pl to use $NM and $OBJDUMP if defined or fall back to the nm and objdump found in the path.
---
scripts/namespace.pl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
3a25f0b19f2eefd158955ab809c8947ed8feadf1
scripts/namespace.pl +2 -2
@@ -66,8 +66,8 @@ require 5; # at least perl 5 use strict; use File::Find; -my $nm = "/usr/bin/nm -p"; -my $objdump = "/usr/bin/objdump -s -j .comment"; +my $nm = ($ENV{'NM'} || "nm") . " -p"; +my $objdump = ($ENV{'OBJDUMP'} || "objdump") . " -s -j .comment"; my $srctree = ""; my $objtree = ""; $srctree = "$ENV{'srctree'}/" if (exists($ENV{'srctree'}));
Signature · 1 line
1.0.GIT
PATCH 28/46 kbuild: small update of allnoconfig description
'allnoconfig' is described by 'make help' as a "minimal config", that's not strictly correct. To be pedantic, a minimal config would be one where EMBEDDED was set to Y and most things therein disabled etc. Simply answering 'no' to all options does not give a minimal config.
A better description of allnoconfig is that it answers all options with 'no'.
This patch updates the description.
---
scripts/kconfig/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
e11f04962cee8f7fb0dc14983a7a461ade8f71c3
scripts/kconfig/Makefile +1 -1
@@ -78,7 +78,7 @@ help: @echo ' defconfig - New config with default answer to all options' @echo ' allmodconfig - New config selecting modules when possible' @echo ' allyesconfig - New config where all options are accepted with yes' - @echo ' allnoconfig - New minimal config' + @echo ' allnoconfig - New config where all options are answered with no' # =========================================================================== # Shared Makefile for the various kconfig executables:
Signature · 1 line
1.0.GIT
PATCH 29/46 kbuild: kill trailing whitespace in modpost & friends
---
scripts/mod/file2alias.c | 4 +-- scripts/mod/mk_elfconfig.c | 4 +-- scripts/mod/modpost.c | 70 ++++++++++++++++++++++---------------------- scripts/mod/modpost.h | 8 +++-- 4 files changed, 43 insertions(+), 43 deletions(-)
62070fa42c4ac23d1d71146a4c14702302b80245
scripts/mod/file2alias.c +2 -2
@@ -34,7 +34,7 @@ typedef uint16_t __u16;typedef unsigned char __u8 ;/* Big exception to the "don't include kernel headers into userspace, which -* even potentially has different endianness and word sizes, since +* even potentially has different endianness and word sizes, since * we handle those differences explicitly below */ #include "../../include/linux/mod_devicetable.h" #include "../../include/linux/input.h"
@@ -228,7 +228,7 @@ static int do_pci_entry(const char *filereturn 1 ; } -/* looks like: "ccw:tNmNdtNdmN" */ +/* looks like: "ccw:tNmNdtNdmN" */ static int do_ccw_entry (const char *filename,struct ccw_device_id *id,char *alias) {
scripts/mod/mk_elfconfig.c +2 -2
@@ -6,7 +6,7 @@int main (int argc,char **argv) { -unsigned char ei[EI_NIDENT ]; +unsigned char ei[EI_NIDENT ];union {short s;char c[2 ]; } endian_test;if (argc !=2 ) {
@@ -57,7 +57,7 @@ main(int argc, char **argv)if ((strcmp (argv[1 ],"v850" ) ==0 ) || (strcmp (argv[1 ],"h8300" ) ==0 ))printf ("#define MODULE_SYMBOL_PREFIX \"_\"\n" ); -else +else printf ("#define MODULE_SYMBOL_PREFIX \"\"\n" );return 0 ;
scripts/mod/modpost.c +35 -35
214 lines not on this page · raw message
scripts/mod/modpost.h +4 -4
@@ -13,8 +13,8 @@#if KERNEL_ELFCLASS ==ELFCLASS32 -#define Elf_Ehdr Elf32_Ehdr -#define Elf_Shdr Elf32_Shdr +#define Elf_Ehdr Elf32_Ehdr +#define Elf_Shdr Elf32_Shdr#define Elf_Sym Elf32_Sym#define Elf_Addr Elf32_Addr#define Elf_Section Elf32_Section
@@ -26,8 +26,8 @@#define ELF_R_TYPE ELF32_R_TYPE#else -#define Elf_Ehdr Elf64_Ehdr -#define Elf_Shdr Elf64_Shdr +#define Elf_Ehdr Elf64_Ehdr +#define Elf_Shdr Elf64_Shdr#define Elf_Sym Elf64_Sym#define Elf_Addr Elf64_Addr#define Elf_Section Elf64_Section
Signature · 1 line
1.0.GIT
PATCH 30/46 kbuild: kill false positives from section mismatch warnings for powerpc
Building an allmodconfig kernel for ppc64 revealed a number of false positives - originally reported by Andrew Morton.
This patch removes most if not all false positives for ppc64:
Section .opd
The .opd section contains function descriptors at least for ppc64. So ignore it for .init.text (was ignored for .exit.text). See description of function descriptors here:
http://www.linuxbase.org/spec/ELF/ppc64/PPC-elf64abi-1.7.html
Section .toc1
ppc64 places some static variables in .toc1 - ignore the.
Section __bug_tabeBUG() and friends uses __bug_table. Ignore warnings from that section.
Module parameters are placed in .data.rel for ppc64, for adjust pattern to match on section named .data*
Tested with gcc: 3.4.0 and binutils 2.15.90.0.3
---
scripts/mod/modpost.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
9209aed0726c77ad13b8d83e73a3cf9f59a8c2b2
scripts/mod/modpost.c +7 -2
@@ -483,7 +483,7 @@ static int strrcmp(const char *s, const* this pattern. * The pattern is identified by: * tosec = .init.data -* fromsec = .data +* fromsec = .data* * atsym =__param* * * Pattern 2:
@@ -512,7 +512,7 @@ static int secref_whitelist(const char */* Check for pattern 1 */ if (strcmp (tosec,".init.data" ) !=0 ) f1 =0 ; -if (strcmp (fromsec,".data" ) !=0 ) +if (strncmp (fromsec,".data" ,strlen (".data" )) !=0 ) f1 =0 ;if (strncmp (atsym,"__param" ,strlen ("__param" )) !=0 ) f1 =0 ;
@@ -743,9 +743,12 @@ static int init_section_ref_ok(const cha/* Absolute section names */ const char *namelist1[] = {".init" , +".opd" ,/* see comment [OPD] at exit_section_ref_ok() */ +".toc1" ,/* used by ppc64 */ ".stab" ,".rodata" ,".text.lock" , +"__bug_table" ,/* used by powerpc for BUG() */ ".pci_fixup_header" ,".pci_fixup_final" ,".pdr" ,
@@ -812,8 +815,10 @@ static int exit_section_ref_ok(const cha".exit.data" ,".init.text" ,".opd" ,/* See comment [OPD] */ +".toc1" ,/* used by ppc64 */ ".altinstructions" ,".pdr" , +"__bug_table" ,/* used by powerpc for BUG() */ ".exitcall.exit" ,".eh_frame" , ".stab",
Signature · 1 line
1.0.GIT
PATCH 31/46 kbuild: fix section mismatch check for unwind on IA64
Parameters to strstr() was reversed.
---
scripts/mod/modpost.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
e835a39c1c1f023ef443f735b0e98b08660ae0e4
scripts/mod/modpost.c +2 -2
@@ -776,7 +776,7 @@ static int init_section_ref_ok(const chaif (strncmp (*s, name,strlen (*s)) ==0 )return 1 ;for (s = namelist3; *s; s++) -if (strstr (*s, name) !=NULL ) +if (strstr (name, *s) !=NULL )return 1 ;return 0 ; }
@@ -842,7 +842,7 @@ static int exit_section_ref_ok(const chaif (strncmp (*s, name,strlen (*s)) ==0 )return 1 ;for (s = namelist3; *s; s++) -if (strstr (*s, name) !=NULL ) +if (strstr (name, *s) !=NULL )return 1 ;return 0 ; }
Signature · 1 line
1.0.GIT
PATCH 32/46 kbuild: in the section mismatch check try harder to find symbols
When searching for symbols the only check performed was if offset equals st_value. Adding an additional check to see if st_name points t a valid name made us sort out a few more false positives and let us report more correct names in warnings.
---
scripts/mod/modpost.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-)
43c74d179596ba1f8eceb8c6a5c7e11afe233662
scripts/mod/modpost.c +16 -1
@@ -558,7 +558,10 @@ static Elf_Sym *find_elf_symbol(struct e }/* -* Find symbols before or equal addr and after addr - in the section sec +* Find symbols before or equal addr and after addr - in the section sec. +* If we find two symbols with equal offset prefer one with a valid name. +* The ELF format may have a better way to detect what type of symbol +* it is, but this works for now. **/ static void find_symbols_between(struct elf_info *elf, Elf_Addr addr, const char *sec,
@@ -587,6 +590,12 @@ static void find_symbols_between(struct beforediff = addr - sym->st_value; *before = sym; } +else if ((addr - sym->st_value) == beforediff) { +/* equal offset, valid name? */ +const char *name = elf->strtab + sym->st_name; +if (name &&strlen (name)) + *before = sym; + } }else {
@@ -594,6 +603,12 @@ static void find_symbols_between(struct afterdiff = sym->st_value - addr; *after = sym; } +else if ((sym->st_value - addr) == afterdiff) { +/* equal offset, valid name? */ +const char *name = elf->strtab + sym->st_name; +if (name &&strlen (name)) + *after = sym; + } } } }
Signature · 1 line
1.0.GIT
PATCH 33/46 kbuild: fix make dir/file.xx when asm symlink is missing
Added a dependency so we do full preparation before trying to build single file targets. This fixes a case where Andrew Morton did:
make kernel/sched.o
rm include/asm
make kernel/sched.o -> splat---
Makefile | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
f6ecebd6592ea70e9450ec70efb24220dd961ebc
Makefile +6 -6
@@ -1289,17 +1289,17 @@ kernelversion: # --------------------------------------------------------------------------- # The directory part is taken from first prerequisite, so this # works even with external modules -%.s: %.c scripts FORCE +%.s: %.c prepare scripts FORCE $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) -%.i: %.c scripts FORCE +%.i: %.c prepare scripts FORCE $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) -%.o: %.c scripts FORCE +%.o: %.c prepare scripts FORCE $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) -%.lst: %.c scripts FORCE +%.lst: %.c prepare scripts FORCE $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) -%.s: %.S scripts FORCE +%.s: %.S prepare scripts FORCE $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) -%.o: %.S scripts FORCE +%.o: %.S prepare scripts FORCE $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) # For external modules we shall include any directory of the target,
Signature · 1 line
1.0.GIT
PATCH 34/46 kbuild: when warning symbols exported twice now tell user this is the problem
Warning now looks like this:
WARNING: vmlinux: 'strcpy' exported twice. Previous export was in vmlinux
Which gives much better hint how to fix it.
---
scripts/mod/modpost.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
7b75b13cda8bd21e8636ea985f76e1ce5bd1a470
scripts/mod/modpost.c +1 -1
@@ -191,7 +191,7 @@ static struct symbol *sym_add_exported(c s =new_symbol (name, mod); }else {if (!s->preloaded) { -warn ("%s: duplicate symbol '%s' previous definition " +warn ("%s: '%s' exported twice. Previous export " "was in %s%s\n" , mod->name, name, s->module->name,is_vmlinux (s->module->name) ?"" :".ko" );
Signature · 1 line
1.0.GIT
PATCH 35/46 kbuild: change kbuild to not rely on incorrect GNU make behavior
The kbuild system takes advantage of an incorrect behavior in GNU make. Once this behavior is fixed, all files in the kernel rebuild every time, even if nothing has changed. This patch ensures kbuild works with both the incorrect and correct behaviors of GNU make.
For more details on the incorrect behavior, see:
http://lists.gnu.org/archive/html/bug-make/2006-03/msg00003.html
Changes in this patch:
- Keep all targets that are to be marked .PHONY in a variable, PHONY.
- Add .PHONY: $(PHONY) to mark them properly.
- Remove any $(PHONY) files from the $? list when determining whether targets are up-to-date or not.
---
Documentation/DocBook/Makefile | 8 ++++ Makefile | 64 +++++++++++++++++++---------------- 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/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 +- scripts/Kbuild.include | 13 ++++--- scripts/Makefile.build | 12 +++++-- scripts/Makefile.clean | 10 ++++- scripts/Makefile.modinst | 10 ++++- scripts/Makefile.modpost | 12 +++++-- scripts/kconfig/Makefile | 4 +- scripts/kconfig/lxdialog/Makefile | 6 ++- scripts/package/Makefile | 10 +++-- 25 files changed, 144 insertions(+), 75 deletions(-)
4f1933620f57145212cdbb1ac6ce099eeeb21c5a
Documentation/DocBook/Makefile +7 -1
@@ -28,7 +28,7 @@ PS_METHOD = $(prefer-db2x) ### # The targets that may be used. -.PHONY: xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs +PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) xmldocs: $(BOOKS)
@@ -211,3 +211,9 @@ clean-dirs := $(patsubst %.xml,%,$(DOCBO #man put files in man subdir - traverse down subdir- := man/ + + +# Declare the contents of the .PHONY variable as phony. We keep that +# information in a variable se we can use it in if_changed and friends. + +.PHONY: $(PHONY)
Makefile +35 -29
218 lines not on this page · raw message
arch/arm/Makefile +4 -1
@@ -1,6 +1,9 @@ # # arch/arm/Makefile # +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. +# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details.
@@ -176,7 +179,7 @@ endif archprepare: maketools -.PHONY: maketools FORCE +PHONY += maketools FORCE maketools: include/linux/version.h include/asm-arm/.arch FORCE $(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
arch/arm/boot/Makefile +4 -1
@@ -1,6 +1,9 @@ # # arch/arm/boot/Makefile # +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. +# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details.
@@ -73,7 +76,7 @@ $(obj)/bootpImage: $(obj)/bootp/bootp FO $(call if_changed,objcopy) @echo ' Kernel: $@ is ready' -.PHONY: initrd FORCE +PHONY += initrd FORCE initrd: @test "$(INITRD_PHYS)" != "" || \ (echo This machine does not support INITRD; exit -1)
arch/arm/boot/bootp/Makefile +4 -1
@@ -1,6 +1,9 @@ # # linux/arch/arm/boot/bootp/Makefile # +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. +# LDFLAGS_bootp :=-p --no-undefined -X \ --defsym initrd_phys=$(INITRD_PHYS) \
@@ -21,4 +24,4 @@ $(obj)/kernel.o: arch/arm/boot/zImage FO $(obj)/initrd.o: $(INITRD) FORCE -.PHONY: $(INITRD) FORCE +PHONY += $(INITRD) FORCE
arch/arm26/Makefile +5 -2
@@ -1,6 +1,9 @@ # # arch/arm26/Makefile # +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. +# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details.
@@ -49,9 +52,9 @@ all: zImage boot := arch/arm26/boot -.PHONY: maketools FORCE +PHONY += maketools FORCE maketools: FORCE - + # Convert bzImage to zImage bzImage: vmlinux
arch/arm26/boot/Makefile +4 -1
@@ -1,6 +1,9 @@ # # arch/arm26/boot/Makefile # +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. +# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details.
@@ -60,7 +63,7 @@ $(obj)/xipImage: vmlinux FORCE @echo ' Kernel: $@ is ready' endif -.PHONY: initrd +PHONY += initrd initrd: @test "$(INITRD_PHYS)" != "" || \ (echo This machine does not support INITRD; exit -1)
arch/i386/Makefile +2 -2
@@ -99,8 +99,8 @@ AFLAGS += $(mflags-y) boot := arch/i386/boot -.PHONY: zImage bzImage compressed zlilo bzlilo \ - zdisk bzdisk fdimage fdimage144 fdimage288 install +PHONY += zImage bzImage compressed zlilo bzlilo \ + zdisk bzdisk fdimage fdimage144 fdimage288 install all: bzImage
arch/ia64/Makefile +4 -1
@@ -1,6 +1,9 @@ # # ia64/Makefile # +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. +# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details.
@@ -62,7 +65,7 @@ drivers-$(CONFIG_OPROFILE) += arch/ia64/ boot := arch/ia64/hp/sim/boot -.PHONY: boot compressed check +PHONY += boot compressed check all: compressed unwcheck
arch/m32r/Makefile +4 -1
@@ -1,6 +1,9 @@ # # m32r/Makefile # +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. +# LDFLAGS := OBJCOPYFLAGS := -O binary -R .note -R .comment -S
@@ -39,7 +42,7 @@ drivers-$(CONFIG_OPROFILE) += arch/m32r/ boot := arch/m32r/boot -.PHONY: zImage +PHONY += zImage all: zImage
arch/powerpc/Makefile +1 -1
@@ -150,7 +150,7 @@ CPPFLAGS_vmlinux.lds := -Upowerpc BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage -.PHONY: $(BOOT_TARGETS) +PHONY += $(BOOT_TARGETS) boot := arch/$(ARCH)/boot
arch/ppc/Makefile +1 -1
@@ -82,7 +82,7 @@ drivers-$(CONFIG_OPROFILE) += arch/power BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm -.PHONY: $(BOOT_TARGETS) +PHONY += $(BOOT_TARGETS) all: uImage zImage
arch/ppc/boot/Makefile +4 -1
@@ -1,6 +1,9 @@ # # arch/ppc/boot/Makefile # +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. +# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details.
@@ -25,7 +28,7 @@ subdir- += simple openfirmware hostprogs-y := $(addprefix utils/, addnote mknote hack-coff mkprep mkbugboot mktree) -.PHONY: $(BOOT_TARGETS) $(bootdir-y) +PHONY += $(BOOT_TARGETS) $(bootdir-y) $(BOOT_TARGETS): $(bootdir-y)
arch/ppc/boot/openfirmware/Makefile +5 -2
@@ -1,5 +1,8 @@ # Makefile for making bootable images on various OpenFirmware machines. # +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. +# # Paul Mackerras January 1997 # XCOFF bootable images for PowerMacs # Geert Uytterhoeven September 1997
@@ -86,7 +89,7 @@ $(images)/zImage.chrp-rs6k $(images)/zIm # The targets used on the make command-line -.PHONY: zImage zImage.initrd +PHONY += zImage zImage.initrd zImage: $(images)/zImage.chrp \ $(images)/zImage.chrp-rs6k @echo ' kernel: $@ is ready ($<)'
@@ -96,7 +99,7 @@ zImage.initrd: $(images)/zImage.initrd. TFTPIMAGE := /tftpboot/zImage -.PHONY: znetboot znetboot.initrd +PHONY += znetboot znetboot.initrd znetboot: $(images)/zImage.chrp cp $(images)/zImage.chrp $(TFTPIMAGE).chrp$(END) @echo ' kernel: $@ is ready ($<)'
arch/sh/Makefile +1 -1
@@ -172,7 +172,7 @@ include/asm-sh/.mach: $(wildcard include archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach -.PHONY: maketools FORCE +PHONY += maketools FORCE maketools: include/linux/version.h FORCE $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
arch/um/Makefile +5 -2
@@ -1,4 +1,7 @@ -# +# +# This file is included by the global makefile so that you can add your own +# architecture-specific flags and dependencies. +# # Copyright (C) 2002 Jeff Dike ([email protected]) # Licensed under the GPL #
@@ -88,7 +91,7 @@ CONFIG_KERNEL_HALF_GIGS ?= 0 SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) -.PHONY: linux +PHONY += linux all: linux
arch/x86_64/Makefile +2 -2
@@ -67,8 +67,8 @@ drivers-$(CONFIG_OPROFILE) += arch/x86_ boot := arch/x86_64/boot -.PHONY: bzImage bzlilo install archmrproper \ - fdimage fdimage144 fdimage288 archclean +PHONY += bzImage bzlilo install archmrproper \ + fdimage fdimage144 fdimage288 archclean #Default target when executing "make" all: bzImage
scripts/Kbuild.include +8 -5
@@ -116,16 +116,18 @@ make-cmd = $(subst \#,\\\#,$(subst $$,$$ # 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 -# -if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ +# +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) # execute the command and also postprocess generated .d dependencies # file -if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ - $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ +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; \
@@ -135,6 +137,7 @@ if_changed_dep = $(if $(strip $? $(filte # 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 $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ +if_changed_rule = $(if $(strip $(filter-out $(PHONY),$?) \ + $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ @set -e; \ $(rule_$(1)))
scripts/Makefile.build +9 -3
@@ -4,7 +4,7 @@ src := $(obj) -.PHONY: __build +PHONY := __build __build: # Read .config if it exist, otherwise ignore
@@ -308,14 +308,14 @@ targets += $(multi-used-y) $(multi-used- # Descending # --------------------------------------------------------------------------- -.PHONY: $(subdir-ym) +PHONY += $(subdir-ym) $(subdir-ym): $(Q)$(MAKE) $(build)=$@ # Add FORCE to the prequisites of a target to force it to be always rebuilt. # --------------------------------------------------------------------------- -.PHONY: FORCE +PHONY += FORCE FORCE:
@@ -330,3 +330,9 @@ cmd_files := $(wildcard $(foreach f,$(ta ifneq ($(cmd_files),) include $(cmd_files) endif + + +# Declare the contents of the .PHONY variable as phony. We keep that +# information in a variable se we can use it in if_changed and friends. + +.PHONY: $(PHONY)
scripts/Makefile.clean +8 -2
@@ -4,7 +4,7 @@ src := $(obj) -.PHONY: __clean +PHONY := __clean __clean: # Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
@@ -87,10 +87,16 @@ endif # Descending # --------------------------------------------------------------------------- -.PHONY: $(subdir-ymn) +PHONY += $(subdir-ymn) $(subdir-ymn): $(Q)$(MAKE) $(clean)=$@ # If quiet is set, only print short version of command cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) + + +# Declare the contents of the .PHONY variable as phony. We keep that +# information in a variable se we can use it in if_changed and friends. + +.PHONY: $(PHONY)
scripts/Makefile.modinst +8 -2
@@ -2,7 +2,7 @@ # Installing modules # ========================================================================== -.PHONY: __modinst +PHONY := __modinst __modinst: include scripts/Kbuild.include
@@ -12,7 +12,7 @@ include scripts/Kbuild.include __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) -.PHONY: $(modules) +PHONY += $(modules) __modinst: $(modules) @:
@@ -27,3 +27,9 @@ modinst_dir = $(if $(KBUILD_EXTMOD),$(ex $(modules): $(call cmd,modules_install,$(MODLIB)/$(modinst_dir)) + + +# Declare the contents of the .PHONY variable as phony. We keep that +# information in a variable se we can use it in if_changed and friends. + +.PHONY: $(PHONY)
scripts/Makefile.modpost +9 -3
@@ -32,7 +32,7 @@ # Step 4 is solely used to allow module versioning in external modules, # where the CRC of each module is retrieved from the Module.symers file. -.PHONY: _modpost +PHONY := _modpost _modpost: __modpost include .config
@@ -60,7 +60,7 @@ quiet_cmd_modpost = MODPOST $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ $(filter-out FORCE,$^) -.PHONY: __modpost +PHONY += __modpost __modpost: $(wildcard vmlinux) $(modules:.ko=.o) FORCE $(call cmd,modpost)
@@ -97,7 +97,7 @@ targets += $(modules) # Add FORCE to the prequisites of a target to force it to be always rebuilt. # --------------------------------------------------------------------------- -.PHONY: FORCE +PHONY += FORCE FORCE:
@@ -112,3 +112,9 @@ cmd_files := $(wildcard $(foreach f,$(ta ifneq ($(cmd_files),) include $(cmd_files) endif + + +# Declare the contents of the .PHONY variable as phony. We keep that +# information in a variable se we can use it in if_changed and friends. + +.PHONY: $(PHONY)
scripts/kconfig/Makefile +2 -2
@@ -2,7 +2,7 @@ # Kernel configuration targets # These targets are used from top-level makefile -.PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config +PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config xconfig: $(obj)/qconf $< arch/$(ARCH)/Kconfig
@@ -42,7 +42,7 @@ update-po-config: $(obj)/kxgettext $(Q)rm -f arch/um/Kconfig_arch $(Q)rm -f scripts/kconfig/linux_*.pot scripts/kconfig/config.pot -.PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig +PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig randconfig: $(obj)/conf $< -r arch/$(ARCH)/Kconfig
scripts/kconfig/lxdialog/Makefile +3 -3
@@ -7,10 +7,10 @@ check-lxdialog := $(srctree)/$(src)/che # 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)) - -HOST_EXTRACFLAGS += -DLOCALE -.PHONY: dochecklxdialog +HOST_EXTRACFLAGS += -DLOCALE + +PHONY += dochecklxdialog $(obj)/dochecklxdialog: $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES)
scripts/package/Makefile +5 -5
@@ -32,7 +32,7 @@ MKSPEC := $(srctree)/scripts/package PREV := set -e; cd ..; # rpm-pkg -.PHONY: rpm-pkg rpm +PHONY += rpm-pkg rpm $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile $(CONFIG_SHELL) $(MKSPEC) > $@
@@ -54,10 +54,10 @@ rpm-pkg rpm: $(objtree)/kernel.spec clean-files := $(objtree)/kernel.spec # binrpm-pkg -.PHONY: binrpm-pkg +PHONY += binrpm-pkg $(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile $(CONFIG_SHELL) $(MKSPEC) prebuilt > $@ - + binrpm-pkg: $(objtree)/binkernel.spec $(MAKE) KBUILD_SRC= set -e; \
@@ -72,7 +72,7 @@ clean-files += $(objtree)/binkernel.spec # Deb target # --------------------------------------------------------------------------- # -.PHONY: deb-pkg +PHONY += deb-pkg deb-pkg: $(MAKE) KBUILD_SRC= $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
@@ -82,7 +82,7 @@ clean-dirs += $(objtree)/debian/ # tarball targets # --------------------------------------------------------------------------- -.PHONY: tar%pkg +PHONY += tar%pkg tar%pkg: $(MAKE) KBUILD_SRC= $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
Signature · 1 line
1.0.GIT
PATCH 36/46 kbuild: Fix bug in crc symbol generating of kernel and modules
The scripts/genksyms/genksyms.c uses hardcoded "__crc_" prefix for crc symbols in kernel and modules. The prefix should be replaced by "MODULE_SYMBOL_PREFIX##__crc_" otherwise there will be warnings when MODULE_SYMBOL_PREFIX is not NULL.
I am sorry my last patch for this issue is actually wrong. I revert it in this patch.
---
scripts/genksyms/genksyms.c | 4 ++-- scripts/mod/modpost.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
f7b05e64bdb2fcc4b2dc94a4bd9426adc70c9599
scripts/genksyms/genksyms.c +2 -2
@@ -32,7 +32,7 @@#endif /* __GNU_LIBRARY__ */ #include "genksyms.h" - +#include "../mod/elfconfig.h" /*----------------------------------------------------------------------*/ #define HASH_BUCKETS 4096
@@ -458,7 +458,7 @@ export_symbol(const char *name)fputs (">\n" , debugfile);/* Used as a linker script. */ -printf ("__crc_%s = 0x%08lx ;\n" , name, crc); +printf ("%s__crc_%s = 0x%08lx ;\n" ,MODULE_SYMBOL_PREFIX , name, crc); } }
scripts/mod/modpost.c +2 -2
@@ -346,8 +346,8 @@ static void parse_elf_finish(struct elf_release_file (info->hdr, info->size); } -#define CRC_PFX "__crc_" -#define KSYMTAB_PFX "__ksymtab_" +#define CRC_PFX MODULE_SYMBOL_PREFIX "__crc_" +#define KSYMTAB_PFX MODULE_SYMBOL_PREFIX "__ksymtab_"static void handle_modversions (struct module *mod,struct elf_info *info,Elf_Sym *sym,const char *symname)
Signature · 1 line
1.0.GIT
PATCH 37/46 kbuild: replace PHONY with FORCE
.PHONY: does not take patterns so use FORCE to achive same effect. Thanks to "Paul D. Smith" <[email protected]> for noticing this.
---
Makefile | 2 -- scripts/package/Makefile | 18 +++++++----------- 2 files changed, 7 insertions(+), 13 deletions(-)
0131705d589e2341dbc5e8946a60f83d8c1773dc
Makefile +0 -2
@@ -1000,8 +1000,6 @@ distclean: mrproper # rpm target kept for backward compatibility package-dir := $(srctree)/scripts/package -PHONY += %-pkg rpm - %pkg: FORCE $(Q)$(MAKE) -f $(package-dir)/Makefile $@ rpm: FORCE
scripts/package/Makefile +7 -11
@@ -32,12 +32,11 @@ MKSPEC := $(srctree)/scripts/package PREV := set -e; cd ..; # rpm-pkg -PHONY += rpm-pkg rpm - +# --------------------------------------------------------------------------- $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile $(CONFIG_SHELL) $(MKSPEC) > $@ -rpm-pkg rpm: $(objtree)/kernel.spec +rpm-pkg rpm: $(objtree)/kernel.spec FORCE $(MAKE) clean $(PREV) ln -sf $(srctree) $(KERNELPATH) $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/.
@@ -54,11 +53,11 @@ rpm-pkg rpm: $(objtree)/kernel.spec clean-files := $(objtree)/kernel.spec # binrpm-pkg -PHONY += binrpm-pkg +# --------------------------------------------------------------------------- $(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile $(CONFIG_SHELL) $(MKSPEC) prebuilt > $@ -binrpm-pkg: $(objtree)/binkernel.spec +binrpm-pkg: $(objtree)/binkernel.spec FORCE $(MAKE) KBUILD_SRC= set -e; \ $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
@@ -71,9 +70,7 @@ clean-files += $(objtree)/binkernel.spec # Deb target # --------------------------------------------------------------------------- -# -PHONY += deb-pkg -deb-pkg: +deb-pkg: FORCE $(MAKE) KBUILD_SRC= $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
@@ -82,8 +79,7 @@ clean-dirs += $(objtree)/debian/ # tarball targets # --------------------------------------------------------------------------- -PHONY += tar%pkg -tar%pkg: +tar%pkg: FORCE $(MAKE) KBUILD_SRC= $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
@@ -92,7 +88,7 @@ clean-dirs += $(objtree)/tar-install/ # Help text displayed when executing 'make help' # --------------------------------------------------------------------------- -help: +help: FORCE @echo ' rpm-pkg - Build the kernel as an RPM package' @echo ' binrpm-pkg - Build an rpm package containing the compiled kernel' @echo ' and modules'
Signature · 1 line
1.0.GIT
PATCH 38/46 kbuild: in makefile.txt note that Makefile is preferred name for kbuild files
As noted by Roland Dreier <[email protected]> makefiles.txt told one to use the name 'Kbuild' as preferred name for kbuild files. This is not yet true so let makefiles.txt reflect reality.
---
Documentation/kbuild/makefiles.txt | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
172c3ae3e686f548a0eba950405e5cc321460005
Documentation/kbuild/makefiles.txt +3 -3
@@ -106,9 +106,9 @@ This document is aimed towards normal de Most Makefiles within the kernel are kbuild Makefiles that use the kbuild infrastructure. This chapter introduce the syntax used in the kbuild makefiles. -The preferred name for the kbuild files is 'Kbuild' but 'Makefile' will -continue to be supported. All new developmen is expected to use the -Kbuild filename. +The preferred name for the kbuild files are 'Makefile' but 'Kbuild' can +be used and if both a 'Makefile' and a 'Kbuild' file exists then the 'Kbuild' +file will be used. Section 3.1 "Goal definitions" is a quick intro, further chapters provide more details, with real examples.
Signature · 1 line
1.0.GIT
PATCH 39/46 kbuild: fix genksyms build error
genksyms needs to know when a symbol must have a "_" prefex as is true for a few architectures.
Pass $(ARCH) as commandline argument and hardcode what architectures that needs this info.
Previous attemt to take it from elfconfig.h was br0ken since elfconfig.h is a generated file.
---
scripts/Makefile.build | 2 +- scripts/genksyms/genksyms.c | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-)
c79c7b0923ff353d12194e83628bcca5a8606564
scripts/Makefile.build +1 -1
@@ -166,7 +166,7 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D cmd_modversions = \ if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ $(CPP) -D__GENKSYMS__ $(c_flags) $< \ - | $(GENKSYMS) \ + | $(GENKSYMS) -a $(ARCH) \ > $(@D)/.tmp_$(@F:.o=.ver); \ \ $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
scripts/genksyms/genksyms.c +12 -5
@@ -32,7 +32,6 @@#endif /* __GNU_LIBRARY__ */ #include "genksyms.h" -#include "../mod/elfconfig.h" /*----------------------------------------------------------------------*/ #define HASH_BUCKETS 4096
@@ -44,6 +43,8 @@ int cur_line = 1;char *cur_filename, *output_directory;int flag_debug, flag_dump_defs, flag_warnings; +const char *arch ="" ; +const char *mod_prefix ="" ;static int errors;static int nsyms;
@@ -458,7 +459,7 @@ export_symbol(const char *name)fputs (">\n" , debugfile);/* Used as a linker script. */ -printf ("%s__crc_%s = 0x%08lx ;\n" ,MODULE_SYMBOL_PREFIX , name, crc); +printf ("%s__crc_%s = 0x%08lx ;\n" , mod_prefix, name, crc); } }
@@ -529,6 +530,7 @@ main(int argc, char **argv)#ifdef __GNU_LIBRARY__struct option long_opts[] = { + {"arch" ,1 ,0 ,'a' }, {"debug" ,0 ,0 ,'d' }, {"warnings" ,0 ,0 ,'w' }, {"quiet", 0, 0, 'q'},
@@ -538,13 +540,16 @@ main(int argc, char **argv) {0, 0, 0, 0} }; -while ((o =getopt_long (argc, argv,"dwqVDk:p:" , +while ((o =getopt_long (argc, argv,"a:dwqVDk:p:" , &long_opts[0 ],NULL )) !=EOF ) #else /* __GNU_LIBRARY__ */ - while ((o = getopt(argc, argv, "dwqVDk:p:")) != EOF) + while ((o = getopt(argc, argv, "a:dwqVDk:p:")) != EOF)#endif /* __GNU_LIBRARY__ */ switch (o) { +case 'a' : + arch = optarg; +break ;case 'd' : flag_debug++;break ;
@@ -567,7 +572,9 @@ main(int argc, char **argv)genksyms_usage ();return 1 ; } - +if ((strcmp (arch,"v850" ) ==0 ) || + (strcmp (arch,"h8300" ) ==0 )) + mod_prefix ="_" ; {extern int yydebug;extern int yy_flex_debug;
Signature · 1 line
1.0.GIT
PATCH 40/46 kbuild: Lindent genksyms.c
No fix-ups applied yet. Just the raw Lindent output.
---
scripts/genksyms/genksyms.c | 832 +++++++++++++++++++++---------------------- 1 files changed, 398 insertions(+), 434 deletions(-)
78c041530ac2e65c9290137bfe3004340e0840d2
scripts/genksyms/genksyms.c +398 -434
@@ -29,7 +29,7 @@#include <stdarg.h> #ifdef __GNU_LIBRARY__#include <getopt.h> -#endif /* __GNU_LIBRARY__ */ +#endif /* __GNU_LIBRARY__ */ #include "genksyms.h" /*----------------------------------------------------------------------*/
@@ -51,460 +51,427 @@ static int nsyms;static struct symbol *expansion_trail; -static const char *const symbol_type_name[] = { -"normal" ,"typedef" ,"enum" ,"struct" ,"union" +static const char *const symbol_type_name[] = { +"normal" ,"typedef" ,"enum" ,"struct" ,"union" };/*----------------------------------------------------------------------*/ -static const unsigned int crctab32[] = -{ -0x00000000U ,0x77073096U ,0xee0e612cU ,0x990951baU ,0x076dc419U , -0x706af48fU ,0xe963a535U ,0x9e6495a3U ,0x0edb8832U ,0x79dcb8a4U , -0xe0d5e91eU ,0x97d2d988U ,0x09b64c2bU ,0x7eb17cbdU ,0xe7b82d07U , -0x90bf1d91U ,0x1db71064U ,0x6ab020f2U ,0xf3b97148U ,0x84be41deU , -0x1adad47dU ,0x6ddde4ebU ,0xf4d4b551U ,0x83d385c7U ,0x136c9856U , -0x646ba8c0U ,0xfd62f97aU ,0x8a65c9ecU ,0x14015c4fU ,0x63066cd9U , -0xfa0f3d63U ,0x8d080df5U ,0x3b6e20c8U ,0x4c69105eU ,0xd56041e4U , -0xa2677172U ,0x3c03e4d1U ,0x4b04d447U ,0xd20d85fdU ,0xa50ab56bU , -0x35b5a8faU ,0x42b2986cU ,0xdbbbc9d6U ,0xacbcf940U ,0x32d86ce3U , -0x45df5c75U ,0xdcd60dcfU ,0xabd13d59U ,0x26d930acU ,0x51de003aU , -0xc8d75180U ,0xbfd06116U ,0x21b4f4b5U ,0x56b3c423U ,0xcfba9599U , -0xb8bda50fU ,0x2802b89eU ,0x5f058808U ,0xc60cd9b2U ,0xb10be924U , -0x2f6f7c87U ,0x58684c11U ,0xc1611dabU ,0xb6662d3dU ,0x76dc4190U , -0x01db7106U ,0x98d220bcU ,0xefd5102aU ,0x71b18589U ,0x06b6b51fU , -0x9fbfe4a5U ,0xe8b8d433U ,0x7807c9a2U ,0x0f00f934U ,0x9609a88eU , -0xe10e9818U ,0x7f6a0dbbU ,0x086d3d2dU ,0x91646c97U ,0xe6635c01U , -0x6b6b51f4U ,0x1c6c6162U ,0x856530d8U ,0xf262004eU ,0x6c0695edU , -0x1b01a57bU ,0x8208f4c1U ,0xf50fc457U ,0x65b0d9c6U ,0x12b7e950U , -0x8bbeb8eaU ,0xfcb9887cU ,0x62dd1ddfU ,0x15da2d49U ,0x8cd37cf3U , -0xfbd44c65U ,0x4db26158U ,0x3ab551ceU ,0xa3bc0074U ,0xd4bb30e2U , -0x4adfa541U ,0x3dd895d7U ,0xa4d1c46dU ,0xd3d6f4fbU ,0x4369e96aU , -0x346ed9fcU ,0xad678846U ,0xda60b8d0U ,0x44042d73U ,0x33031de5U , -0xaa0a4c5fU ,0xdd0d7cc9U ,0x5005713cU ,0x270241aaU ,0xbe0b1010U , -0xc90c2086U ,0x5768b525U ,0x206f85b3U ,0xb966d409U ,0xce61e49fU , -0x5edef90eU ,0x29d9c998U ,0xb0d09822U ,0xc7d7a8b4U ,0x59b33d17U , -0x2eb40d81U ,0xb7bd5c3bU ,0xc0ba6cadU ,0xedb88320U ,0x9abfb3b6U , -0x03b6e20cU ,0x74b1d29aU ,0xead54739U ,0x9dd277afU ,0x04db2615U , -0x73dc1683U ,0xe3630b12U ,0x94643b84U ,0x0d6d6a3eU ,0x7a6a5aa8U , -0xe40ecf0bU ,0x9309ff9dU ,0x0a00ae27U ,0x7d079eb1U ,0xf00f9344U , -0x8708a3d2U ,0x1e01f268U ,0x6906c2feU ,0xf762575dU ,0x806567cbU , -0x196c3671U ,0x6e6b06e7U ,0xfed41b76U ,0x89d32be0U ,0x10da7a5aU , -0x67dd4accU ,0xf9b9df6fU ,0x8ebeeff9U ,0x17b7be43U ,0x60b08ed5U , -0xd6d6a3e8U ,0xa1d1937eU ,0x38d8c2c4U ,0x4fdff252U ,0xd1bb67f1U , -0xa6bc5767U ,0x3fb506ddU ,0x48b2364bU ,0xd80d2bdaU ,0xaf0a1b4cU , -0x36034af6U ,0x41047a60U ,0xdf60efc3U ,0xa867df55U ,0x316e8eefU , -0x4669be79U ,0xcb61b38cU ,0xbc66831aU ,0x256fd2a0U ,0x5268e236U , -0xcc0c7795U ,0xbb0b4703U ,0x220216b9U ,0x5505262fU ,0xc5ba3bbeU , -0xb2bd0b28U ,0x2bb45a92U ,0x5cb36a04U ,0xc2d7ffa7U ,0xb5d0cf31U , -0x2cd99e8bU ,0x5bdeae1dU ,0x9b64c2b0U ,0xec63f226U ,0x756aa39cU , -0x026d930aU ,0x9c0906a9U ,0xeb0e363fU ,0x72076785U ,0x05005713U , -0x95bf4a82U ,0xe2b87a14U ,0x7bb12baeU ,0x0cb61b38U ,0x92d28e9bU , -0xe5d5be0dU ,0x7cdcefb7U ,0x0bdbdf21U ,0x86d3d2d4U ,0xf1d4e242U , -0x68ddb3f8U ,0x1fda836eU ,0x81be16cdU ,0xf6b9265bU ,0x6fb077e1U , -0x18b74777U ,0x88085ae6U ,0xff0f6a70U ,0x66063bcaU ,0x11010b5cU , -0x8f659effU ,0xf862ae69U ,0x616bffd3U ,0x166ccf45U ,0xa00ae278U , -0xd70dd2eeU ,0x4e048354U ,0x3903b3c2U ,0xa7672661U ,0xd06016f7U , -0x4969474dU ,0x3e6e77dbU ,0xaed16a4aU ,0xd9d65adcU ,0x40df0b66U , -0x37d83bf0U ,0xa9bcae53U ,0xdebb9ec5U ,0x47b2cf7fU ,0x30b5ffe9U , -0xbdbdf21cU ,0xcabac28aU ,0x53b39330U ,0x24b4a3a6U ,0xbad03605U , -0xcdd70693U ,0x54de5729U ,0x23d967bfU ,0xb3667a2eU ,0xc4614ab8U , -0x5d681b02U ,0x2a6f2b94U ,0xb40bbe37U ,0xc30c8ea1U ,0x5a05df1bU , -0x2d02ef8dU +static const unsigned int crctab32[] = { +0x00000000U ,0x77073096U ,0xee0e612cU ,0x990951baU ,0x076dc419U , +0x706af48fU ,0xe963a535U ,0x9e6495a3U ,0x0edb8832U ,0x79dcb8a4U , +0xe0d5e91eU ,0x97d2d988U ,0x09b64c2bU ,0x7eb17cbdU ,0xe7b82d07U , +0x90bf1d91U ,0x1db71064U ,0x6ab020f2U ,0xf3b97148U ,0x84be41deU , +0x1adad47dU ,0x6ddde4ebU ,0xf4d4b551U ,0x83d385c7U ,0x136c9856U , +0x646ba8c0U ,0xfd62f97aU ,0x8a65c9ecU ,0x14015c4fU ,0x63066cd9U , +0xfa0f3d63U ,0x8d080df5U ,0x3b6e20c8U ,0x4c69105eU ,0xd56041e4U , +0xa2677172U ,0x3c03e4d1U ,0x4b04d447U ,0xd20d85fdU ,0xa50ab56bU , +0x35b5a8faU ,0x42b2986cU ,0xdbbbc9d6U ,0xacbcf940U ,0x32d86ce3U , +0x45df5c75U ,0xdcd60dcfU ,0xabd13d59U ,0x26d930acU ,0x51de003aU , +0xc8d75180U ,0xbfd06116U ,0x21b4f4b5U ,0x56b3c423U ,0xcfba9599U , +0xb8bda50fU ,0x2802b89eU ,0x5f058808U ,0xc60cd9b2U ,0xb10be924U , +0x2f6f7c87U ,0x58684c11U ,0xc1611dabU ,0xb6662d3dU ,0x76dc4190U , +0x01db7106U ,0x98d220bcU ,0xefd5102aU ,0x71b18589U ,0x06b6b51fU , +0x9fbfe4a5U ,0xe8b8d433U ,0x7807c9a2U ,0x0f00f934U ,0x9609a88eU , +0xe10e9818U ,0x7f6a0dbbU ,0x086d3d2dU ,0x91646c97U ,0xe6635c01U , +0x6b6b51f4U ,0x1c6c6162U ,0x856530d8U ,0xf262004eU ,0x6c0695edU , +0x1b01a57bU ,0x8208f4c1U ,0xf50fc457U ,0x65b0d9c6U ,0x12b7e950U , +0x8bbeb8eaU ,0xfcb9887cU ,0x62dd1ddfU ,0x15da2d49U ,0x8cd37cf3U , +0xfbd44c65U ,0x4db26158U ,0x3ab551ceU ,0xa3bc0074U ,0xd4bb30e2U , +0x4adfa541U ,0x3dd895d7U ,0xa4d1c46dU ,0xd3d6f4fbU ,0x4369e96aU , +0x346ed9fcU ,0xad678846U ,0xda60b8d0U ,0x44042d73U ,0x33031de5U , +0xaa0a4c5fU ,0xdd0d7cc9U ,0x5005713cU ,0x270241aaU ,0xbe0b1010U , +0xc90c2086U ,0x5768b525U ,0x206f85b3U ,0xb966d409U ,0xce61e49fU , +0x5edef90eU ,0x29d9c998U ,0xb0d09822U ,0xc7d7a8b4U ,0x59b33d17U , +0x2eb40d81U ,0xb7bd5c3bU ,0xc0ba6cadU ,0xedb88320U ,0x9abfb3b6U , +0x03b6e20cU ,0x74b1d29aU ,0xead54739U ,0x9dd277afU ,0x04db2615U , +0x73dc1683U ,0xe3630b12U ,0x94643b84U ,0x0d6d6a3eU ,0x7a6a5aa8U , +0xe40ecf0bU ,0x9309ff9dU ,0x0a00ae27U ,0x7d079eb1U ,0xf00f9344U , +0x8708a3d2U ,0x1e01f268U ,0x6906c2feU ,0xf762575dU ,0x806567cbU , +0x196c3671U ,0x6e6b06e7U ,0xfed41b76U ,0x89d32be0U ,0x10da7a5aU , +0x67dd4accU ,0xf9b9df6fU ,0x8ebeeff9U ,0x17b7be43U ,0x60b08ed5U , +0xd6d6a3e8U ,0xa1d1937eU ,0x38d8c2c4U ,0x4fdff252U ,0xd1bb67f1U , +0xa6bc5767U ,0x3fb506ddU ,0x48b2364bU ,0xd80d2bdaU ,0xaf0a1b4cU , +0x36034af6U ,0x41047a60U ,0xdf60efc3U ,0xa867df55U ,0x316e8eefU , +0x4669be79U ,0xcb61b38cU ,0xbc66831aU ,0x256fd2a0U ,0x5268e236U , +0xcc0c7795U ,0xbb0b4703U ,0x220216b9U ,0x5505262fU ,0xc5ba3bbeU , +0xb2bd0b28U ,0x2bb45a92U ,0x5cb36a04U ,0xc2d7ffa7U ,0xb5d0cf31U , +0x2cd99e8bU ,0x5bdeae1dU ,0x9b64c2b0U ,0xec63f226U ,0x756aa39cU , +0x026d930aU ,0x9c0906a9U ,0xeb0e363fU ,0x72076785U ,0x05005713U , +0x95bf4a82U ,0xe2b87a14U ,0x7bb12baeU ,0x0cb61b38U ,0x92d28e9bU , +0xe5d5be0dU ,0x7cdcefb7U ,0x0bdbdf21U ,0x86d3d2d4U ,0xf1d4e242U , +0x68ddb3f8U ,0x1fda836eU ,0x81be16cdU ,0xf6b9265bU ,0x6fb077e1U , +0x18b74777U ,0x88085ae6U ,0xff0f6a70U ,0x66063bcaU ,0x11010b5cU , +0x8f659effU ,0xf862ae69U ,0x616bffd3U ,0x166ccf45U ,0xa00ae278U , +0xd70dd2eeU ,0x4e048354U ,0x3903b3c2U ,0xa7672661U ,0xd06016f7U , +0x4969474dU ,0x3e6e77dbU ,0xaed16a4aU ,0xd9d65adcU ,0x40df0b66U , +0x37d83bf0U ,0xa9bcae53U ,0xdebb9ec5U ,0x47b2cf7fU ,0x30b5ffe9U , +0xbdbdf21cU ,0xcabac28aU ,0x53b39330U ,0x24b4a3a6U ,0xbad03605U , +0xcdd70693U ,0x54de5729U ,0x23d967bfU ,0xb3667a2eU ,0xc4614ab8U , +0x5d681b02U ,0x2a6f2b94U ,0xb40bbe37U ,0xc30c8ea1U ,0x5a05df1bU , +0x2d02ef8dU };static inline unsigned long partial_crc32_one (unsigned char c,unsigned long crc) { -return crctab32[(crc ^ c) &0xff ] ^ (crc >>8 ); +return crctab32[(crc ^ c) &0xff ] ^ (crc >>8 ); } -static inline unsigned long -partial_crc32 (const char *s,unsigned long crc) +static inline unsigned long partial_crc32 (const char *s,unsigned long crc) { -while (*s) - crc =partial_crc32_one (*s++, crc); -return crc; +while (*s) + crc =partial_crc32_one (*s++, crc); +return crc; } -static inline unsigned long -crc32 (const char *s) +static inline unsigned long crc32 (const char *s) { -return partial_crc32 (s,0xffffffff ) ^0xffffffff ; +return partial_crc32 (s,0xffffffff ) ^0xffffffff ; } -/*----------------------------------------------------------------------*/ -static inline enum symbol_type -map_to_ns (enum symbol_type t) +static inline enum symbol_type map_to_ns (enum symbol_type t) { -if (t ==SYM_TYPEDEF ) - t =SYM_NORMAL ; -else if (t ==SYM_UNION ) - t =SYM_STRUCT ; -return t; +if (t ==SYM_TYPEDEF ) + t =SYM_NORMAL ; +else if (t ==SYM_UNION ) + t =SYM_STRUCT ; +return t; } -struct symbol * -find_symbol (const char *name,enum symbol_type ns) +struct symbol *find_symbol (const char *name,enum symbol_type ns) { -unsigned long h =crc32 (name) %HASH_BUCKETS ; -struct symbol *sym; +unsigned long h =crc32 (name) %HASH_BUCKETS ; +struct symbol *sym; -for (sym = symtab[h]; sym ; sym = sym->hash_next) -if (map_to_ns (sym->type) ==map_to_ns (ns) &&strcmp (name, sym->name) ==0 ) -break ; +for (sym = symtab[h]; sym; sym = sym->hash_next) +if (map_to_ns (sym->type) ==map_to_ns (ns) + &&strcmp (name, sym->name) ==0 ) +break ; -return sym; +return sym; } -struct symbol * -add_symbol (const char *name,enum symbol_type type,struct string_list *defn,int is_extern) +struct symbol *add_symbol (const char *name,enum symbol_type type, +struct string_list *defn,int is_extern) { -unsigned long h =crc32 (name) %HASH_BUCKETS ; -struct symbol *sym; +unsigned long h =crc32 (name) %HASH_BUCKETS ; +struct symbol *sym; -for (sym = symtab[h]; sym ; sym = sym->hash_next) -if (map_to_ns (sym->type) ==map_to_ns (type) - &&strcmp (name, sym->name) ==0 ) - { -if (!equal_list (sym->defn, defn)) -error_with_pos ("redefinition of %s" , name); -return sym; - } +for (sym = symtab[h]; sym; sym = sym->hash_next) +if (map_to_ns (sym->type) ==map_to_ns (type) + &&strcmp (name, sym->name) ==0 ) { +if (!equal_list (sym->defn, defn)) +error_with_pos ("redefinition of %s" , name); +return sym; + } - sym =xmalloc (sizeof (*sym)); - sym->name = name; - sym->type = type; - sym->defn = defn; - sym->expansion_trail =NULL ; - sym->is_extern = is_extern; - - sym->hash_next = symtab[h]; - symtab[h] = sym; - -if (flag_debug) - { -fprintf (debugfile,"Defn for %s %s == <" , symbol_type_name[type], name); -if (is_extern) -fputs ("extern " , debugfile); -print_list (debugfile, defn); -fputs (">\n" , debugfile); - } + sym =xmalloc (sizeof (*sym)); + sym->name = name; + sym->type = type; + sym->defn = defn; + sym->expansion_trail =NULL ; + sym->is_extern = is_extern; + + sym->hash_next = symtab[h]; + symtab[h] = sym; + +if (flag_debug) { +fprintf (debugfile,"Defn for %s %s == <" , + symbol_type_name[type], name); +if (is_extern) +fputs ("extern " , debugfile); +print_list (debugfile, defn); +fputs (">\n" , debugfile); + } - ++nsyms; -return sym; + ++nsyms; +return sym; } -/*----------------------------------------------------------------------*/ -inline void -free_node (struct string_list *node) +inline void free_node (struct string_list *node) { -free (node->string); -free (node); +free (node->string); +free (node); } -void -free_list (struct string_list *s,struct string_list *e) +void free_list (struct string_list *s,struct string_list *e) { -while (s != e) - { -struct string_list *next = s->next; -free_node (s); - s = next; - } +while (s != e) { +struct string_list *next = s->next; +free_node (s); + s = next; + } } -inline struct string_list * -copy_node (struct string_list *node) +inline struct string_list *copy_node (struct string_list *node) { -struct string_list *newnode; +struct string_list *newnode; - newnode =xmalloc (sizeof (*newnode)); - newnode->string =xstrdup (node->string); - newnode->tag = node->tag; + newnode =xmalloc (sizeof (*newnode)); + newnode->string =xstrdup (node->string); + newnode->tag = node->tag; -return newnode; +return newnode; } -struct string_list * -copy_list (struct string_list *s,struct string_list *e) +struct string_list *copy_list (struct string_list *s,struct string_list *e) { -struct string_list *h, *p; +struct string_list *h, *p; -if (s == e) -return NULL ; +if (s == e) +return NULL ; - p = h =copy_node (s); -while ((s = s->next) != e) - p = p->next =copy_node (s); - p->next =NULL ; + p = h =copy_node (s); +while ((s = s->next) != e) + p = p->next =copy_node (s); + p->next =NULL ; -return h; +return h; } -int -equal_list (struct string_list *a,struct string_list *b) +int equal_list (struct string_list *a,struct string_list *b) { -while (a && b) - { -if (a->tag != b->tag ||strcmp (a->string, b->string)) -return 0 ; - a = a->next; - b = b->next; - } +while (a && b) { +if (a->tag != b->tag ||strcmp (a->string, b->string)) +return 0 ; + a = a->next; + b = b->next; + } -return !a && !b; +return !a && !b; } -static inline void -print_node (FILE *f,struct string_list *list) +static inline void print_node (FILE * f,struct string_list *list) { -switch (list->tag) - { -case SYM_STRUCT : -putc ('s' , f); - goto printit; -case SYM_UNION : -putc ('u' , f); - goto printit; -case SYM_ENUM : -putc ('e' , f); - goto printit; -case SYM_TYPEDEF : -putc ('t' , f); - goto printit; +switch (list->tag) { +case SYM_STRUCT : +putc ('s' , f); + goto printit; +case SYM_UNION : +putc ('u' , f); + goto printit; +case SYM_ENUM : +putc ('e' , f); + goto printit; +case SYM_TYPEDEF : +putc ('t' , f); + goto printit; - printit: -putc ('#' , f); -case SYM_NORMAL : -fputs (list->string, f); -break ; - } + printit: +putc ('#' , f); +case SYM_NORMAL : +fputs (list->string, f); +break ; + } } -void -print_list (FILE *f,struct string_list *list) +void print_list (FILE * f,struct string_list *list) { -struct string_list **e, **b; -struct string_list *tmp, **tmp2; -int elem =1 ; - -if (list ==NULL ) - { -fputs ("(nil)" , f); -return ; - } - - tmp = list; -while ((tmp = tmp->next) !=NULL ) - elem++; - - b =alloca (elem *sizeof (*e)); - e = b + elem; - tmp2 = e -1 ; - - (*tmp2--) = list; -while ((list = list->next) !=NULL ) - *(tmp2--) = list; +struct string_list **e, **b; +struct string_list *tmp, **tmp2; +int elem =1 ; + +if (list ==NULL ) { +fputs ("(nil)" , f); +return ; + } -while (b != e) - { -print_node (f, *b++); -putc (' ' , f); - } + tmp = list; +while ((tmp = tmp->next) !=NULL ) + elem++; + + b =alloca (elem *sizeof (*e)); + e = b + elem; + tmp2 = e -1 ; + + (*tmp2--) = list; +while ((list = list->next) !=NULL ) + *(tmp2--) = list; + +while (b != e) { +print_node (f, *b++); +putc (' ' , f); + } }static unsigned long expand_and_crc_list (struct string_list *list,unsigned long crc) { -struct string_list **e, **b; -struct string_list *tmp, **tmp2; -int elem =1 ; - -if (!list) -return crc; - - tmp = list; -while ((tmp = tmp->next) !=NULL ) - elem++; - - b =alloca (elem *sizeof (*e)); - e = b + elem; - tmp2 = e -1 ; - - *(tmp2--) = list; -while ((list = list->next) !=NULL ) - *(tmp2--) = list; - -while (b != e) - { -struct string_list *cur; -struct symbol *subsym; - - cur = *(b++); -switch (cur->tag) - { -case SYM_NORMAL : -if (flag_dump_defs) -fprintf (debugfile,"%s " , cur->string); - crc =partial_crc32 (cur->string, crc); - crc =partial_crc32_one (' ' , crc); -break ; - -case SYM_TYPEDEF : - subsym =find_symbol (cur->string, cur->tag); -if (subsym->expansion_trail) - { -if (flag_dump_defs) -fprintf (debugfile,"%s " , cur->string); - crc =partial_crc32 (cur->string, crc); - crc =partial_crc32_one (' ' , crc); - } -else - { - subsym->expansion_trail = expansion_trail; - expansion_trail = subsym; - crc =expand_and_crc_list (subsym->defn, crc); - } -break ; - -case SYM_STRUCT : -case SYM_UNION : -case SYM_ENUM : - subsym =find_symbol (cur->string, cur->tag); -if (!subsym) - { -struct string_list *n, *t =NULL ; - -error_with_pos ("expand undefined %s %s" , - symbol_type_name[cur->tag], cur->string); - - n =xmalloc (sizeof (*n)); - n->string =xstrdup (symbol_type_name[cur->tag]); - n->tag =SYM_NORMAL ; - n->next = t; - t = n; - - n =xmalloc (sizeof (*n)); - n->string =xstrdup (cur->string); - n->tag =SYM_NORMAL ; - n->next = t; - t = n; - - n =xmalloc (sizeof (*n)); - n->string =xstrdup ("{ UNKNOWN }" ); - n->tag =SYM_NORMAL ; - n->next = t; - - subsym =add_symbol (cur->string, cur->tag, n,0 ); - } -if (subsym->expansion_trail) - { -if (flag_dump_defs) - { -fprintf (debugfile,"%s %s " , symbol_type_name[cur->tag], - cur->string); +struct string_list **e, **b; +struct string_list *tmp, **tmp2; +int elem =1 ; + +if (!list) +return crc; + + tmp = list; +while ((tmp = tmp->next) !=NULL ) + elem++; + + b =alloca (elem *sizeof (*e)); + e = b + elem; + tmp2 = e -1 ; + + *(tmp2--) = list; +while ((list = list->next) !=NULL ) + *(tmp2--) = list; + +while (b != e) { +struct string_list *cur; +struct symbol *subsym; + + cur = *(b++); +switch (cur->tag) { +case SYM_NORMAL : +if (flag_dump_defs) +fprintf (debugfile,"%s " , cur->string); + crc =partial_crc32 (cur->string, crc); + crc =partial_crc32_one (' ' , crc); +break ; + +case SYM_TYPEDEF : + subsym =find_symbol (cur->string, cur->tag); +if (subsym->expansion_trail) { +if (flag_dump_defs) +fprintf (debugfile,"%s " , cur->string); + crc =partial_crc32 (cur->string, crc); + crc =partial_crc32_one (' ' , crc); + }else { + subsym->expansion_trail = expansion_trail; + expansion_trail = subsym; + crc =expand_and_crc_list (subsym->defn, crc); + } +break ; + +case SYM_STRUCT : +case SYM_UNION : +case SYM_ENUM : + subsym =find_symbol (cur->string, cur->tag); +if (!subsym) { +struct string_list *n, *t =NULL ; + +error_with_pos ("expand undefined %s %s" , + symbol_type_name[cur->tag], + cur->string); + + n =xmalloc (sizeof (*n)); + n->string =xstrdup (symbol_type_name[cur->tag]); + n->tag =SYM_NORMAL ; + n->next = t; + t = n; + + n =xmalloc (sizeof (*n)); + n->string =xstrdup (cur->string); + n->tag =SYM_NORMAL ; + n->next = t; + t = n; + + n =xmalloc (sizeof (*n)); + n->string =xstrdup ("{ UNKNOWN }" ); + n->tag =SYM_NORMAL ; + n->next = t; + + subsym = +add_symbol (cur->string, cur->tag, n,0 ); + } +if (subsym->expansion_trail) { +if (flag_dump_defs) { +fprintf (debugfile,"%s %s " , + symbol_type_name[cur->tag], + cur->string); + } + + crc = +partial_crc32 (symbol_type_name[cur->tag], + crc); + crc =partial_crc32_one (' ' , crc); + crc =partial_crc32 (cur->string, crc); + crc =partial_crc32_one (' ' , crc); + }else { + subsym->expansion_trail = expansion_trail; + expansion_trail = subsym; + crc =expand_and_crc_list (subsym->defn, crc); + } +break ; } - - crc =partial_crc32 (symbol_type_name[cur->tag], crc); - crc =partial_crc32_one (' ' , crc); - crc =partial_crc32 (cur->string, crc); - crc =partial_crc32_one (' ' , crc); - } -else - { - subsym->expansion_trail = expansion_trail; - expansion_trail = subsym; - crc =expand_and_crc_list (subsym->defn, crc); - } -break ; } - } -return crc; +return crc; } -void -export_symbol (const char *name) +void export_symbol (const char *name) { -struct symbol *sym; +struct symbol *sym; - sym =find_symbol (name,SYM_NORMAL ); -if (!sym) -error_with_pos ("export undefined symbol %s" , name); -else - { -unsigned long crc; + sym =find_symbol (name,SYM_NORMAL ); +if (!sym) +error_with_pos ("export undefined symbol %s" , name); +else { +unsigned long crc; -if (flag_dump_defs) -fprintf (debugfile,"Export %s == <" , name); +if (flag_dump_defs) +fprintf (debugfile,"Export %s == <" , name); - expansion_trail = (struct symbol *)-1L ; + expansion_trail = (struct symbol *)-1L ; - crc =expand_and_crc_list (sym->defn,0xffffffff ) ^0xffffffff ; + crc =expand_and_crc_list (sym->defn,0xffffffff ) ^0xffffffff ; - sym = expansion_trail; -while (sym != (struct symbol *)-1L ) - { -struct symbol *n = sym->expansion_trail; - sym->expansion_trail =0 ; - sym = n; - } + sym = expansion_trail; +while (sym != (struct symbol *)-1L ) { +struct symbol *n = sym->expansion_trail; + sym->expansion_trail =0 ; + sym = n; + } -if (flag_dump_defs) -fputs (">\n" , debugfile); +if (flag_dump_defs) +fputs (">\n" , debugfile); -/* Used as a linker script. */ -printf ("%s__crc_%s = 0x%08lx ;\n" , mod_prefix, name, crc); - } +/* Used as a linker script. */ +printf ("%s__crc_%s = 0x%08lx ;\n" , mod_prefix, name, crc); + } }/*----------------------------------------------------------------------*/ -void -error (const char *fmt, ...) +void error (const char *fmt, ...) { -va_list args; +va_list args; -if (flag_warnings) - { -va_start (args, fmt); -vfprintf (stderr, fmt, args); -va_end (args); -putc ('\n' , stderr); +if (flag_warnings) { +va_start (args, fmt); +vfprintf (stderr, fmt, args); +va_end (args); +putc ('\n' , stderr); - errors++; - } + errors++; + } } -void -error_with_pos (const char *fmt, ...) +void error_with_pos (const char *fmt, ...) { -va_list args; +va_list args; -if (flag_warnings) - { -fprintf (stderr,"%s:%d: " , cur_filename ? :"<stdin>" , cur_line); +if (flag_warnings) { +fprintf (stderr,"%s:%d: " , cur_filename ? :"<stdin>" , + cur_line); -va_start (args, fmt); -vfprintf (stderr, fmt, args); -va_end (args); -putc ('\n' , stderr); +va_start (args, fmt); +vfprintf (stderr, fmt, args); +va_end (args); +putc ('\n' , stderr); - errors++; - } + errors++; + } } -void genksyms_usage (void ) { -fputs ("Usage:\n" -"genksyms [-dDwqhV] > /path/to/.tmp_obj.ver\n" -"\n" +fputs ("Usage:\n" "genksyms [-dDwqhV] > /path/to/.tmp_obj.ver\n" "\n" #ifdef __GNU_LIBRARY__" -d, --debug Increment the debug level (repeatable)\n" " -D, --dump Dump expanded symbol defs (for debugging only)\n"
@@ -512,87 +479,84 @@ void genksyms_usage(void)" -q, --quiet Disable warnings (default)\n" " -h, --help Print this message\n" " -V, --version Print the release version\n" -#else /* __GNU_LIBRARY__ */ -" -d Increment the debug level (repeatable)\n" -" -D Dump expanded symbol defs (for debugging only)\n" -" -w Enable warnings\n" -" -q Disable warnings (default)\n" -" -h Print this message\n" -" -V Print the release version\n" -#endif /* __GNU_LIBRARY__ */ +#else /* __GNU_LIBRARY__ */ +" -d Increment the debug level (repeatable)\n" +" -D Dump expanded symbol defs (for debugging only)\n" +" -w Enable warnings\n" +" -q Disable warnings (default)\n" +" -h Print this message\n" +" -V Print the release version\n" +#endif /* __GNU_LIBRARY__ */ , stderr); } -int -main (int argc,char **argv) +int main (int argc,char **argv) { -int o; +int o;#ifdef __GNU_LIBRARY__ -struct option long_opts[] = { - {"arch" ,1 ,0 ,'a' }, - {"debug" ,0 ,0 ,'d' }, - {"warnings" ,0 ,0 ,'w' }, - {"quiet" ,0 ,0 ,'q' }, - {"dump" ,0 ,0 ,'D' }, - {"version" ,0 ,0 ,'V' }, - {"help" ,0 ,0 ,'h' }, - {0 ,0 ,0 ,0 } - }; - -while ((o =getopt_long (argc, argv,"a:dwqVDk:p:" , - &long_opts[0 ],NULL )) !=EOF ) -#else /* __GNU_LIBRARY__ */ - while ((o = getopt(argc, argv, "a:dwqVDk:p:")) != EOF) -#endif /* __GNU_LIBRARY__ */ -switch (o) - { -case 'a' : - arch = optarg; -break ; -case 'd' : - flag_debug++; -break ; -case 'w' : - flag_warnings =1 ; -break ; -case 'q' : - flag_warnings =0 ; -break ; -case 'V' : -fputs ("genksyms version 2.5.60\n" , stderr); -break ; -case 'D' : - flag_dump_defs =1 ; -break ; -case 'h' : -genksyms_usage (); -return 0 ; -default : -genksyms_usage (); -return 1 ; - } -if ((strcmp (arch,"v850" ) ==0 ) || - (strcmp (arch,"h8300" ) ==0 )) - mod_prefix ="_" ; - { -extern int yydebug; -extern int yy_flex_debug; - - yydebug = (flag_debug >1 ); - yy_flex_debug = (flag_debug >2 ); - - debugfile = stderr; -/* setlinebuf(debugfile); */ - } - -yyparse (); - -if (flag_debug) - { -fprintf (debugfile,"Hash table occupancy %d/%d = %g\n" , - nsyms,HASH_BUCKETS , (double )nsyms / (double )HASH_BUCKETS ); - } +struct option long_opts[] = { + {"arch" ,1 ,0 ,'a' }, + {"debug" ,0 ,0 ,'d' }, + {"warnings" ,0 ,0 ,'w' }, + {"quiet" ,0 ,0 ,'q' }, + {"dump" ,0 ,0 ,'D' }, + {"version" ,0 ,0 ,'V' }, + {"help" ,0 ,0 ,'h' }, + {0 ,0 ,0 ,0 } + }; + +while ((o =getopt_long (argc, argv,"a:dwqVDk:p:" , + &long_opts[0 ],NULL )) !=EOF ) +#else /* __GNU_LIBRARY__ */ + while ((o = getopt(argc, argv, "a:dwqVDk:p:")) != EOF) +#endif /* __GNU_LIBRARY__ */ +switch (o) { +case 'a' : + arch = optarg; +break ; +case 'd' : + flag_debug++; +break ; +case 'w' : + flag_warnings =1 ; +break ; +case 'q' : + flag_warnings =0 ; +break ; +case 'V' : +fputs ("genksyms version 2.5.60\n" , stderr); +break ; +case 'D' : + flag_dump_defs =1 ; +break ; +case 'h' : +genksyms_usage (); +return 0 ; +default : +genksyms_usage (); +return 1 ; + } +if ((strcmp (arch,"v850" ) ==0 ) || (strcmp (arch,"h8300" ) ==0 )) + mod_prefix ="_" ; + { +extern int yydebug; +extern int yy_flex_debug; + + yydebug = (flag_debug >1 ); + yy_flex_debug = (flag_debug >2 ); + + debugfile = stderr; +/* setlinebuf(debugfile); */ + } + +yyparse (); + +if (flag_debug) { +fprintf (debugfile,"Hash table occupancy %d/%d = %g\n" , + nsyms,HASH_BUCKETS , + (double )nsyms / (double )HASH_BUCKETS ); + } -return errors !=0 ; +return errors !=0 ; }
Signature · 1 line
1.0.GIT
PATCH 41/46 kbuild: clean-up genksyms
o remove all inlines
o declare everything static which is only used by genksyms.c
o delete unused functions
o delete unused variables
o delete unused stuff in genksyms.h
o properly ident genksyms.h
---
scripts/genksyms/genksyms.c | 80 ++++++++++++++----------------------------- scripts/genksyms/genksyms.h | 57 +++++++++---------------------- 2 files changed, 43 insertions(+), 94 deletions(-)
ce560686947fd50b30eaf42045554797f53949dd
scripts/genksyms/genksyms.c +26 -54
@@ -37,14 +37,14 @@#define HASH_BUCKETS 4096static struct symbol *symtab[HASH_BUCKETS ]; -FILE *debugfile; +static FILE *debugfile;int cur_line =1 ; -char *cur_filename, *output_directory; +char *cur_filename; -int flag_debug, flag_dump_defs, flag_warnings; -const char *arch ="" ; -const char *mod_prefix ="" ; +static int flag_debug, flag_dump_defs, flag_warnings; +static const char *arch ="" ; +static const char *mod_prefix ="" ;static int errors;static int nsyms;
@@ -55,6 +55,9 @@ static const char *const symbol_type_nam"normal" ,"typedef" ,"enum" ,"struct" ,"union" }; +static int equal_list (struct string_list *a,struct string_list *b); +static void print_list (FILE * f,struct string_list *list); +/*----------------------------------------------------------------------*/ static const unsigned int crctab32[] = {
@@ -112,27 +115,26 @@ static const unsigned int crctab32[] = { 0x2d02ef8dU }; -static inline unsigned long -partial_crc32_one (unsigned char c,unsigned long crc) +static unsigned long partial_crc32_one (unsigned char c,unsigned long crc) {return crctab32[(crc ^ c) &0xff ] ^ (crc >>8 ); } -static inline unsigned long partial_crc32 (const char *s,unsigned long crc) +static unsigned long partial_crc32 (const char *s,unsigned long crc) {while (*s) crc =partial_crc32_one (*s++, crc);return crc; } -static inline unsigned long crc32 (const char *s) +static unsigned long crc32 (const char *s) {return partial_crc32 (s,0xffffffff ) ^0xffffffff ; }/*----------------------------------------------------------------------*/ -static inline enum symbol_type map_to_ns (enum symbol_type t) +static enum symbol_type map_to_ns (enum symbol_type t) {if (t ==SYM_TYPEDEF ) t =SYM_NORMAL ;
@@ -147,8 +149,8 @@ struct symbol *find_symbol(const char *nstruct symbol *sym;for (sym = symtab[h]; sym; sym = sym->hash_next) -if (map_to_ns (sym->type) ==map_to_ns (ns) - &&strcmp (name, sym->name) ==0 ) +if (map_to_ns (sym->type) ==map_to_ns (ns) && +strcmp (name, sym->name) ==0 )break ;return sym;
@@ -160,13 +162,14 @@ struct symbol *add_symbol(const char *naunsigned long h =crc32 (name) %HASH_BUCKETS ;struct symbol *sym; -for (sym = symtab[h]; sym; sym = sym->hash_next) +for (sym = symtab[h]; sym; sym = sym->hash_next) {if (map_to_ns (sym->type) ==map_to_ns (type) &&strcmp (name, sym->name) ==0 ) {if (!equal_list (sym->defn, defn))error_with_pos ("redefinition of %s" , name);return sym; } + } sym =xmalloc (sizeof (*sym)); sym->name = name;
@@ -193,7 +196,7 @@ struct symbol *add_symbol(const char *na/*----------------------------------------------------------------------*/ -inline void free_node (struct string_list *node) +void free_node (struct string_list *node) {free (node->string);free (node);
@@ -208,7 +211,7 @@ void free_list(struct string_list *s, st } } -inline struct string_list *copy_node (struct string_list *node) +struct string_list *copy_node (struct string_list *node) {struct string_list *newnode;
@@ -219,22 +222,7 @@ inline struct string_list *copy_node(strreturn newnode; } -struct string_list *copy_list (struct string_list *s,struct string_list *e) -{ -struct string_list *h, *p; - -if (s == e) -return NULL ; - - p = h =copy_node (s); -while ((s = s->next) != e) - p = p->next =copy_node (s); - p->next =NULL ; - -return h; -} - -int equal_list (struct string_list *a,struct string_list *b) +static int equal_list (struct string_list *a,struct string_list *b) {while (a && b) {if (a->tag != b->tag ||strcmp (a->string, b->string))
@@ -246,7 +234,7 @@ int equal_list(struct string_list *a, streturn !a && !b; } -static inline void print_node (FILE * f,struct string_list *list) +static void print_node (FILE * f,struct string_list *list) {switch (list->tag) {case SYM_STRUCT :
@@ -270,7 +258,7 @@ static inline void print_node(FILE * f, } } -void print_list (FILE * f,struct string_list *list) +static void print_list (FILE * f,struct string_list *list) {struct string_list **e, **b;struct string_list *tmp, **tmp2;
@@ -299,8 +287,8 @@ void print_list(FILE * f, struct string_ } } -static unsigned long -expand_and_crc_list (struct string_list *list,unsigned long crc) +static unsigned long expand_and_crc_list (struct string_list *list, +unsigned long crc) {struct string_list **e, **b;struct string_list *tmp, **tmp2;
@@ -386,9 +374,8 @@ expand_and_crc_list(struct string_list * cur->string); } - crc = -partial_crc32 (symbol_type_name[cur->tag], - crc); + crc =partial_crc32 (symbol_type_name[cur->tag], + crc); crc =partial_crc32_one (' ' , crc); crc =partial_crc32 (cur->string, crc); crc =partial_crc32_one (' ' , crc);
@@ -437,21 +424,6 @@ void export_symbol(const char *name) }/*----------------------------------------------------------------------*/ - -void error (const char *fmt, ...) -{ -va_list args; - -if (flag_warnings) { -va_start (args, fmt); -vfprintf (stderr, fmt, args); -va_end (args); -putc ('\n' , stderr); - - errors++; - } -} -void error_with_pos (const char *fmt, ...) {va_list args;
@@ -469,7 +441,7 @@ void error_with_pos(const char *fmt, ... } } -void genksyms_usage (void ) +static void genksyms_usage (void ) { fputs("Usage:\n" "genksyms [-dDwqhV] > /path/to/.tmp_obj.ver\n" "\n"#ifdef __GNU_LIBRARY__
scripts/genksyms/genksyms.h +17 -40
95 lines not on this page · raw message
Signature · 1 line
1.0.GIT
PATCH 42/46 kbuild: add -fverbose-asm to i386 Makefile
Add -fverbose-asm to i386 Makefile rule for building .s files. This makes the assembler output much more readable for humans.
Suggested by Der Herr Hofrat <[email protected]>
---
scripts/Makefile.build | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
7d1859835cd6c0afd1773d249300da82b1b868a5
scripts/Makefile.build +1 -1
@@ -129,7 +129,7 @@ $(multi-objs-y:.o=.s) : modname = $(mo $(multi-objs-y:.o=.lst) : modname = $(modname-multi) quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ -cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< +cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< %.s: %.c FORCE $(call if_changed_dep,cc_s_c)
Signature · 1 line
1.0.GIT
PATCH 43/46 Kconfig: remove the CONFIG_CC_ALIGN_* options
I don't see any use case for the CONFIG_CC_ALIGN_* options:
- they are only available if EMBEDDED
- people using EMBEDDED will most likely also enable CC_OPTIMIZE_FOR_SIZE
- the default for -Os is to disable alignment
In case someone is doing performance comparisons and discovers that the default settings gcc chooses aren't good, the only sane thing is to discuss whether it makes sense to change this, not through offering options to change this locally.
---
Makefile | 7 ------- init/Kconfig | 37 ------------------------------------- 2 files changed, 0 insertions(+), 44 deletions(-)
8cab77a2f851363e35089b9720373b964f64550e
Makefile +0 -7
@@ -472,13 +472,6 @@ else CFLAGS += -O2 endif -#Add align options if CONFIG_CC_* is not equal to 0 -add-align = $(if $(filter-out 0,$($(1))),$(cc-option-align)$(2)=$($(1))) -CFLAGS += $(call add-align,CONFIG_CC_ALIGN_FUNCTIONS,-functions) -CFLAGS += $(call add-align,CONFIG_CC_ALIGN_LABELS,-labels) -CFLAGS += $(call add-align,CONFIG_CC_ALIGN_LOOPS,-loops) -CFLAGS += $(call add-align,CONFIG_CC_ALIGN_JUMPS,-jumps) - ifdef CONFIG_FRAME_POINTER CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,) else
init/Kconfig +0 -37
@@ -354,43 +354,6 @@ config SHMEM option replaces shmem and tmpfs with the much simpler ramfs code, which may be appropriate on small systems without swap. -config CC_ALIGN_FUNCTIONS - int "Function alignment" if EMBEDDED - default 0 - help - Align the start of functions to the next power-of-two greater than n, - skipping up to n bytes. For instance, 32 aligns functions - to the next 32-byte boundary, but 24 would align to the next - 32-byte boundary only if this can be done by skipping 23 bytes or less. - Zero means use compiler's default. - -config CC_ALIGN_LABELS - int "Label alignment" if EMBEDDED - default 0 - help - Align all branch targets to a power-of-two boundary, skipping - up to n bytes like ALIGN_FUNCTIONS. This option can easily - make code slower, because it must insert dummy operations for - when the branch target is reached in the usual flow of the code. - Zero means use compiler's default. - -config CC_ALIGN_LOOPS - int "Loop alignment" if EMBEDDED - default 0 - help - Align loops to a power-of-two boundary, skipping up to n bytes. - Zero means use compiler's default. - -config CC_ALIGN_JUMPS - int "Jump alignment" if EMBEDDED - default 0 - help - Align branch targets to a power-of-two boundary, for branch - targets where the targets can only be reached by jumping, - skipping up to n bytes like ALIGN_FUNCTIONS. In this case, - no dummy operations need be executed. - Zero means use compiler's default. - config SLAB default y bool "Use full SLAB allocator" if EMBEDDED
Signature · 1 line
1.0.GIT
PATCH 44/46 kconfig: fix time ordering of writes to .kconfig.d and include/linux/autoconf.h
Since .kconfig.d is used as a make dependency of include/linux/autoconf.h, it should be written earlier than the header file, to avoid a subsequent rebuild to consider the header outdated.
---
scripts/kconfig/confdata.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
dc9a49a4af9cdbe3d79183eefb12372b4dbc09c2
scripts/kconfig/confdata.c +1 -1
@@ -374,6 +374,7 @@ int conf_write(const char *name) out_h =fopen (".tmpconfig.h" ,"w" );if (!out_h)return 1 ; +file_write_dep (NULL ); } sym =sym_lookup ("KERNELVERSION" ,0 );sym_calc_value (sym);
@@ -512,7 +513,6 @@ int conf_write(const char *name)if (out_h) {fclose (out_h);rename (".tmpconfig.h" ,"include/linux/autoconf.h" ); -file_write_dep (NULL ); }if (!name || basename != conf_def_filename) {if (!name)
Signature · 1 line
1.0.GIT
PATCH 45/46 kbuild: fix make help & make *pkg
FORCE was not defined => error.
Use kbuild infrastructure to call down to the relevant Makefile. This enables us to use the FORCE definition from kbuild.
---
Makefile | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
6c2133e11b422b7379b5a660c639f7d53d18ca3b
Makefile +3 -3
@@ -994,9 +994,9 @@ distclean: mrproper package-dir := $(srctree)/scripts/package %pkg: FORCE - $(Q)$(MAKE) -f $(package-dir)/Makefile $@ + $(Q)$(MAKE) $(build)=$(package-dir) $@ rpm: FORCE - $(Q)$(MAKE) -f $(package-dir)/Makefile $@ + $(Q)$(MAKE) $(build)=$(package-dir) $@ # Brief documentation of the typical targets used
@@ -1034,7 +1034,7 @@ help: @echo ' namespacecheck - Name space analysis on compiled kernel' @echo '' @echo 'Kernel packaging:' - @$(MAKE) -f $(package-dir)/Makefile help + @$(MAKE) $(build)=$(package-dir) help @echo '' @echo 'Documentation targets:' @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp
Signature · 1 line
1.0.GIT
PATCH 46/46 kbuild: remove obsoleted scripts/reference_* files
The checks performed by scripts/reference_* has been moved to modpost. Remove the files and their reference in top-level Makefile.
---
Makefile | 6 -- scripts/reference_discarded.pl | 112 ---------------------------------------- scripts/reference_init.pl | 108 --------------------------------------- 3 files changed, 0 insertions(+), 226 deletions(-) delete mode 100644 scripts/reference_discarded.pl delete mode 100644 scripts/reference_init.pl
eae0f536f640bb95f2ad437a57c40c7d5683d1ac
Makefile +0 -6
@@ -1028,8 +1028,6 @@ help: @echo ' kernelversion - Output the version stored in Makefile' @echo '' @echo 'Static analysers' - @echo ' buildcheck - List dangling references to vmlinux discarded sections' - @echo ' and init sections from non-init sections' @echo ' checkstack - Generate a list of stack hogs' @echo ' namespacecheck - Name space analysis on compiled kernel' @echo ''
@@ -1255,10 +1253,6 @@ versioncheck: -name '*.[hcS]' -type f -print | sort \ | xargs $(PERL) -w scripts/checkversion.pl -buildcheck: - $(PERL) $(srctree)/scripts/reference_discarded.pl - $(PERL) $(srctree)/scripts/reference_init.pl - namespacecheck: $(PERL) $(srctree)/scripts/namespace.pl
scripts/reference_discarded.pl deleted +0 -112
112 lines not on this page · raw message
scripts/reference_init.pl deleted +0 -108
108 lines not on this page · raw message
Signature · 1 line
1.0.GIT
Re: [PATCH 35/46] kbuild: change kbuild to not rely on incorrect GNU make behavior
In reply to Sam Ravnborgscripts/package/Makefile clean-dirs += $(objtree)/debian/ · line 88
Quoted 13 lines · Sam Ravnborg
scripts/package/Makefile +1
-1@@ -82,7 +82,7 @@ clean-dirs += $(objtree)/debian/ # tarball targets # --------------------------------------------------------------------------- -.PHONY: tar%pkg +PHONY += tar%pkg tar%pkg: $(MAKE) KBUILD_SRC= $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
This part is wrong. $(PHONY) isn't subject to pattern matching, so all targets that match 'tar%pkg' must be listed here. Fortunately, that's only three:
PHONY += tar-pkg targz-pkg tarbz2-pkg
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Re: [PATCH 35/46] kbuild: change kbuild to not rely on incorrect GNU make behavior
%% Jan-Benedict Glaw <[email protected]> writes:
Quoted 2 lines · Sam Ravnborg
Quoted 2 lines
-.PHONY: tar%pkg
+PHONY += tar%pkg
jg> This part is wrong. $(PHONY) isn't subject to pattern matching,
You're correct that it won't do what the author apparently expected, however it WILL do exactly what the previous versions of kbuild used to do.
Quoted 5 lines · I wrote:
To: Sam Ravnborg <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] change kbuild to not rely on incorrect GNU make behavior
From: "Paul D. Smith" <[email protected]>
Date: Sun, 5 Mar 2006 19:41:07 -0500
...
Quoted 3 lines
Note that this won't do what you expect. tar%pkg is a pattern rule, but .PHONY doesn't take patterns so you're declaring the actual file named literally 'tar%pkg' to be phony.
jg> so all targets that match 'tar%pkg' must be listed jg> here. Fortunately, that's only three:
jg> PHONY += tar-pkg targz-pkg tarbz2-pkg
This would be more correct, indeed; but note this change is orthogonal to the purpose and requirements of the patch provided.
Of course, that doesn't mean they shouldn't be combined if that's acceptable to the patch-masters! :-).
Cheers!
Signature · 4 lines
------------------------------------------------------------------------------- Paul D. Smith <[email protected]> Find some GNU make tips at: http://www.gnu.org http://make.paulandlesley.org "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
Re: [PATCH 35/46] kbuild: change kbuild to not rely on incorrect GNU make behavior
In reply to Jan-Benedict GlawQuoted 19 lines · Jan-Benedict Glaw
scripts/package/Makefile clean-dirs += $(objtree)/debian/ · line 88
Quoted 13 lines · Sam Ravnborg
scripts/package/Makefile +1
-1@@ -82,7 +82,7 @@ clean-dirs += $(objtree)/debian/ # tarball targets # --------------------------------------------------------------------------- -.PHONY: tar%pkg +PHONY += tar%pkg tar%pkg: $(MAKE) KBUILD_SRC= $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@This part is wrong. $(PHONY) isn't subject to pattern matching, so all targets that match 'tar%pkg' must be listed here. Fortunately, that's only three:
Quoted 1 line
PHONY += tar-pkg targz-pkg tarbz2-pkg
Correct. It is fixed in a later patch were I kill the use of PHONY in this file.
I got replaced by specifying FORCE as a prerequsite.
Sam