aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Kbuild.include7
-rw-r--r--scripts/gcc-x86_64-has-stack-protector.sh6
-rw-r--r--scripts/mod/file2alias.c12
3 files changed, 25 insertions, 0 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 3d523899fd..4f5ff19b99 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -63,6 +63,13 @@ as-option = $(shell if $(CC) $(CFLAGS) $(1) -Wa,-Z -c -o /dev/null \
63 -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; \ 63 -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; \
64 else echo "$(2)"; fi ;) 64 else echo "$(2)"; fi ;)
65 65
66# as-instr
67# Usage: cflags-y += $(call as-instr, instr, option1, option2)
68
69as-instr = $(shell if echo -e "$(1)" | $(AS) >/dev/null 2>&1 -W -Z -o astest$$$$.out ; \
70 then echo "$(2)"; else echo "$(3)"; fi; \
71 rm -f astest$$$$.out)
72
66# cc-option 73# cc-option
67# Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586) 74# Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586)
68 75
diff --git a/scripts/gcc-x86_64-has-stack-protector.sh b/scripts/gcc-x86_64-has-stack-protector.sh
new file mode 100644
index 0000000000..325c0a1b03
--- /dev/null
+++ b/scripts/gcc-x86_64-has-stack-protector.sh
@@ -0,0 +1,6 @@
1#!/bin/sh
2
3echo "int foo(void) { char X[200]; return 3; }" | $1 -S -xc -c -O0 -mcmodel=kernel -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
4if [ "$?" -eq "0" ] ; then
5 echo $2
6fi
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index de76da8044..f61c9ccef6 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -444,6 +444,14 @@ static int do_input_entry(const char *filename, struct input_device_id *id,
444 return 1; 444 return 1;
445} 445}
446 446
447static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa,
448 char *alias)
449{
450 if (eisa->sig[0])
451 sprintf(alias, EISA_DEVICE_MODALIAS_FMT "*", eisa->sig);
452 return 1;
453}
454
447/* Ignore any prefix, eg. v850 prepends _ */ 455/* Ignore any prefix, eg. v850 prepends _ */
448static inline int sym_is(const char *symbol, const char *name) 456static inline int sym_is(const char *symbol, const char *name)
449{ 457{
@@ -547,6 +555,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
547 do_table(symval, sym->st_size, 555 do_table(symval, sym->st_size,
548 sizeof(struct input_device_id), "input", 556 sizeof(struct input_device_id), "input",
549 do_input_entry, mod); 557 do_input_entry, mod);
558 else if (sym_is(symname, "__mod_eisa_device_table"))
559 do_table(symval, sym->st_size,
560 sizeof(struct eisa_device_id), "eisa",
561 do_eisa_entry, mod);
550} 562}
551 563
552/* Now add out buffered information to the generated C source */ 564/* Now add out buffered information to the generated C source */