diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/.gitignore | 1 | ||||
| -rw-r--r-- | scripts/Kbuild.include | 12 | ||||
| -rw-r--r-- | scripts/Makefile | 7 | ||||
| -rw-r--r-- | scripts/Makefile.asm-generic | 23 | ||||
| -rw-r--r-- | scripts/Makefile.build | 74 | ||||
| -rw-r--r-- | scripts/Makefile.headersinst | 10 | ||||
| -rw-r--r-- | scripts/Makefile.lib | 2 | ||||
| -rw-r--r-- | scripts/basic/.gitignore | 2 | ||||
| -rw-r--r-- | scripts/basic/Makefile | 3 | ||||
| -rw-r--r-- | scripts/docproc.c (renamed from scripts/basic/docproc.c) | 0 | ||||
| -rw-r--r-- | scripts/gen_initramfs_list.sh | 27 | ||||
| -rw-r--r-- | scripts/kallsyms.c | 2 | ||||
| -rwxr-xr-x | scripts/mkcompile_h | 30 |
13 files changed, 130 insertions, 63 deletions
diff --git a/scripts/.gitignore b/scripts/.gitignore index e2741d23bab8..105b21f08185 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore | |||
| @@ -8,3 +8,4 @@ bin2c | |||
| 8 | unifdef | 8 | unifdef |
| 9 | ihex2fw | 9 | ihex2fw |
| 10 | recordmcount | 10 | recordmcount |
| 11 | docproc | ||
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index ed2773edfe71..be39cd1c74cf 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
| @@ -118,6 +118,11 @@ cc-option-yn = $(call try-run,\ | |||
| 118 | cc-option-align = $(subst -functions=0,,\ | 118 | cc-option-align = $(subst -functions=0,,\ |
| 119 | $(call cc-option,-falign-functions=0,-malign-functions=0)) | 119 | $(call cc-option,-falign-functions=0,-malign-functions=0)) |
| 120 | 120 | ||
| 121 | # cc-disable-warning | ||
| 122 | # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) | ||
| 123 | cc-disable-warning = $(call try-run,\ | ||
| 124 | $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -xc /dev/null -o "$$TMP",-Wno-$(strip $(1))) | ||
| 125 | |||
| 121 | # cc-version | 126 | # cc-version |
| 122 | # Usage gcc-ver := $(call cc-version) | 127 | # Usage gcc-ver := $(call cc-version) |
| 123 | cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) | 128 | cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) |
| @@ -141,6 +146,11 @@ cc-ldoption = $(call try-run,\ | |||
| 141 | ld-option = $(call try-run,\ | 146 | ld-option = $(call try-run,\ |
| 142 | $(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) | 147 | $(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) |
| 143 | 148 | ||
| 149 | # ar-option | ||
| 150 | # Usage: KBUILD_ARFLAGS := $(call ar-option,D) | ||
| 151 | # Important: no spaces around options | ||
| 152 | ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2)) | ||
| 153 | |||
| 144 | ###### | 154 | ###### |
| 145 | 155 | ||
| 146 | ### | 156 | ### |
| @@ -187,6 +197,8 @@ ifneq ($(KBUILD_NOCMDDEP),1) | |||
| 187 | # User may override this check using make KBUILD_NOCMDDEP=1 | 197 | # User may override this check using make KBUILD_NOCMDDEP=1 |
| 188 | arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ | 198 | arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ |
| 189 | $(filter-out $(cmd_$@), $(cmd_$(1))) ) | 199 | $(filter-out $(cmd_$@), $(cmd_$(1))) ) |
| 200 | else | ||
| 201 | arg-check = $(if $(strip $(cmd_$@)),,1) | ||
| 190 | endif | 202 | endif |
| 191 | 203 | ||
| 192 | # >'< substitution is for echo to work, | 204 | # >'< substitution is for echo to work, |
diff --git a/scripts/Makefile b/scripts/Makefile index fcea26168bca..df7678febf27 100644 --- a/scripts/Makefile +++ b/scripts/Makefile | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | # pnmttologo: Convert pnm files to logo files | 6 | # pnmttologo: Convert pnm files to logo files |
| 7 | # conmakehash: Create chartable | 7 | # conmakehash: Create chartable |
| 8 | # conmakehash: Create arrays for initializing the kernel console tables | 8 | # conmakehash: Create arrays for initializing the kernel console tables |
| 9 | # docproc: Used in Documentation/DocBook | ||
| 9 | 10 | ||
| 10 | hostprogs-$(CONFIG_KALLSYMS) += kallsyms | 11 | hostprogs-$(CONFIG_KALLSYMS) += kallsyms |
| 11 | hostprogs-$(CONFIG_LOGO) += pnmtologo | 12 | hostprogs-$(CONFIG_LOGO) += pnmtologo |
| @@ -16,12 +17,14 @@ hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount | |||
| 16 | always := $(hostprogs-y) $(hostprogs-m) | 17 | always := $(hostprogs-y) $(hostprogs-m) |
| 17 | 18 | ||
| 18 | # The following hostprogs-y programs are only build on demand | 19 | # The following hostprogs-y programs are only build on demand |
| 19 | hostprogs-y += unifdef | 20 | hostprogs-y += unifdef docproc |
| 20 | 21 | ||
| 21 | # This target is used internally to avoid "is up to date" messages | 22 | # These targets are used internally to avoid "is up to date" messages |
| 22 | PHONY += build_unifdef | 23 | PHONY += build_unifdef |
| 23 | build_unifdef: scripts/unifdef FORCE | 24 | build_unifdef: scripts/unifdef FORCE |
| 24 | @: | 25 | @: |
| 26 | build_docproc: scripts/docproc FORCE | ||
| 27 | @: | ||
| 25 | 28 | ||
| 26 | subdir-$(CONFIG_MODVERSIONS) += genksyms | 29 | subdir-$(CONFIG_MODVERSIONS) += genksyms |
| 27 | subdir-y += mod | 30 | subdir-y += mod |
diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic new file mode 100644 index 000000000000..490122c3e2aa --- /dev/null +++ b/scripts/Makefile.asm-generic | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | # include/asm-generic contains a lot of files that are used | ||
| 2 | # verbatim by several architectures. | ||
| 3 | # | ||
| 4 | # This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild | ||
| 5 | # and for each file listed in this file with generic-y creates | ||
| 6 | # a small wrapper file in $(obj) (arch/$(SRCARCH)/include/generated/asm) | ||
| 7 | |||
| 8 | kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild | ||
| 9 | -include $(kbuild-file) | ||
| 10 | |||
| 11 | include scripts/Kbuild.include | ||
| 12 | |||
| 13 | # Create output directory if not already present | ||
| 14 | _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) | ||
| 15 | |||
| 16 | quiet_cmd_wrap = WRAP $@ | ||
| 17 | cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ | ||
| 18 | |||
| 19 | all: $(patsubst %, $(obj)/%, $(generic-y)) | ||
| 20 | |||
| 21 | $(obj)/%.h: | ||
| 22 | $(call cmd,wrap) | ||
| 23 | |||
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 6165622c3e29..a0fd5029cfe7 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -51,36 +51,52 @@ ifeq ($(KBUILD_NOPEDANTIC),) | |||
| 51 | endif | 51 | endif |
| 52 | 52 | ||
| 53 | # | 53 | # |
| 54 | # make W=1 settings | 54 | # make W=... settings |
| 55 | # | 55 | # |
| 56 | # $(call cc-option... ) handles gcc -W.. options which | 56 | # W=1 - warnings that may be relevant and does not occur too often |
| 57 | # W=2 - warnings that occur quite often but may still be relevant | ||
| 58 | # W=3 - the more obscure warnings, can most likely be ignored | ||
| 59 | # | ||
| 60 | # $(call cc-option, -W...) handles gcc -W.. options which | ||
| 57 | # are not supported by all versions of the compiler | 61 | # are not supported by all versions of the compiler |
| 58 | ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS | 62 | ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS |
| 59 | KBUILD_EXTRA_WARNINGS := -Wextra | 63 | warning- := $(empty) |
| 60 | KBUILD_EXTRA_WARNINGS += -Wunused -Wno-unused-parameter | 64 | |
| 61 | KBUILD_EXTRA_WARNINGS += -Waggregate-return | 65 | warning-1 := -Wextra -Wunused -Wno-unused-parameter |
| 62 | KBUILD_EXTRA_WARNINGS += -Wbad-function-cast | 66 | warning-1 += -Wmissing-declarations |
| 63 | KBUILD_EXTRA_WARNINGS += -Wcast-qual | 67 | warning-1 += -Wmissing-format-attribute |
| 64 | KBUILD_EXTRA_WARNINGS += -Wcast-align | 68 | warning-1 += -Wmissing-prototypes |
| 65 | KBUILD_EXTRA_WARNINGS += -Wconversion | 69 | warning-1 += -Wold-style-definition |
| 66 | KBUILD_EXTRA_WARNINGS += -Wdisabled-optimization | 70 | warning-1 += $(call cc-option, -Wmissing-include-dirs) |
| 67 | KBUILD_EXTRA_WARNINGS += -Wlogical-op | 71 | warning-1 += $(call cc-option, -Wunused-but-set-variable) |
| 68 | KBUILD_EXTRA_WARNINGS += -Wmissing-declarations | 72 | |
| 69 | KBUILD_EXTRA_WARNINGS += -Wmissing-format-attribute | 73 | warning-2 := -Waggregate-return |
| 70 | KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wmissing-include-dirs,) | 74 | warning-2 += -Wcast-align |
| 71 | KBUILD_EXTRA_WARNINGS += -Wmissing-prototypes | 75 | warning-2 += -Wdisabled-optimization |
| 72 | KBUILD_EXTRA_WARNINGS += -Wnested-externs | 76 | warning-2 += -Wnested-externs |
| 73 | KBUILD_EXTRA_WARNINGS += -Wold-style-definition | 77 | warning-2 += -Wshadow |
| 74 | KBUILD_EXTRA_WARNINGS += $(call cc-option, -Woverlength-strings,) | 78 | warning-2 += $(call cc-option, -Wlogical-op) |
| 75 | KBUILD_EXTRA_WARNINGS += -Wpacked | 79 | |
| 76 | KBUILD_EXTRA_WARNINGS += -Wpacked-bitfield-compat | 80 | warning-3 := -Wbad-function-cast |
| 77 | KBUILD_EXTRA_WARNINGS += -Wpadded | 81 | warning-3 += -Wcast-qual |
| 78 | KBUILD_EXTRA_WARNINGS += -Wpointer-arith | 82 | warning-3 += -Wconversion |
| 79 | KBUILD_EXTRA_WARNINGS += -Wredundant-decls | 83 | warning-3 += -Wpacked |
| 80 | KBUILD_EXTRA_WARNINGS += -Wshadow | 84 | warning-3 += -Wpadded |
| 81 | KBUILD_EXTRA_WARNINGS += -Wswitch-default | 85 | warning-3 += -Wpointer-arith |
| 82 | KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wvla,) | 86 | warning-3 += -Wredundant-decls |
| 83 | KBUILD_CFLAGS += $(KBUILD_EXTRA_WARNINGS) | 87 | warning-3 += -Wswitch-default |
| 88 | warning-3 += $(call cc-option, -Wpacked-bitfield-compat) | ||
| 89 | warning-3 += $(call cc-option, -Wvla) | ||
| 90 | |||
| 91 | warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
| 92 | warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
| 93 | warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
| 94 | |||
| 95 | ifeq ("$(strip $(warning))","") | ||
| 96 | $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown) | ||
| 97 | endif | ||
| 98 | |||
| 99 | KBUILD_CFLAGS += $(warning) | ||
| 84 | endif | 100 | endif |
| 85 | 101 | ||
| 86 | include scripts/Makefile.lib | 102 | include scripts/Makefile.lib |
| @@ -351,7 +367,7 @@ quiet_cmd_link_o_target = LD $@ | |||
| 351 | cmd_link_o_target = $(if $(strip $(obj-y)),\ | 367 | cmd_link_o_target = $(if $(strip $(obj-y)),\ |
| 352 | $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \ | 368 | $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \ |
| 353 | $(cmd_secanalysis),\ | 369 | $(cmd_secanalysis),\ |
| 354 | rm -f $@; $(AR) rcs $@) | 370 | rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@) |
| 355 | 371 | ||
| 356 | $(builtin-target): $(obj-y) FORCE | 372 | $(builtin-target): $(obj-y) FORCE |
| 357 | $(call if_changed,link_o_target) | 373 | $(call if_changed,link_o_target) |
| @@ -377,7 +393,7 @@ $(modorder-target): $(subdir-ym) FORCE | |||
| 377 | # | 393 | # |
| 378 | ifdef lib-target | 394 | ifdef lib-target |
| 379 | quiet_cmd_link_l_target = AR $@ | 395 | quiet_cmd_link_l_target = AR $@ |
| 380 | cmd_link_l_target = rm -f $@; $(AR) rcs $@ $(lib-y) | 396 | cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y) |
| 381 | 397 | ||
| 382 | $(lib-target): $(lib-y) FORCE | 398 | $(lib-target): $(lib-y) FORCE |
| 383 | $(call if_changed,link_l_target) | 399 | $(call if_changed,link_l_target) |
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index f89cb87f5c01..a57f5bd5a13d 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst | |||
| @@ -27,8 +27,13 @@ header-y := $(filter-out %/, $(header-y)) | |||
| 27 | install-file := $(install)/.install | 27 | install-file := $(install)/.install |
| 28 | check-file := $(install)/.check | 28 | check-file := $(install)/.check |
| 29 | 29 | ||
| 30 | # generic-y list all files an architecture uses from asm-generic | ||
| 31 | # Use this to build a list of headers which require a wrapper | ||
| 32 | wrapper-files := $(filter $(header-y), $(generic-y)) | ||
| 33 | |||
| 30 | # all headers files for this dir | 34 | # all headers files for this dir |
| 31 | all-files := $(header-y) $(objhdr-y) | 35 | header-y := $(filter-out $(generic-y), $(header-y)) |
| 36 | all-files := $(header-y) $(objhdr-y) $(wrapper-files) | ||
| 32 | input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \ | 37 | input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \ |
| 33 | $(addprefix $(objtree)/$(obj)/,$(objhdr-y)) | 38 | $(addprefix $(objtree)/$(obj)/,$(objhdr-y)) |
| 34 | output-files := $(addprefix $(install)/, $(all-files)) | 39 | output-files := $(addprefix $(install)/, $(all-files)) |
| @@ -47,6 +52,9 @@ quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ | |||
| 47 | cmd_install = \ | 52 | cmd_install = \ |
| 48 | $(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \ | 53 | $(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \ |
| 49 | $(PERL) $< $(objtree)/$(obj) $(install) $(SRCARCH) $(objhdr-y); \ | 54 | $(PERL) $< $(objtree)/$(obj) $(install) $(SRCARCH) $(objhdr-y); \ |
| 55 | for F in $(wrapper-files); do \ | ||
| 56 | echo "\#include <asm-generic/$$F>" > $(install)/$$F; \ | ||
| 57 | done; \ | ||
| 50 | touch $@ | 58 | touch $@ |
| 51 | 59 | ||
| 52 | quiet_cmd_remove = REMOVE $(unwanted) | 60 | quiet_cmd_remove = REMOVE $(unwanted) |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 1c702ca8aac8..93b2b5938a2e 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
| @@ -197,7 +197,7 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ | |||
| 197 | # --------------------------------------------------------------------------- | 197 | # --------------------------------------------------------------------------- |
| 198 | 198 | ||
| 199 | quiet_cmd_gzip = GZIP $@ | 199 | quiet_cmd_gzip = GZIP $@ |
| 200 | cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \ | 200 | cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \ |
| 201 | (rm -f $@ ; false) | 201 | (rm -f $@ ; false) |
| 202 | 202 | ||
| 203 | # DTC | 203 | # DTC |
diff --git a/scripts/basic/.gitignore b/scripts/basic/.gitignore index bf8b199ec598..a776371a3502 100644 --- a/scripts/basic/.gitignore +++ b/scripts/basic/.gitignore | |||
| @@ -1,3 +1 @@ | |||
| 1 | hash | ||
| 2 | fixdep | fixdep | |
| 3 | docproc | ||
diff --git a/scripts/basic/Makefile b/scripts/basic/Makefile index 4c324a1f1e0e..4fcef87bb875 100644 --- a/scripts/basic/Makefile +++ b/scripts/basic/Makefile | |||
| @@ -7,9 +7,8 @@ | |||
| 7 | # .config is included by main Makefile. | 7 | # .config is included by main Makefile. |
| 8 | # --------------------------------------------------------------------------- | 8 | # --------------------------------------------------------------------------- |
| 9 | # fixdep: Used to generate dependency information during build process | 9 | # fixdep: Used to generate dependency information during build process |
| 10 | # docproc: Used in Documentation/DocBook | ||
| 11 | 10 | ||
| 12 | hostprogs-y := fixdep docproc | 11 | hostprogs-y := fixdep |
| 13 | always := $(hostprogs-y) | 12 | always := $(hostprogs-y) |
| 14 | 13 | ||
| 15 | # fixdep is needed to compile other host programs | 14 | # fixdep is needed to compile other host programs |
diff --git a/scripts/basic/docproc.c b/scripts/docproc.c index 98dec87974d0..98dec87974d0 100644 --- a/scripts/basic/docproc.c +++ b/scripts/docproc.c | |||
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh index e12b1a7525cf..b482f162a18a 100644 --- a/scripts/gen_initramfs_list.sh +++ b/scripts/gen_initramfs_list.sh | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/sh |
| 2 | # Copyright (C) Martin Schlemmer <azarah@nosferatu.za.org> | 2 | # Copyright (C) Martin Schlemmer <azarah@nosferatu.za.org> |
| 3 | # Copyright (C) 2006 Sam Ravnborg <sam@ravnborg.org> | 3 | # Copyright (C) 2006 Sam Ravnborg <sam@ravnborg.org> |
| 4 | # | 4 | # |
| @@ -105,9 +105,9 @@ list_parse() { | |||
| 105 | # for links, devices etc the format differs. See gen_init_cpio for details | 105 | # for links, devices etc the format differs. See gen_init_cpio for details |
| 106 | parse() { | 106 | parse() { |
| 107 | local location="$1" | 107 | local location="$1" |
| 108 | local name="${location/${srcdir}//}" | 108 | local name="/${location#${srcdir}}" |
| 109 | # change '//' into '/' | 109 | # change '//' into '/' |
| 110 | name="${name//\/\///}" | 110 | name=$(echo "$name" | sed -e 's://*:/:g') |
| 111 | local mode="$2" | 111 | local mode="$2" |
| 112 | local uid="$3" | 112 | local uid="$3" |
| 113 | local gid="$4" | 113 | local gid="$4" |
| @@ -117,8 +117,8 @@ parse() { | |||
| 117 | [ "$root_gid" = "squash" ] && gid=0 || [ "$gid" -eq "$root_gid" ] && gid=0 | 117 | [ "$root_gid" = "squash" ] && gid=0 || [ "$gid" -eq "$root_gid" ] && gid=0 |
| 118 | local str="${mode} ${uid} ${gid}" | 118 | local str="${mode} ${uid} ${gid}" |
| 119 | 119 | ||
| 120 | [ "${ftype}" == "invalid" ] && return 0 | 120 | [ "${ftype}" = "invalid" ] && return 0 |
| 121 | [ "${location}" == "${srcdir}" ] && return 0 | 121 | [ "${location}" = "${srcdir}" ] && return 0 |
| 122 | 122 | ||
| 123 | case "${ftype}" in | 123 | case "${ftype}" in |
| 124 | "file") | 124 | "file") |
| @@ -192,7 +192,7 @@ input_file() { | |||
| 192 | if [ -f "$1" ]; then | 192 | if [ -f "$1" ]; then |
| 193 | ${dep_list}header "$1" | 193 | ${dep_list}header "$1" |
| 194 | is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\?/cpio/')" | 194 | is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\?/cpio/')" |
| 195 | if [ $2 -eq 0 -a ${is_cpio} == "cpio" ]; then | 195 | if [ $2 -eq 0 -a ${is_cpio} = "cpio" ]; then |
| 196 | cpio_file=$1 | 196 | cpio_file=$1 |
| 197 | echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed" | 197 | echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed" |
| 198 | [ ! -z ${dep_list} ] && echo "$1" | 198 | [ ! -z ${dep_list} ] && echo "$1" |
| @@ -204,7 +204,7 @@ input_file() { | |||
| 204 | else | 204 | else |
| 205 | echo "$1 \\" | 205 | echo "$1 \\" |
| 206 | cat "$1" | while read type dir file perm ; do | 206 | cat "$1" | while read type dir file perm ; do |
| 207 | if [ "$type" == "file" ]; then | 207 | if [ "$type" = "file" ]; then |
| 208 | echo "$file \\"; | 208 | echo "$file \\"; |
| 209 | fi | 209 | fi |
| 210 | done | 210 | done |
| @@ -226,7 +226,7 @@ cpio_list= | |||
| 226 | output="/dev/stdout" | 226 | output="/dev/stdout" |
| 227 | output_file="" | 227 | output_file="" |
| 228 | is_cpio_compressed= | 228 | is_cpio_compressed= |
| 229 | compr="gzip -9 -f" | 229 | compr="gzip -n -9 -f" |
| 230 | 230 | ||
| 231 | arg="$1" | 231 | arg="$1" |
| 232 | case "$arg" in | 232 | case "$arg" in |
| @@ -240,7 +240,7 @@ case "$arg" in | |||
| 240 | output_file="$1" | 240 | output_file="$1" |
| 241 | cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)" | 241 | cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)" |
| 242 | output=${cpio_list} | 242 | output=${cpio_list} |
| 243 | echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f" | 243 | echo "$output_file" | grep -q "\.gz$" && compr="gzip -n -9 -f" |
| 244 | echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f" | 244 | echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f" |
| 245 | echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" | 245 | echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" |
| 246 | echo "$output_file" | grep -q "\.xz$" && \ | 246 | echo "$output_file" | grep -q "\.xz$" && \ |
| @@ -287,8 +287,15 @@ done | |||
| 287 | # we are careful to delete tmp files | 287 | # we are careful to delete tmp files |
| 288 | if [ ! -z ${output_file} ]; then | 288 | if [ ! -z ${output_file} ]; then |
| 289 | if [ -z ${cpio_file} ]; then | 289 | if [ -z ${cpio_file} ]; then |
| 290 | timestamp= | ||
| 291 | if test -n "$KBUILD_BUILD_TIMESTAMP"; then | ||
| 292 | timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s || :)" | ||
| 293 | if test -n "$timestamp"; then | ||
| 294 | timestamp="-t $timestamp" | ||
| 295 | fi | ||
| 296 | fi | ||
| 290 | cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)" | 297 | cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)" |
| 291 | usr/gen_init_cpio ${cpio_list} > ${cpio_tfile} | 298 | usr/gen_init_cpio $timestamp ${cpio_list} > ${cpio_tfile} |
| 292 | else | 299 | else |
| 293 | cpio_tfile=${cpio_file} | 300 | cpio_tfile=${cpio_file} |
| 294 | fi | 301 | fi |
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 60dd3eb9366e..487ac6f37ca2 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c | |||
| @@ -500,6 +500,8 @@ static void optimize_result(void) | |||
| 500 | 500 | ||
| 501 | /* find the token with the breates profit value */ | 501 | /* find the token with the breates profit value */ |
| 502 | best = find_best_token(); | 502 | best = find_best_token(); |
| 503 | if (token_profit[best] == 0) | ||
| 504 | break; | ||
| 503 | 505 | ||
| 504 | /* place it in the "best" table */ | 506 | /* place it in the "best" table */ |
| 505 | best_table_len[i] = 2; | 507 | best_table_len[i] = 2; |
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 50ad317a4bf9..f221ddf69080 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h | |||
| @@ -42,6 +42,16 @@ if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then | |||
| 42 | else | 42 | else |
| 43 | TIMESTAMP=$KBUILD_BUILD_TIMESTAMP | 43 | TIMESTAMP=$KBUILD_BUILD_TIMESTAMP |
| 44 | fi | 44 | fi |
| 45 | if test -z "$KBUILD_BUILD_USER"; then | ||
| 46 | LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/') | ||
| 47 | else | ||
| 48 | LINUX_COMPILE_BY=$KBUILD_BUILD_USER | ||
| 49 | fi | ||
| 50 | if test -z "$KBUILD_BUILD_HOST"; then | ||
| 51 | LINUX_COMPILE_HOST=`hostname` | ||
| 52 | else | ||
| 53 | LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST | ||
| 54 | fi | ||
| 45 | 55 | ||
| 46 | UTS_VERSION="#$VERSION" | 56 | UTS_VERSION="#$VERSION" |
| 47 | CONFIG_FLAGS="" | 57 | CONFIG_FLAGS="" |
| @@ -63,20 +73,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" | |||
| 63 | 73 | ||
| 64 | echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" | 74 | echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" |
| 65 | 75 | ||
| 66 | echo \#define LINUX_COMPILE_TIME \"`date +%T`\" | 76 | echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\" |
| 67 | echo \#define LINUX_COMPILE_BY \"`whoami`\" | 77 | echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" |
| 68 | echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\" | ||
| 69 | |||
| 70 | domain=`dnsdomainname 2> /dev/null` | ||
| 71 | if [ -z "$domain" ]; then | ||
| 72 | domain=`domainname 2> /dev/null` | ||
| 73 | fi | ||
| 74 | |||
| 75 | if [ -n "$domain" ]; then | ||
| 76 | echo \#define LINUX_COMPILE_DOMAIN \"`echo $domain | $UTS_TRUNCATE`\" | ||
| 77 | else | ||
| 78 | echo \#define LINUX_COMPILE_DOMAIN | ||
| 79 | fi | ||
| 80 | 78 | ||
| 81 | echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" | 79 | echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" |
| 82 | ) > .tmpcompile | 80 | ) > .tmpcompile |
| @@ -91,8 +89,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" | |||
| 91 | # first line. | 89 | # first line. |
| 92 | 90 | ||
| 93 | if [ -r $TARGET ] && \ | 91 | if [ -r $TARGET ] && \ |
| 94 | grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' $TARGET > .tmpver.1 && \ | 92 | grep -v 'UTS_VERSION' $TARGET > .tmpver.1 && \ |
| 95 | grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' .tmpcompile > .tmpver.2 && \ | 93 | grep -v 'UTS_VERSION' .tmpcompile > .tmpver.2 && \ |
| 96 | cmp -s .tmpver.1 .tmpver.2; then | 94 | cmp -s .tmpver.1 .tmpver.2; then |
| 97 | rm -f .tmpcompile | 95 | rm -f .tmpcompile |
| 98 | else | 96 | else |
