Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-2.6.18
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Linus Torvalds committed Aug 3, 2006
2 parents a205729 + 8ccf283 commit 202668e
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 25 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ include/config
include/linux/autoconf.h
include/linux/compile.h
include/linux/version.h
include/linux/utsrelease.h

# stgit generated dirs
patches-*

# quilt's files
patches
series
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common
# Force gcc to behave correct even for buggy distributions
CFLAGS += $(call cc-option, -fno-stack-protector-all \
-fno-stack-protector)
CFLAGS += $(call cc-option, -fno-stack-protector)

AFLAGS := -D__ASSEMBLY__

# Read KERNELRELEASE from include/config/kernel.release (if it exists)
Expand Down Expand Up @@ -368,6 +368,7 @@ endif

no-dot-config-targets := clean mrproper distclean \
cscope TAGS tags help %docs check% \
include/linux/version.h headers_% \
kernelrelease kernelversion

config-targets := 0
Expand Down
2 changes: 2 additions & 0 deletions drivers/scsi/aic7xxx/aicasm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ LIBS= -ldb
clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
# Override default kernel CFLAGS. This is a userland app.
AICASM_CFLAGS:= -I/usr/include -I.
LEX= flex
YACC= bison
YFLAGS= -d

NOMAN= noman
Expand Down
3 changes: 1 addition & 2 deletions scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ cc-option-align = $(subst -functions=0,,\

# cc-version
# Usage gcc-ver := $(call cc-version, $(CC))
cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
$(if $(1), $(1), $(CC)))
cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))

# cc-ifversion
# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.modpost
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ include scripts/Kbuild.include
include scripts/Makefile.lib

kernelsymfile := $(objtree)/Module.symvers
modulesymfile := $(KBUILD_EXTMOD)/Modules.symvers
modulesymfile := $(KBUILD_EXTMOD)/Module.symvers

# Step 1), find all modules listed in $(MODVERDIR)/
__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ int conf_read(const char *name)
for (e = prop->expr; e; e = e->left.expr)
if (e->right.sym->visible != no)
flags &= e->right.sym->flags;
sym->flags |= flags & SYMBOL_DEF_USER;
sym->flags &= flags | ~SYMBOL_DEF_USER;
}

sym_change_count += conf_warnings || conf_unsaved;
Expand Down
62 changes: 43 additions & 19 deletions scripts/mod/file2alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ do { \
sprintf(str + strlen(str), "*"); \
} 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 */
/* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */
static void do_usb_entry(struct usb_device_id *id,
Expand Down Expand Up @@ -152,10 +169,8 @@ static void do_usb_table(void *symval, unsigned long size,
unsigned int i;
const unsigned long id_size = sizeof(struct usb_device_id);

if (size % id_size || size < id_size) {
warn("%s ids %lu bad size "
"(each on %lu)\n", mod->name, size, id_size);
}
device_id_size_check(mod->name, "usb", size, id_size);

/* Leave last one: it's the terminator. */
size -= id_size;

Expand Down Expand Up @@ -434,17 +449,15 @@ static inline int sym_is(const char *symbol, const char *name)

static void do_table(void *symval, unsigned long size,
unsigned long id_size,
const char *device_id,
void *function,
struct module *mod)
{
unsigned int i;
char alias[500];
int (*do_entry)(const char *, void *entry, char *alias) = function;

if (size % id_size || size < id_size) {
warn("%s ids %lu bad size "
"(each on %lu)\n", mod->name, size, id_size);
}
device_id_size_check(mod->name, device_id, size, id_size);
/* Leave last one: it's the terminator. */
size -= id_size;

Expand Down Expand Up @@ -476,40 +489,51 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
+ sym->st_value;

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);
else if (sym_is(symname, "__mod_usb_device_table"))
/* special case to handle bcdDevice ranges */
do_usb_table(symval, sym->st_size, mod);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
}

Expand Down

0 comments on commit 202668e

Please sign in to comment.