Commit 202668ec authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-2.6.18

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-2.6.18:
  gitignore: gitignore quilt's files
  kbuild: always use $(CC) for $(call cc-version)
  kconfig: correct oldconfig for unset choice options
  kbuild: -fno-stack-protector is not good
  kbuild: fix typo in modpost
  kbuild: improve error from file2alias
  kbuild: .gitignore utsrelease.h
  kbuild: version.h and new headers_* targets does not require a kernel config
  kbuild: hardcode value of YACC&LEX for aic7-triple-x
parents a205729e 8ccf2832
...@@ -30,6 +30,11 @@ include/config ...@@ -30,6 +30,11 @@ include/config
include/linux/autoconf.h include/linux/autoconf.h
include/linux/compile.h include/linux/compile.h
include/linux/version.h include/linux/version.h
include/linux/utsrelease.h
# stgit generated dirs # stgit generated dirs
patches-* patches-*
# quilt's files
patches
series
...@@ -310,8 +310,8 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) ...@@ -310,8 +310,8 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common -fno-strict-aliasing -fno-common
# Force gcc to behave correct even for buggy distributions # Force gcc to behave correct even for buggy distributions
CFLAGS += $(call cc-option, -fno-stack-protector-all \ CFLAGS += $(call cc-option, -fno-stack-protector)
-fno-stack-protector)
AFLAGS := -D__ASSEMBLY__ AFLAGS := -D__ASSEMBLY__
# Read KERNELRELEASE from include/config/kernel.release (if it exists) # Read KERNELRELEASE from include/config/kernel.release (if it exists)
...@@ -368,6 +368,7 @@ endif ...@@ -368,6 +368,7 @@ endif
no-dot-config-targets := clean mrproper distclean \ no-dot-config-targets := clean mrproper distclean \
cscope TAGS tags help %docs check% \ cscope TAGS tags help %docs check% \
include/linux/version.h headers_% \
kernelrelease kernelversion kernelrelease kernelversion
config-targets := 0 config-targets := 0
......
...@@ -14,6 +14,8 @@ LIBS= -ldb ...@@ -14,6 +14,8 @@ LIBS= -ldb
clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG) clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
# Override default kernel CFLAGS. This is a userland app. # Override default kernel CFLAGS. This is a userland app.
AICASM_CFLAGS:= -I/usr/include -I. AICASM_CFLAGS:= -I/usr/include -I.
LEX= flex
YACC= bison
YFLAGS= -d YFLAGS= -d
NOMAN= noman NOMAN= noman
......
...@@ -77,8 +77,7 @@ cc-option-align = $(subst -functions=0,,\ ...@@ -77,8 +77,7 @@ cc-option-align = $(subst -functions=0,,\
# cc-version # cc-version
# Usage gcc-ver := $(call cc-version, $(CC)) # Usage gcc-ver := $(call cc-version, $(CC))
cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \ cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
$(if $(1), $(1), $(CC)))
# cc-ifversion # cc-ifversion
# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
......
...@@ -40,7 +40,7 @@ include scripts/Kbuild.include ...@@ -40,7 +40,7 @@ include scripts/Kbuild.include
include scripts/Makefile.lib include scripts/Makefile.lib
kernelsymfile := $(objtree)/Module.symvers kernelsymfile := $(objtree)/Module.symvers
modulesymfile := $(KBUILD_EXTMOD)/Modules.symvers modulesymfile := $(KBUILD_EXTMOD)/Module.symvers
# Step 1), find all modules listed in $(MODVERDIR)/ # Step 1), find all modules listed in $(MODVERDIR)/
__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
......
...@@ -357,7 +357,7 @@ int conf_read(const char *name) ...@@ -357,7 +357,7 @@ int conf_read(const char *name)
for (e = prop->expr; e; e = e->left.expr) for (e = prop->expr; e; e = e->left.expr)
if (e->right.sym->visible != no) if (e->right.sym->visible != no)
flags &= e->right.sym->flags; flags &= e->right.sym->flags;
sym->flags |= flags & SYMBOL_DEF_USER; sym->flags &= flags | ~SYMBOL_DEF_USER;
} }
sym_change_count += conf_warnings || conf_unsaved; sym_change_count += conf_warnings || conf_unsaved;
......
...@@ -52,6 +52,23 @@ do { \ ...@@ -52,6 +52,23 @@ do { \
sprintf(str + strlen(str), "*"); \ sprintf(str + strlen(str), "*"); \
} while(0) } while(0)
/**
* Check that sizeof(device_id type) are consistent with size of section
* in .o file. If in-consistent then userspace and kernel does not agree
* on actual size which is a bug.
**/
static void device_id_size_check(const char *modname, const char *device_id,
unsigned long size, unsigned long id_size)
{
if (size % id_size || size < id_size) {
fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
"of the size of section __mod_%s_device_table=%lu.\n"
"Fix definition of struct %s_device_id "
"in mod_devicetable.h\n",
modname, device_id, id_size, device_id, size, device_id);
}
}
/* USB is special because the bcdDevice can be matched against a numeric range */ /* USB is special because the bcdDevice can be matched against a numeric range */
/* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */ /* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */
static void do_usb_entry(struct usb_device_id *id, static void do_usb_entry(struct usb_device_id *id,
...@@ -152,10 +169,8 @@ static void do_usb_table(void *symval, unsigned long size, ...@@ -152,10 +169,8 @@ static void do_usb_table(void *symval, unsigned long size,
unsigned int i; unsigned int i;
const unsigned long id_size = sizeof(struct usb_device_id); const unsigned long id_size = sizeof(struct usb_device_id);
if (size % id_size || size < id_size) { device_id_size_check(mod->name, "usb", size, id_size);
warn("%s ids %lu bad size "
"(each on %lu)\n", mod->name, size, id_size);
}
/* Leave last one: it's the terminator. */ /* Leave last one: it's the terminator. */
size -= id_size; size -= id_size;
...@@ -434,6 +449,7 @@ static inline int sym_is(const char *symbol, const char *name) ...@@ -434,6 +449,7 @@ static inline int sym_is(const char *symbol, const char *name)
static void do_table(void *symval, unsigned long size, static void do_table(void *symval, unsigned long size,
unsigned long id_size, unsigned long id_size,
const char *device_id,
void *function, void *function,
struct module *mod) struct module *mod)
{ {
...@@ -441,10 +457,7 @@ static void do_table(void *symval, unsigned long size, ...@@ -441,10 +457,7 @@ static void do_table(void *symval, unsigned long size,
char alias[500]; char alias[500];
int (*do_entry)(const char *, void *entry, char *alias) = function; int (*do_entry)(const char *, void *entry, char *alias) = function;
if (size % id_size || size < id_size) { device_id_size_check(mod->name, device_id, size, id_size);
warn("%s ids %lu bad size "
"(each on %lu)\n", mod->name, size, id_size);
}
/* Leave last one: it's the terminator. */ /* Leave last one: it's the terminator. */
size -= id_size; size -= id_size;
...@@ -476,40 +489,51 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, ...@@ -476,40 +489,51 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
+ sym->st_value; + sym->st_value;
if (sym_is(symname, "__mod_pci_device_table")) if (sym_is(symname, "__mod_pci_device_table"))
do_table(symval, sym->st_size, sizeof(struct pci_device_id), do_table(symval, sym->st_size,
sizeof(struct pci_device_id), "pci",
do_pci_entry, mod); do_pci_entry, mod);
else if (sym_is(symname, "__mod_usb_device_table")) else if (sym_is(symname, "__mod_usb_device_table"))
/* special case to handle bcdDevice ranges */ /* special case to handle bcdDevice ranges */
do_usb_table(symval, sym->st_size, mod); do_usb_table(symval, sym->st_size, mod);
else if (sym_is(symname, "__mod_ieee1394_device_table")) else if (sym_is(symname, "__mod_ieee1394_device_table"))
do_table(symval, sym->st_size, sizeof(struct ieee1394_device_id), do_table(symval, sym->st_size,
sizeof(struct ieee1394_device_id), "ieee1394",
do_ieee1394_entry, mod); do_ieee1394_entry, mod);
else if (sym_is(symname, "__mod_ccw_device_table")) else if (sym_is(symname, "__mod_ccw_device_table"))
do_table(symval, sym->st_size, sizeof(struct ccw_device_id), do_table(symval, sym->st_size,
sizeof(struct ccw_device_id), "ccw",
do_ccw_entry, mod); do_ccw_entry, mod);
else if (sym_is(symname, "__mod_serio_device_table")) else if (sym_is(symname, "__mod_serio_device_table"))
do_table(symval, sym->st_size, sizeof(struct serio_device_id), do_table(symval, sym->st_size,
sizeof(struct serio_device_id), "serio",
do_serio_entry, mod); do_serio_entry, mod);
else if (sym_is(symname, "__mod_pnp_device_table")) else if (sym_is(symname, "__mod_pnp_device_table"))
do_table(symval, sym->st_size, sizeof(struct pnp_device_id), do_table(symval, sym->st_size,
sizeof(struct pnp_device_id), "pnp",
do_pnp_entry, mod); do_pnp_entry, mod);
else if (sym_is(symname, "__mod_pnp_card_device_table")) else if (sym_is(symname, "__mod_pnp_card_device_table"))
do_table(symval, sym->st_size, sizeof(struct pnp_card_device_id), do_table(symval, sym->st_size,
sizeof(struct pnp_card_device_id), "pnp_card",
do_pnp_card_entry, mod); do_pnp_card_entry, mod);
else if (sym_is(symname, "__mod_pcmcia_device_table")) else if (sym_is(symname, "__mod_pcmcia_device_table"))
do_table(symval, sym->st_size, sizeof(struct pcmcia_device_id), do_table(symval, sym->st_size,
sizeof(struct pcmcia_device_id), "pcmcia",
do_pcmcia_entry, mod); do_pcmcia_entry, mod);
else if (sym_is(symname, "__mod_of_device_table")) else if (sym_is(symname, "__mod_of_device_table"))
do_table(symval, sym->st_size, sizeof(struct of_device_id), do_table(symval, sym->st_size,
sizeof(struct of_device_id), "of",
do_of_entry, mod); do_of_entry, mod);
else if (sym_is(symname, "__mod_vio_device_table")) else if (sym_is(symname, "__mod_vio_device_table"))
do_table(symval, sym->st_size, sizeof(struct vio_device_id), do_table(symval, sym->st_size,
sizeof(struct vio_device_id), "vio",
do_vio_entry, mod); do_vio_entry, mod);
else if (sym_is(symname, "__mod_i2c_device_table")) else if (sym_is(symname, "__mod_i2c_device_table"))
do_table(symval, sym->st_size, sizeof(struct i2c_device_id), do_table(symval, sym->st_size,
sizeof(struct i2c_device_id), "i2c",
do_i2c_entry, mod); do_i2c_entry, mod);
else if (sym_is(symname, "__mod_input_device_table")) else if (sym_is(symname, "__mod_input_device_table"))
do_table(symval, sym->st_size, sizeof(struct input_device_id), do_table(symval, sym->st_size,
sizeof(struct input_device_id), "input",
do_input_entry, mod); do_input_entry, mod);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment