Skip to content

Commit a016546

Browse files
committed
Merge tag 'kbuild-fixes-v6.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - Remove stale code in usr/include/headers_check.pl - Fix issues in the user-mode-linux Debian package - Fix false-positive "export twice" errors in modpost * tag 'kbuild-fixes-v6.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: modpost: distinguish same module paths from different dump files kbuild: deb-pkg: Do not install maint scripts for arch 'um' kbuild: deb-pkg: add debarch for ARCH=um kbuild: Drop support for include/asm-<arch> in headers_check.pl
2 parents 9c707ba + 9435dc7 commit a016546

File tree

6 files changed

+27
-17
lines changed

6 files changed

+27
-17
lines changed

scripts/mod/modpost.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,13 @@ char *get_line(char **stringp)
155155
/* A list of all modules we processed */
156156
LIST_HEAD(modules);
157157

158-
static struct module *find_module(const char *modname)
158+
static struct module *find_module(const char *filename, const char *modname)
159159
{
160160
struct module *mod;
161161

162162
list_for_each_entry(mod, &modules, list) {
163-
if (strcmp(mod->name, modname) == 0)
163+
if (!strcmp(mod->dump_file, filename) &&
164+
!strcmp(mod->name, modname))
164165
return mod;
165166
}
166167
return NULL;
@@ -2030,10 +2031,10 @@ static void read_dump(const char *fname)
20302031
continue;
20312032
}
20322033

2033-
mod = find_module(modname);
2034+
mod = find_module(fname, modname);
20342035
if (!mod) {
20352036
mod = new_module(modname, strlen(modname));
2036-
mod->from_dump = true;
2037+
mod->dump_file = fname;
20372038
}
20382039
s = sym_add_exported(symname, mod, gpl_only, namespace);
20392040
sym_set_crc(s, crc);
@@ -2052,7 +2053,7 @@ static void write_dump(const char *fname)
20522053
struct symbol *sym;
20532054

20542055
list_for_each_entry(mod, &modules, list) {
2055-
if (mod->from_dump)
2056+
if (mod->dump_file)
20562057
continue;
20572058
list_for_each_entry(sym, &mod->exported_symbols, list) {
20582059
if (trim_unused_exports && !sym->used)
@@ -2076,7 +2077,7 @@ static void write_namespace_deps_files(const char *fname)
20762077

20772078
list_for_each_entry(mod, &modules, list) {
20782079

2079-
if (mod->from_dump || list_empty(&mod->missing_namespaces))
2080+
if (mod->dump_file || list_empty(&mod->missing_namespaces))
20802081
continue;
20812082

20822083
buf_printf(&ns_deps_buf, "%s.ko:", mod->name);
@@ -2194,7 +2195,7 @@ int main(int argc, char **argv)
21942195
read_symbols_from_files(files_source);
21952196

21962197
list_for_each_entry(mod, &modules, list) {
2197-
if (mod->from_dump || mod->is_vmlinux)
2198+
if (mod->dump_file || mod->is_vmlinux)
21982199
continue;
21992200

22002201
check_modname_len(mod);
@@ -2205,7 +2206,7 @@ int main(int argc, char **argv)
22052206
handle_white_list_exports(unused_exports_white_list);
22062207

22072208
list_for_each_entry(mod, &modules, list) {
2208-
if (mod->from_dump)
2209+
if (mod->dump_file)
22092210
continue;
22102211

22112212
if (mod->is_vmlinux)

scripts/mod/modpost.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,15 @@ struct module_alias {
9595
/**
9696
* struct module - represent a module (vmlinux or *.ko)
9797
*
98+
* @dump_file: path to the .symvers file if loaded from a file
9899
* @aliases: list head for module_aliases
99100
*/
100101
struct module {
101102
struct list_head list;
102103
struct list_head exported_symbols;
103104
struct list_head unresolved_symbols;
105+
const char *dump_file;
104106
bool is_gpl_compatible;
105-
bool from_dump; /* true if module was loaded from *.symvers */
106107
bool is_vmlinux;
107108
bool seen;
108109
bool has_init;

scripts/package/builddeb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ install_linux_image () {
6363
esac
6464
cp "$(${MAKE} -s -f ${srctree}/Makefile image_name)" "${pdir}/${installed_image_path}"
6565

66+
if [ "${ARCH}" != um ]; then
67+
install_maint_scripts "${pdir}"
68+
fi
69+
}
70+
71+
install_maint_scripts () {
6672
# Install the maintainer scripts
6773
# Note: hook scripts under /etc/kernel are also executed by official Debian
6874
# kernel packages, as well as kernel packages built using make-kpkg.

scripts/package/mkdebian

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ set_debarch() {
7070
debarch=sh4$(if_enabled_echo CONFIG_CPU_BIG_ENDIAN eb)
7171
fi
7272
;;
73+
um)
74+
if is_enabled CONFIG_64BIT; then
75+
debarch=amd64
76+
else
77+
debarch=i386
78+
fi
79+
;;
7380
esac
7481
if [ -z "$debarch" ]; then
7582
debarch=$(dpkg-architecture -qDEB_HOST_ARCH)

usr/include/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ quiet_cmd_hdrtest = HDRTEST $<
7878
cmd_hdrtest = \
7979
$(CC) $(c_flags) -fsyntax-only -x c /dev/null \
8080
$(if $(filter-out $(no-header-test), $*.h), -include $< -include $<); \
81-
$(PERL) $(src)/headers_check.pl $(obj) $(SRCARCH) $<; \
81+
$(PERL) $(src)/headers_check.pl $(obj) $<; \
8282
touch $@
8383

8484
$(obj)/%.hdrtest: $(obj)/%.h FORCE

usr/include/headers_check.pl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
#
44
# headers_check.pl execute a number of trivial consistency checks
55
#
6-
# Usage: headers_check.pl dir arch [files...]
6+
# Usage: headers_check.pl dir [files...]
77
# dir: dir to look for included files
8-
# arch: architecture
98
# files: list of files to check
109
#
1110
# The script reads the supplied files line by line and:
@@ -23,7 +22,7 @@
2322
use strict;
2423
use File::Basename;
2524

26-
my ($dir, $arch, @files) = @ARGV;
25+
my ($dir, @files) = @ARGV;
2726

2827
my $ret = 0;
2928
my $line;
@@ -54,10 +53,6 @@ sub check_include
5453
my $inc = $1;
5554
my $found;
5655
$found = stat($dir . "/" . $inc);
57-
if (!$found) {
58-
$inc =~ s#asm/#asm-$arch/#;
59-
$found = stat($dir . "/" . $inc);
60-
}
6156
if (!$found) {
6257
printf STDERR "$filename:$lineno: included file '$inc' is not exported\n";
6358
$ret = 1;

0 commit comments

Comments
 (0)