summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-02-09 16:05:50 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-02-09 16:05:50 -0800
commit89a47dd1af8fdda667938ec190d9595d55d7ec6f (patch)
tree9d52cfbcfc49ee7b45ce530e7b9754a6380c0832 /scripts
parent380a129eb2c20d4b7b5be744e80e2ec18b24220b (diff)
parentf566e1fbadb686e28f1c307e356114b2865ef588 (diff)
downloadlinux-89a47dd1af8fdda667938ec190d9595d55d7ec6f.tar.gz
linux-89a47dd1af8fdda667938ec190d9595d55d7ec6f.tar.bz2
linux-89a47dd1af8fdda667938ec190d9595d55d7ec6f.zip
Merge tag 'kbuild-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild updates from Masahiro Yamada: - fix randconfig to generate a sane .config - rename hostprogs-y / always to hostprogs / always-y, which are more natual syntax. - optimize scripts/kallsyms - fix yes2modconfig and mod2yesconfig - make multiple directory targets ('make foo/ bar/') work * tag 'kbuild-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: make multiple directory targets work kconfig: Invalidate all symbols after changing to y or m. kallsyms: fix type of kallsyms_token_table[] scripts/kallsyms: change table to store (strcut sym_entry *) scripts/kallsyms: rename local variables in read_symbol() kbuild: rename hostprogs-y/always to hostprogs/always-y kbuild: fix the document to use extra-y for vmlinux.lds kconfig: fix broken dependency in randconfig-generated .config
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile22
-rw-r--r--scripts/Makefile.build8
-rw-r--r--scripts/Makefile.clean4
-rw-r--r--scripts/Makefile.host8
-rw-r--r--scripts/Makefile.lib6
-rw-r--r--scripts/basic/Makefile4
-rw-r--r--scripts/dtc/Makefile4
-rw-r--r--scripts/gcc-plugins/Makefile2
-rw-r--r--scripts/genksyms/Makefile4
-rw-r--r--scripts/kallsyms.c133
-rw-r--r--scripts/kconfig/Makefile10
-rw-r--r--scripts/kconfig/confdata.c7
-rw-r--r--scripts/mod/Makefile4
-rw-r--r--scripts/selinux/genheaders/Makefile4
-rw-r--r--scripts/selinux/mdp/Makefile4
15 files changed, 119 insertions, 105 deletions
diff --git a/scripts/Makefile b/scripts/Makefile
index 4d41f48e7376..5e75802b1a44 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -7,14 +7,14 @@
HOST_EXTRACFLAGS += -I$(srctree)/tools/include
-hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c
-hostprogs-$(CONFIG_KALLSYMS) += kallsyms
-hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount
-hostprogs-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
-hostprogs-$(CONFIG_ASN1) += asn1_compiler
-hostprogs-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
-hostprogs-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
-hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
+always-$(CONFIG_BUILD_BIN2C) += bin2c
+always-$(CONFIG_KALLSYMS) += kallsyms
+always-$(BUILD_C_RECORDMCOUNT) += recordmcount
+always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
+always-$(CONFIG_ASN1) += asn1_compiler
+always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
+always-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
+always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
@@ -30,10 +30,10 @@ HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED
HOSTLDLIBS_sorttable = -lpthread
endif
-always := $(hostprogs-y) $(hostprogs-m)
+hostprogs := $(always-y) $(always-m)
-# The following hostprogs-y programs are only build on demand
-hostprogs-y += unifdef
+# The following programs are only built on demand
+hostprogs += unifdef
subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
subdir-$(CONFIG_MODVERSIONS) += genksyms
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index a562d695f0fa..a1730d42e5f3 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -16,6 +16,8 @@ obj-m :=
lib-y :=
lib-m :=
always :=
+always-y :=
+always-m :=
targets :=
subdir-y :=
subdir-m :=
@@ -44,7 +46,7 @@ include $(kbuild-file)
include scripts/Makefile.lib
# Do not include host rules unless needed
-ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),)
+ifneq ($(hostprogs)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),)
include scripts/Makefile.host
endif
@@ -348,7 +350,7 @@ $(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE
$(call if_changed_rule,as_o_S)
targets += $(filter-out $(subdir-obj-y), $(real-obj-y)) $(real-obj-m) $(lib-y)
-targets += $(extra-y) $(MAKECMDGOALS) $(always)
+targets += $(extra-y) $(always-y) $(MAKECMDGOALS)
# Linker scripts preprocessor (.lds.S -> .lds)
# ---------------------------------------------------------------------------
@@ -490,7 +492,7 @@ else
__build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
$(if $(KBUILD_MODULES),$(obj-m) $(mod-targets) $(modorder-target)) \
- $(subdir-ym) $(always)
+ $(subdir-ym) $(always-y)
@:
endif
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean
index e367eb95c5c0..1e4206566a82 100644
--- a/scripts/Makefile.clean
+++ b/scripts/Makefile.clean
@@ -28,8 +28,8 @@ subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
# directory
__clean-files := $(extra-y) $(extra-m) $(extra-) \
- $(always) $(targets) $(clean-files) \
- $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
+ $(always) $(always-y) $(always-m) $(always-) $(targets) $(clean-files) \
+ $(hostprogs) $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
$(hostlibs-y) $(hostlibs-m) $(hostlibs-) \
$(hostcxxlibs-y) $(hostcxxlibs-m)
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 4c51c95d40f4..3b7121d43324 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -24,21 +24,21 @@ $(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE
# Both C and C++ are supported, but preferred language is C for such utilities.
#
# Sample syntax (see Documentation/kbuild/makefiles.rst for reference)
-# hostprogs-y := bin2hex
+# hostprogs := bin2hex
# Will compile bin2hex.c and create an executable named bin2hex
#
-# hostprogs-y := lxdialog
+# hostprogs := lxdialog
# lxdialog-objs := checklist.o lxdialog.o
# Will compile lxdialog.c and checklist.c, and then link the executable
# lxdialog, based on checklist.o and lxdialog.o
#
-# hostprogs-y := qconf
+# hostprogs := qconf
# qconf-cxxobjs := qconf.o
# qconf-objs := menu.o
# Will compile qconf as a C++ program, and menu as a C program.
# They are linked as C++ code to the executable qconf
-__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
+__hostprogs := $(sort $(hostprogs))
host-cshlib := $(sort $(hostlibs-y) $(hostlibs-m))
host-cxxshlib := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m))
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index d10f7a03e0ee..bae62549e3d2 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -4,6 +4,8 @@ asflags-y += $(EXTRA_AFLAGS)
ccflags-y += $(EXTRA_CFLAGS)
cppflags-y += $(EXTRA_CPPFLAGS)
ldflags-y += $(EXTRA_LDFLAGS)
+always-y += $(always)
+hostprogs += $(hostprogs-y) $(hostprogs-m)
# flags that take effect in current and sub directories
KBUILD_AFLAGS += $(subdir-asflags-y)
@@ -59,6 +61,8 @@ subdir-obj-y := $(filter %/built-in.a, $(obj-y))
real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
+always-y += $(always-m)
+
# DTB
# If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built
extra-y += $(dtb-y)
@@ -72,7 +76,7 @@ endif
# Add subdir path
extra-y := $(addprefix $(obj)/,$(extra-y))
-always := $(addprefix $(obj)/,$(always))
+always-y := $(addprefix $(obj)/,$(always-y))
targets := $(addprefix $(obj)/,$(targets))
modorder := $(addprefix $(obj)/,$(modorder))
obj-m := $(addprefix $(obj)/,$(obj-m))
diff --git a/scripts/basic/Makefile b/scripts/basic/Makefile
index 7c9cb80d097b..290dd27d2809 100644
--- a/scripts/basic/Makefile
+++ b/scripts/basic/Makefile
@@ -2,5 +2,5 @@
#
# fixdep: used to generate dependency information during build process
-hostprogs-y := fixdep
-always := $(hostprogs-y)
+hostprogs := fixdep
+always-y := $(hostprogs)
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index b5a5b1c548c9..3acbb410904c 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
# scripts/dtc makefile
-hostprogs-$(CONFIG_DTC) := dtc
-always := $(hostprogs-y)
+hostprogs := dtc
+always-$(CONFIG_DTC) := $(hostprogs)
dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
srcpos.o checks.o util.o
diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile
index aa0d0ec6936d..f2ee8bd7abc6 100644
--- a/scripts/gcc-plugins/Makefile
+++ b/scripts/gcc-plugins/Makefile
@@ -23,7 +23,7 @@ $(objtree)/$(obj)/randomize_layout_seed.h: FORCE
targets = randomize_layout_seed.h randomize_layout_hash.h
$(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p)))
-always := $($(HOSTLIBS)-y)
+always-y := $($(HOSTLIBS)-y)
$(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o))
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
index 78629f515e78..d328de1e10ee 100644
--- a/scripts/genksyms/Makefile
+++ b/scripts/genksyms/Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
-hostprogs-y := genksyms
-always := $(hostprogs-y)
+hostprogs := genksyms
+always-y := $(hostprogs)
genksyms-objs := genksyms.o parse.tab.o lex.lex.o
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 94153732ec00..a566d8201b56 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -33,8 +33,8 @@ struct sym_entry {
unsigned long long addr;
unsigned int len;
unsigned int start_pos;
- unsigned char *sym;
unsigned int percpu_absolute;
+ unsigned char sym[0];
};
struct addr_range {
@@ -55,7 +55,7 @@ static struct addr_range percpu_range = {
"__per_cpu_start", "__per_cpu_end", -1ULL, 0
};
-static struct sym_entry *table;
+static struct sym_entry **table;
static unsigned int table_size, table_cnt;
static int all_symbols;
static int absolute_percpu;
@@ -174,49 +174,55 @@ static void check_symbol_range(const char *sym, unsigned long long addr,
}
}
-static int read_symbol(FILE *in, struct sym_entry *s)
+static struct sym_entry *read_symbol(FILE *in)
{
- char sym[500], stype;
+ char name[500], type;
+ unsigned long long addr;
+ unsigned int len;
+ struct sym_entry *sym;
int rc;
- rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, sym);
+ rc = fscanf(in, "%llx %c %499s\n", &addr, &type, name);
if (rc != 3) {
- if (rc != EOF && fgets(sym, 500, in) == NULL)
+ if (rc != EOF && fgets(name, 500, in) == NULL)
fprintf(stderr, "Read error or end of file.\n");
- return -1;
+ return NULL;
}
- if (strlen(sym) >= KSYM_NAME_LEN) {
+ if (strlen(name) >= KSYM_NAME_LEN) {
fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n"
"Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
- sym, strlen(sym), KSYM_NAME_LEN);
- return -1;
+ name, strlen(name), KSYM_NAME_LEN);
+ return NULL;
}
- if (is_ignored_symbol(sym, stype))
- return -1;
+ if (is_ignored_symbol(name, type))
+ return NULL;
/* Ignore most absolute/undefined (?) symbols. */
- if (strcmp(sym, "_text") == 0)
- _text = s->addr;
+ if (strcmp(name, "_text") == 0)
+ _text = addr;
- check_symbol_range(sym, s->addr, text_ranges, ARRAY_SIZE(text_ranges));
- check_symbol_range(sym, s->addr, &percpu_range, 1);
+ check_symbol_range(name, addr, text_ranges, ARRAY_SIZE(text_ranges));
+ check_symbol_range(name, addr, &percpu_range, 1);
/* include the type field in the symbol name, so that it gets
* compressed together */
- s->len = strlen(sym) + 1;
- s->sym = malloc(s->len + 1);
- if (!s->sym) {
+
+ len = strlen(name) + 1;
+
+ sym = malloc(sizeof(*sym) + len);
+ if (!sym) {
fprintf(stderr, "kallsyms failure: "
"unable to allocate required amount of memory\n");
exit(EXIT_FAILURE);
}
- strcpy(sym_name(s), sym);
- s->sym[0] = stype;
-
- s->percpu_absolute = 0;
+ sym->addr = addr;
+ sym->len = len;
+ sym->sym[0] = type;
+ memcpy(sym_name(sym), name, len);
+ sym->percpu_absolute = 0;
- return 0;
+ return sym;
}
static int symbol_in_range(const struct sym_entry *s,
@@ -268,12 +274,12 @@ static void shrink_table(void)
pos = 0;
for (i = 0; i < table_cnt; i++) {
- if (symbol_valid(&table[i])) {
+ if (symbol_valid(table[i])) {
if (pos != i)
table[pos] = table[i];
pos++;
} else {
- free(table[i].sym);
+ free(table[i]);
}
}
table_cnt = pos;
@@ -287,7 +293,15 @@ static void shrink_table(void)
static void read_map(FILE *in)
{
+ struct sym_entry *sym;
+
while (!feof(in)) {
+ sym = read_symbol(in);
+ if (!sym)
+ continue;
+
+ sym->start_pos = table_cnt;
+
if (table_cnt >= table_size) {
table_size += 10000;
table = realloc(table, sizeof(*table) * table_size);
@@ -296,10 +310,8 @@ static void read_map(FILE *in)
exit (1);
}
}
- if (read_symbol(in, &table[table_cnt]) == 0) {
- table[table_cnt].start_pos = table_cnt;
- table_cnt++;
- }
+
+ table[table_cnt++] = sym;
}
}
@@ -387,27 +399,27 @@ static void write_src(void)
int overflow;
if (!absolute_percpu) {
- offset = table[i].addr - relative_base;
+ offset = table[i]->addr - relative_base;
overflow = (offset < 0 || offset > UINT_MAX);
- } else if (symbol_absolute(&table[i])) {
- offset = table[i].addr;
+ } else if (symbol_absolute(table[i])) {
+ offset = table[i]->addr;
overflow = (offset < 0 || offset > INT_MAX);
} else {
- offset = relative_base - table[i].addr - 1;
+ offset = relative_base - table[i]->addr - 1;
overflow = (offset < INT_MIN || offset >= 0);
}
if (overflow) {
fprintf(stderr, "kallsyms failure: "
"%s symbol value %#llx out of range in relative mode\n",
- symbol_absolute(&table[i]) ? "absolute" : "relative",
- table[i].addr);
+ symbol_absolute(table[i]) ? "absolute" : "relative",
+ table[i]->addr);
exit(EXIT_FAILURE);
}
printf("\t.long\t%#x\n", (int)offset);
- } else if (!symbol_absolute(&table[i])) {
- output_address(table[i].addr);
+ } else if (!symbol_absolute(table[i])) {
+ output_address(table[i]->addr);
} else {
- printf("\tPTR\t%#llx\n", table[i].addr);
+ printf("\tPTR\t%#llx\n", table[i]->addr);
}
}
printf("\n");
@@ -437,12 +449,12 @@ static void write_src(void)
if ((i & 0xFF) == 0)
markers[i >> 8] = off;
- printf("\t.byte 0x%02x", table[i].len);
- for (k = 0; k < table[i].len; k++)
- printf(", 0x%02x", table[i].sym[k]);
+ printf("\t.byte 0x%02x", table[i]->len);
+ for (k = 0; k < table[i]->len; k++)
+ printf(", 0x%02x", table[i]->sym[k]);
printf("\n");
- off += table[i].len + 1;
+ off += table[i]->len + 1;
}
printf("\n");
@@ -496,7 +508,7 @@ static void build_initial_tok_table(void)
unsigned int i;
for (i = 0; i < table_cnt; i++)
- learn_symbol(table[i].sym, table[i].len);
+ learn_symbol(table[i]->sym, table[i]->len);
}
static unsigned char *find_token(unsigned char *str, int len,
@@ -520,15 +532,15 @@ static void compress_symbols(const unsigned char *str, int idx)
for (i = 0; i < table_cnt; i++) {
- len = table[i].len;
- p1 = table[i].sym;
+ len = table[i]->len;
+ p1 = table[i]->sym;
/* find the token on the symbol */
p2 = find_token(p1, len, str);
if (!p2) continue;
/* decrease the counts for this symbol's tokens */
- forget_symbol(table[i].sym, len);
+ forget_symbol(table[i]->sym, len);
size = len;
@@ -547,10 +559,10 @@ static void compress_symbols(const unsigned char *str, int idx)
} while (p2);
- table[i].len = len;
+ table[i]->len = len;
/* increase the counts for this symbol's new tokens */
- learn_symbol(table[i].sym, len);
+ learn_symbol(table[i]->sym, len);
}
}
@@ -606,8 +618,8 @@ static void insert_real_symbols_in_table(void)
unsigned int i, j, c;
for (i = 0; i < table_cnt; i++) {
- for (j = 0; j < table[i].len; j++) {
- c = table[i].sym[j];
+ for (j = 0; j < table[i]->len; j++) {
+ c = table[i]->sym[j];
best_table[c][0]=c;
best_table_len[c]=1;
}
@@ -660,13 +672,10 @@ static int may_be_linker_script_provide_symbol(const struct sym_entry *se)
static int compare_symbols(const void *a, const void *b)
{
- const struct sym_entry *sa;
- const struct sym_entry *sb;
+ const struct sym_entry *sa = *(const struct sym_entry **)a;
+ const struct sym_entry *sb = *(const struct sym_entry **)b;
int wa, wb;
- sa = a;
- sb = b;
-
/* sort by address first */
if (sa->addr > sb->addr)
return 1;
@@ -697,7 +706,7 @@ static int compare_symbols(const void *a, const void *b)
static void sort_symbols(void)
{
- qsort(table, table_cnt, sizeof(struct sym_entry), compare_symbols);
+ qsort(table, table_cnt, sizeof(table[0]), compare_symbols);
}
static void make_percpus_absolute(void)
@@ -705,14 +714,14 @@ static void make_percpus_absolute(void)
unsigned int i;
for (i = 0; i < table_cnt; i++)
- if (symbol_in_range(&table[i], &percpu_range, 1)) {
+ if (symbol_in_range(table[i], &percpu_range, 1)) {
/*
* Keep the 'A' override for percpu symbols to
* ensure consistent behavior compared to older
* versions of this tool.
*/
- table[i].sym[0] = 'A';
- table[i].percpu_absolute = 1;
+ table[i]->sym[0] = 'A';
+ table[i]->percpu_absolute = 1;
}
}
@@ -722,12 +731,12 @@ static void record_relative_base(void)
unsigned int i;
for (i = 0; i < table_cnt; i++)
- if (!symbol_absolute(&table[i])) {
+ if (!symbol_absolute(table[i])) {
/*
* The table is sorted by address.
* Take the first non-absolute symbol value.
*/
- relative_base = table[i].addr;
+ relative_base = table[i]->addr;
return;
}
}
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index fbeb62ae3401..5887ceb6229e 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -157,11 +157,11 @@ HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)
HOSTCFLAGS_parser.tab.o := -I $(srctree)/$(src)
# conf: Used for defconfig, oldconfig and related targets
-hostprogs-y += conf
+hostprogs += conf
conf-objs := conf.o $(common-objs)
# nconf: Used for the nconfig target based on ncurses
-hostprogs-y += nconf
+hostprogs += nconf
nconf-objs := nconf.o nconf.gui.o $(common-objs)
HOSTLDLIBS_nconf = $(shell . $(obj)/nconf-cfg && echo $$libs)
@@ -171,7 +171,7 @@ HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/nconf-cfg && echo $$cflags)
$(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg
# mconf: Used for the menuconfig target based on lxdialog
-hostprogs-y += mconf
+hostprogs += mconf
lxdialog := $(addprefix lxdialog/, \
checklist.o inputbox.o menubox.o textbox.o util.o yesno.o)
mconf-objs := mconf.o $(lxdialog) $(common-objs)
@@ -183,7 +183,7 @@ $(foreach f, mconf.o $(lxdialog), \
$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/mconf-cfg
# qconf: Used for the xconfig target based on Qt
-hostprogs-y += qconf
+hostprogs += qconf
qconf-cxxobjs := qconf.o
qconf-objs := images.o $(common-objs)
@@ -199,7 +199,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/qconf-cfg
$(call cmd,moc)
# gconf: Used for the gconfig target based on GTK+
-hostprogs-y += gconf
+hostprogs += gconf
gconf-objs := gconf.o images.o $(common-objs)
HOSTLDLIBS_gconf = $(shell . $(obj)/gconf-cfg && echo $$libs)
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 11f6c72c2eee..a39d93e3c6ae 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -1312,7 +1312,7 @@ bool conf_set_all_new_symbols(enum conf_def_mode mode)
sym_calc_value(csym);
if (mode == def_random)
- has_changed = randomize_choice_values(csym);
+ has_changed |= randomize_choice_values(csym);
else {
set_all_choice_values(csym);
has_changed = true;
@@ -1331,9 +1331,8 @@ void conf_rewrite_mod_or_yes(enum conf_def_mode mode)
for_all_symbols(i, sym) {
if (sym_get_type(sym) == S_TRISTATE &&
- sym->def[S_DEF_USER].tri == old_val) {
+ sym->def[S_DEF_USER].tri == old_val)
sym->def[S_DEF_USER].tri = new_val;
- sym_add_change_count(1);
- }
}
+ sym_clear_all_valid();
}
diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile
index 42c5d50f2bcc..296b6a3878b2 100644
--- a/scripts/mod/Makefile
+++ b/scripts/mod/Makefile
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
OBJECT_FILES_NON_STANDARD := y
-hostprogs-y := modpost mk_elfconfig
-always := $(hostprogs-y) empty.o
+hostprogs := modpost mk_elfconfig
+always-y := $(hostprogs) empty.o
modpost-objs := modpost.o file2alias.o sumversion.o
diff --git a/scripts/selinux/genheaders/Makefile b/scripts/selinux/genheaders/Makefile
index e8c533140981..70cf8d95d07c 100644
--- a/scripts/selinux/genheaders/Makefile
+++ b/scripts/selinux/genheaders/Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
-hostprogs-y := genheaders
+hostprogs := genheaders
HOST_EXTRACFLAGS += \
-I$(srctree)/include/uapi -I$(srctree)/include \
-I$(srctree)/security/selinux/include
-always := $(hostprogs-y)
+always-y := $(hostprogs)
diff --git a/scripts/selinux/mdp/Makefile b/scripts/selinux/mdp/Makefile
index 8a1269a9d0ba..3026f3c2aa2b 100644
--- a/scripts/selinux/mdp/Makefile
+++ b/scripts/selinux/mdp/Makefile
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
-hostprogs-y := mdp
+hostprogs := mdp
HOST_EXTRACFLAGS += \
-I$(srctree)/include/uapi -I$(srctree)/include \
-I$(srctree)/security/selinux/include -I$(objtree)/include
-always := $(hostprogs-y)
+always-y := $(hostprogs)
clean-files := policy.* file_contexts