Merge 73f399414a ("Merge tag 'kbuild-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux") into android-mainline
Steps on the way to v7.2-rc1 Change-Id: I9e1abff364f66f69c3c72843f30e102d9092da4e Signed-off-by: Carlos Llamas <cmllamas@google.com>
This commit is contained in:
commit
7654e42a65
35 files changed
+491
-170
No files matched your search
@@ -249,6 +249,13 @@ ifdef CONFIG_LTO_CLANG
|
||||
cmd_ld_single = $(if $(objtool-enabled)$(is-single-obj-m), ; $(LD) $(ld_flags) -r -o $(tmp-target) $@; mv $(tmp-target) $@)
|
||||
endif
|
||||
|
||||
ifdef CONFIG_LTO_CLANG_THIN_DIST
|
||||
# Save the _c_flags, sliently.
|
||||
quiet_cmd_save_c_flags =
|
||||
saved_c_flags = $(_c_flags) $(modkern_cflags)
|
||||
cmd_save_c_flags = printf '\n%s\n' 'saved_c_flags_$@ := $(call escsq,$(saved_c_flags))' >> $(dot-target).cmd
|
||||
endif
|
||||
|
||||
quiet_cmd_cc_o_c = CC $(quiet_modtag) $@
|
||||
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< \
|
||||
$(cmd_ld_single) \
|
||||
@@ -256,6 +263,7 @@ quiet_cmd_cc_o_c = CC $(quiet_modtag) $@
|
||||
|
||||
define rule_cc_o_c
|
||||
$(call cmd_and_fixdep,cc_o_c)
|
||||
$(call cmd,save_c_flags)
|
||||
$(call cmd,checksrc)
|
||||
$(call cmd,checkdoc)
|
||||
$(call cmd,gen_objtooldep)
|
||||
|
||||
@@ -46,17 +46,9 @@ quiet_cmd_btf_ko = BTF [M] $@
|
||||
$(CONFIG_SHELL) $(srctree)/scripts/gen-btf.sh --btf_base $(objtree)/vmlinux $@; \
|
||||
fi;
|
||||
|
||||
# Same as newer-prereqs, but allows to exclude specified extra dependencies
|
||||
newer_prereqs_except = $(filter-out $(PHONY) $(1),$?)
|
||||
|
||||
# Same as if_changed, but allows to exclude specified extra dependencies
|
||||
if_changed_except = $(if $(call newer_prereqs_except,$(2))$(cmd-check), \
|
||||
$(cmd); \
|
||||
printf '%s\n' 'savedcmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)
|
||||
|
||||
# Re-generate module BTFs if either module's .ko or vmlinux changed
|
||||
%.ko: %.o %.mod.o .module-common.o $(objtree)/scripts/module.lds $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),$(objtree)/vmlinux) FORCE
|
||||
+$(call if_changed_except,ld_ko_o,$(objtree)/vmlinux)
|
||||
+$(call if_changed,ld_ko_o)
|
||||
ifdef CONFIG_DEBUG_INFO_BTF_MODULES
|
||||
+$(if $(newer-prereqs),$(call cmd,btf_ko))
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
PHONY := __default
|
||||
__default:
|
||||
|
||||
include include/config/auto.conf
|
||||
include $(srctree)/scripts/Kbuild.include
|
||||
include $(srctree)/scripts/Makefile.lib
|
||||
|
||||
native-objs := $(patsubst %.o,%.thinlto-native.o,$(call read-file, vmlinux.thinlto-index))
|
||||
|
||||
__default: $(native-objs)
|
||||
|
||||
# Generate .thinlto-native.o (obj) from .o (bitcode) and .thinlto.bc (summary) files
|
||||
# ---------------------------------------------------------------------------
|
||||
quiet_cmd_cc_o_bc = CC $(quiet_modtag) $@
|
||||
be_flags = $(shell sed -n '/saved_c_flags_/s/.*:= //p' \
|
||||
$(dir $(<)).$(notdir $(<)).cmd)
|
||||
cmd_cc_o_bc = \
|
||||
$(CC) $(be_flags) -x ir -fno-lto -Wno-unused-command-line-argument \
|
||||
-fthinlto-index=$(word 2, $^) -c -o $@ $<
|
||||
|
||||
targets += $(native-objs)
|
||||
$(native-objs): %.thinlto-native.o: %.o %.o.thinlto.bc FORCE
|
||||
$(call if_changed,cc_o_bc)
|
||||
|
||||
# Add FORCE to the prerequisites of a target to force it to be always rebuilt.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
PHONY += FORCE
|
||||
FORCE:
|
||||
|
||||
# Read all saved command lines and dependencies for the $(targets) we
|
||||
# may be building above, using $(if_changed{,_dep}). As an
|
||||
# optimization, we don't need to read them if the target does not
|
||||
# exist, we will rebuild anyway in that case.
|
||||
|
||||
existing-targets := $(wildcard $(sort $(targets)))
|
||||
|
||||
-include $(foreach f, $(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
|
||||
|
||||
.PHONY: $(PHONY)
|
||||
@@ -0,0 +1,82 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
PHONY := __default
|
||||
__default: vmlinux.a
|
||||
|
||||
include include/config/auto.conf
|
||||
include $(srctree)/scripts/Kbuild.include
|
||||
include $(srctree)/scripts/Makefile.lib
|
||||
|
||||
# Link of built-in-fixup.a
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
quiet_cmd_ar_builtin_fixup = AR $@
|
||||
cmd_ar_builtin_fixup = \
|
||||
rm -f $@; \
|
||||
$(AR) cDPrST $@ $(KBUILD_VMLINUX_OBJS); \
|
||||
$(AR) mPi $$($(AR) t $@ | sed -n 1p) $@ $$($(AR) t $@ | grep -F -f $(srctree)/scripts/head-object-list.txt)
|
||||
|
||||
targets += built-in-fixup.a
|
||||
built-in-fixup.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt FORCE
|
||||
$(call if_changed,ar_builtin_fixup)
|
||||
|
||||
ifdef CONFIG_LTO_CLANG_THIN_DIST
|
||||
|
||||
quiet_cmd_builtin.order = GEN $@
|
||||
cmd_builtin.order = $(AR) t $< > $@
|
||||
|
||||
targets += builtin.order
|
||||
builtin.order: built-in-fixup.a FORCE
|
||||
$(call if_changed,builtin.order)
|
||||
|
||||
quiet_cmd_ld_thinlto_index = LD $@
|
||||
cmd_ld_thinlto_index = \
|
||||
$(LD) $(KBUILD_LDFLAGS) -r --thinlto-index-only=$@ @$<
|
||||
|
||||
targets += vmlinux.thinlto-index
|
||||
vmlinux.thinlto-index: builtin.order FORCE
|
||||
$(call if_changed,ld_thinlto_index)
|
||||
|
||||
quiet_cmd_ar_vmlinux.a = GEN $@
|
||||
cmd_ar_vmlinux.a = \
|
||||
rm -f $@; \
|
||||
while read -r obj; do \
|
||||
if grep -Fqx $${obj} $(word 2, $^); then \
|
||||
echo $${obj%.o}.thinlto-native.o; \
|
||||
else \
|
||||
echo $${obj}; \
|
||||
fi; \
|
||||
done < $< | xargs $(AR) cDPrS --thin $@
|
||||
|
||||
targets += vmlinux.a
|
||||
vmlinux.a: builtin.order vmlinux.thinlto-index FORCE
|
||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.thinlto
|
||||
$(call if_changed,ar_vmlinux.a)
|
||||
|
||||
else
|
||||
|
||||
# vmlinux.a
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
targets += vmlinux.a
|
||||
vmlinux.a: built-in-fixup.a FORCE
|
||||
$(call if_changed,copy)
|
||||
|
||||
endif
|
||||
|
||||
# Add FORCE to the prerequisites of a target to force it to be always rebuilt.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
PHONY += FORCE
|
||||
FORCE:
|
||||
|
||||
# Read all saved command lines and dependencies for the $(targets) we
|
||||
# may be building above, using $(if_changed{,_dep}). As an
|
||||
# optimization, we don't need to read them if the target does not
|
||||
# exist, we will rebuild anyway in that case.
|
||||
|
||||
existing-targets := $(wildcard $(sort $(targets)))
|
||||
|
||||
-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
|
||||
|
||||
.PHONY: $(PHONY)
|
||||
@@ -135,16 +135,6 @@ KBUILD_CFLAGS += $(call cc-option, -Wno-stringop-truncation)
|
||||
KBUILD_CFLAGS += -Wno-override-init # alias for -Wno-initializer-overrides in clang
|
||||
|
||||
ifdef CONFIG_CC_IS_CLANG
|
||||
# Clang before clang-16 would warn on default argument promotions.
|
||||
ifneq ($(call clang-min-version, 160000),y)
|
||||
# Disable -Wformat
|
||||
KBUILD_CFLAGS += -Wno-format
|
||||
# Then re-enable flags that were part of the -Wformat group that aren't
|
||||
# problematic.
|
||||
KBUILD_CFLAGS += -Wformat-extra-args -Wformat-invalid-specifier
|
||||
KBUILD_CFLAGS += -Wformat-zero-length -Wnonnull
|
||||
KBUILD_CFLAGS += -Wformat-insufficient-args
|
||||
endif
|
||||
KBUILD_CFLAGS += -Wno-pointer-to-enum-cast
|
||||
KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare
|
||||
KBUILD_CFLAGS += -Wno-unaligned-access
|
||||
|
||||
@@ -79,14 +79,15 @@ def run_analysis(entry):
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
args = parse_arguments()
|
||||
args = parse_arguments()
|
||||
|
||||
lock = multiprocessing.Lock()
|
||||
pool = multiprocessing.Pool(initializer=init, initargs=(lock, args))
|
||||
# Read JSON data into the datastore variable
|
||||
with open(args.path, "r") as f:
|
||||
datastore = json.load(f)
|
||||
# Read JSON data into the datastore variable
|
||||
with open(args.path) as f:
|
||||
datastore = json.load(f)
|
||||
|
||||
lock = multiprocessing.Lock()
|
||||
try:
|
||||
with multiprocessing.Pool(initializer=init, initargs=(lock, args)) as pool:
|
||||
pool.map(run_analysis, datastore)
|
||||
except BrokenPipeError:
|
||||
# Python flushes standard streams on exit; redirect remaining output
|
||||
|
||||
@@ -297,9 +297,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
|
||||
line[1] = 0;
|
||||
|
||||
if (!sym_is_changeable(sym)) {
|
||||
printf("%s\n", def);
|
||||
line[0] = '\n';
|
||||
line[1] = 0;
|
||||
printf("%s\n", def ?: "");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -307,7 +305,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
|
||||
case oldconfig:
|
||||
case syncconfig:
|
||||
if (sym_has_value(sym)) {
|
||||
printf("%s\n", def);
|
||||
printf("%s\n", def ?: "");
|
||||
return 0;
|
||||
}
|
||||
/* fall through */
|
||||
|
||||
Executable
+132
@@ -0,0 +1,132 @@
|
||||
#!/usr/bin/env perl
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
my $srctree = shift @ARGV;
|
||||
unless (defined $srctree) {
|
||||
$srctree = `git rev-parse --show-toplevel 2>/dev/null`;
|
||||
chomp $srctree;
|
||||
my $msg = "Usage: $0 <srctree> [excludes file]\n";
|
||||
$msg .= "Please provide <srctree>.";
|
||||
$msg .= " Is it '$srctree'?" if $srctree;
|
||||
$msg .= "\n";
|
||||
die $msg;
|
||||
}
|
||||
my $kconfig_sym_check_excludes = defined $ARGV[0] ? $ARGV[0] : undef;
|
||||
|
||||
sub indent_depth {
|
||||
my ($ws) = @_;
|
||||
my $col = 0;
|
||||
for my $c (split //, $ws) {
|
||||
$col = $c eq "\t" ? int($col / 8) * 8 + 8 : $col + 1;
|
||||
}
|
||||
return $col;
|
||||
}
|
||||
|
||||
my @files = `git -C \Q$srctree\E ls-files '*Kconfig*' 2>/dev/null`;
|
||||
if (@files) {
|
||||
chomp @files;
|
||||
@files = map { "$srctree/$_" } @files;
|
||||
} else {
|
||||
@files = `find \Q$srctree\E -name '*Kconfig*'`;
|
||||
chomp @files;
|
||||
}
|
||||
|
||||
@files = grep { !m{/scripts/kconfig/tests/} } @files;
|
||||
|
||||
my %configs = ();
|
||||
my %refs = ();
|
||||
|
||||
foreach my $file (@files) {
|
||||
open F, $file or die "Cannot open $file: $!";
|
||||
|
||||
my $help = 0;
|
||||
my $help_level;
|
||||
my $level;
|
||||
|
||||
while (<F>) {
|
||||
chomp;
|
||||
|
||||
while (/\\\s*$/) {
|
||||
s/\\\s*$/ /;
|
||||
my $cont = <F> // last;
|
||||
chomp $cont;
|
||||
$_ .= $cont;
|
||||
}
|
||||
|
||||
next if /^\s*$/;
|
||||
next if /^\s*#/;
|
||||
|
||||
/^(\s*)/;
|
||||
$level = indent_depth($1);
|
||||
|
||||
if ($help && $level < $help_level) {
|
||||
$help = 0;
|
||||
}
|
||||
|
||||
next if ($help);
|
||||
|
||||
if (/^\s*(help|\-\-\-help\-\-\-)$/) {
|
||||
$help = 1;
|
||||
my $next;
|
||||
while (defined($next = <F>)) {
|
||||
last unless $next =~ /^\s*(?:#.*)?$/;
|
||||
}
|
||||
last unless defined $next;
|
||||
$next =~ /^(\s*)/;
|
||||
if (indent_depth($1) >= $level) {
|
||||
$help_level = indent_depth($1);
|
||||
} else {
|
||||
$help = 0;
|
||||
}
|
||||
$_ = $next;
|
||||
redo;
|
||||
}
|
||||
|
||||
if (/^\s*(config|menuconfig)\s+([a-zA-Z0-9_]+)\s*(#.*)?$/) {
|
||||
$configs{$2}++;
|
||||
next;
|
||||
}
|
||||
|
||||
if (/^\s*(default|def_bool|def_tristate|select|depends\s+on|imply|visible\s+if|range|if|bool|tristate|int|hex|string|prompt)\s+(.+)\s*$/) {
|
||||
my $s = $2;
|
||||
$s =~ s/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'//g;
|
||||
$s =~ s/#.*//;
|
||||
$s =~ s/\$\((?:[^()]*|\((?:[^()]*|\([^()]*\))*\))*\)//g;
|
||||
$s =~ s/%%[^%]*%%//g;
|
||||
my @syms = split /[^a-zA-Z0-9_]+/, $s;
|
||||
map {
|
||||
$refs{$_}++ if (/[a-zA-Z]/ && $_ ne "if" && $_ ne "y" && $_ ne "n" && $_ ne "m" && !/^0[xX][0-9a-fA-F]+$/);
|
||||
} @syms
|
||||
}
|
||||
}
|
||||
|
||||
close F;
|
||||
}
|
||||
|
||||
my %known_syms = ();
|
||||
if (defined $kconfig_sym_check_excludes) {
|
||||
my $file = $kconfig_sym_check_excludes;
|
||||
open(F, "<", $file) or die "Cannot open $file: $!";
|
||||
while (<F>) {
|
||||
chomp;
|
||||
next if /^\s*$/;
|
||||
next if /^\s*#/;
|
||||
$known_syms{$1}++ if (/^\s*([a-zA-Z0-9_]+)\s*(#.*)?$/);
|
||||
}
|
||||
}
|
||||
|
||||
my $ret = 0;
|
||||
foreach my $k (sort keys %refs) {
|
||||
next if (exists $configs{$k} || exists $known_syms{$k});
|
||||
|
||||
print "$k";
|
||||
print " - warning: '$k' is probably not what you want; Kconfig tristate literals are always lowercase ('n', 'y', 'm')" if ($k eq "N" || $k eq "Y" || $k eq "M");
|
||||
print "\n";
|
||||
|
||||
$ret = 1;
|
||||
}
|
||||
|
||||
exit $ret;
|
||||
@@ -8,7 +8,7 @@ for symbols with unmet dependency.
|
||||
This was not working correctly for choice values because choice needs
|
||||
a bit different symbol computation.
|
||||
|
||||
This checks that no unneeded "# COFIG_... is not set" is contained in
|
||||
This checks that no unneeded "# CONFIG_... is not set" is contained in
|
||||
the .config file.
|
||||
|
||||
Related Linux commit: cb67ab2cd2b8abd9650292c986c79901e3073a59
|
||||
|
||||
@@ -27,7 +27,7 @@ llvm)
|
||||
if [ "$SRCARCH" = loongarch ]; then
|
||||
echo 18.0.0
|
||||
else
|
||||
echo 15.0.0
|
||||
echo 17.0.1
|
||||
fi
|
||||
;;
|
||||
rustc)
|
||||
|
||||
+24
-4
@@ -773,6 +773,8 @@ static const char *const section_white_list[] =
|
||||
".gnu.lto*",
|
||||
".discard.*",
|
||||
".llvm.call-graph-profile", /* call graph */
|
||||
"__llvm_covfun",
|
||||
"__llvm_covmap",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -1495,13 +1497,22 @@ static void extract_crcs_for_object(const char *object, struct module *mod)
|
||||
char cmd_file[PATH_MAX];
|
||||
char *buf, *p;
|
||||
const char *base;
|
||||
int dirlen, ret;
|
||||
int dirlen, baselen_without_suffix, ret;
|
||||
|
||||
base = get_basename(object);
|
||||
dirlen = base - object;
|
||||
|
||||
ret = snprintf(cmd_file, sizeof(cmd_file), "%.*s.%s.cmd",
|
||||
dirlen, object, base);
|
||||
baselen_without_suffix = strlen(object) - dirlen - strlen(".o");
|
||||
|
||||
/*
|
||||
* When CONFIG_LTO_CLANG_THIN_DIST=y, the ELF is *.thinlto-native.o
|
||||
* but the symbol CRCs are recorded in *.o.cmd file.
|
||||
*/
|
||||
if (strends(object, ".thinlto-native.o"))
|
||||
baselen_without_suffix -= strlen(".thinlto-native");
|
||||
|
||||
ret = snprintf(cmd_file, sizeof(cmd_file), "%.*s.%.*s.o.cmd",
|
||||
dirlen, object, baselen_without_suffix, base);
|
||||
if (ret >= sizeof(cmd_file)) {
|
||||
error("%s: too long path was truncated\n", cmd_file);
|
||||
return;
|
||||
@@ -1697,8 +1708,17 @@ void __attribute__((format(printf, 2, 3))) buf_printf(struct buffer *buf,
|
||||
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(tmp, SZ, fmt, ap);
|
||||
buf_write(buf, tmp, len);
|
||||
va_end(ap);
|
||||
|
||||
if (len < 0) {
|
||||
perror("vsnprintf failed");
|
||||
exit(1);
|
||||
}
|
||||
if (len >= SZ)
|
||||
fatal("buf_printf output truncated for string %s: %d bytes needed, %d available\n",
|
||||
tmp, len + 1, SZ);
|
||||
|
||||
buf_write(buf, tmp, len);
|
||||
}
|
||||
|
||||
void buf_write(struct buffer *buf, const char *s, int len)
|
||||
|
||||
@@ -121,6 +121,9 @@ _package-debug(){
|
||||
install -Dt "${debugdir}" -m644 vmlinux
|
||||
mkdir -p "${builddir}"
|
||||
ln -sr "${debugdir}/vmlinux" "${builddir}/vmlinux"
|
||||
|
||||
echo "Installing unstripped vDSO(s)..."
|
||||
${MAKE} INSTALL_MOD_PATH="${pkgdir}/usr" vdso_install
|
||||
}
|
||||
|
||||
for _p in "${pkgname[@]}"; do
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Name: kernel
|
||||
Summary: The Linux Kernel
|
||||
Version: %(echo %{KERNELRELEASE} | sed -e 's/-/_/g')
|
||||
Release: %{pkg_release}
|
||||
Release: %{pkg_release}%{?dist}
|
||||
License: GPL
|
||||
Group: System Environment/Kernel
|
||||
Vendor: The Linux Community
|
||||
|
||||
Reference in new issue
Block a user