aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/leds (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2020-06-06Makefile: install modules.builtin even if CONFIG_MODULES=nJonas Zeiger1-3/+11
Many applications check for available kernel features via: - /proc/modules (loaded modules, present if CONFIG_MODULES=y) - $(MODLIB)/modules.builtin (builtin modules) They fail to detect features if the kernel was built with CONFIG_MODULES=n and modules.builtin isn't installed. Therefore, add the target "_builtin_inst_" and make "install" and "modules_install" depend on it. Tests results: - make install: kernel image is copied as before, modules.builtin copied - make modules_install: (CONFIG_MODULES=n) nothing is copied, exit 1 Signed-off-by: Jonas Zeiger <jonas.zeiger@talpidae.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06mksysmap: Fix the mismatch of '.L' symbols in System.mapashimida1-1/+1
When System.map was generated, the kernel used mksysmap to filter the kernel symbols, but all the symbols with the second letter 'L' in the kernel were filtered out, not just the symbols starting with 'dot + L'. For example: ashimida@ubuntu:~/linux$ cat System.map |grep ' .L' ashimida@ubuntu:~/linux$ nm -n vmlinux |grep ' .L' ffff0000088028e0 t bLength_show ...... ffff0000092e0408 b PLLP_OUTC_lock ffff0000092e0410 b PLLP_OUTA_lock The original intent should be to filter out all local symbols starting with '.L', so the dot should be escaped. Fixes: 00902e984732 ("mksysmap: Add h8300 local symbol pattern") Signed-off-by: ashimida <ashimida@linux.alibaba.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06kbuild: doc: rename LDFLAGS to KBUILD_LDFLAGSMasahiro Yamada1-2/+2
Commit d503ac531a52 ("kbuild: rename LDFLAGS to KBUILD_LDFLAGS") missed to update the documentation. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: change elf_info->size to size_tMasahiro Yamada2-6/+5
Align with the mmap / munmap APIs. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: remove is_vmlinux() helperMasahiro Yamada1-15/+1
Now that is_vmlinux() is called only in new_module(), we can inline the function call. modname is the basename with '.o' is stripped. No need to compare it with 'vmlinux.o'. vmlinux is always located at the current working directory. No need to strip the directory path. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: strip .o from modname before calling new_module()Masahiro Yamada2-10/+12
new_module() conditionally strips the .o because the modname has .o suffix when it is called from read_symbols(), but no .o when it is called from read_dump(). It is clearer to strip .o in read_symbols(). I also used flexible-array for mod->name. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: set have_vmlinux in new_module()Masahiro Yamada1-5/+3
Set have_vmlinux flag in a single place. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: remove mod->skip struct memberMasahiro Yamada2-7/+3
The meaning of 'skip' is obscure since it does not explain "what to skip". mod->skip is set when it is vmlinux or the module info came from a dump file. So, mod->skip is equivalent to (mod->is_vmlinux || mod->from_dump). For the check in write_namespace_deps_files(), mod->is_vmlinux is unneeded because the -d option is not passed in the first pass of modpost. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: add mod->is_vmlinux struct memberMasahiro Yamada2-9/+11
is_vmlinux() is called in several places to check whether the current module is vmlinux or not. It is faster and clearer to check mod->is_vmlinux flag. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: remove is_vmlinux() call in check_for_{gpl_usage,unused}()Masahiro Yamada1-12/+8
check_exports() is never called for vmlinux because mod->skip is set for vmlinux. Hence, check_for_gpl_usage() and check_for_unused() are not called for vmlinux, either. is_vmlinux() is always false here. Remove the is_vmlinux() calls, and hard-code the ".ko" suffix. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: remove mod->is_dot_o struct memberMasahiro Yamada2-13/+2
Previously, there were two cases where mod->is_dot_o is unset: [1] the executable 'vmlinux' in the second pass of modpost [2] modules loaded by read_dump() I think [1] was intended usage to distinguish 'vmlinux.o' and 'vmlinux'. Now that modpost does not parse the executable 'vmlinux', this case does not happen. [2] is obscure, maybe a bug. Module.symver stores module paths without extension. So, none of modules loaded by read_dump() has the .o suffix, and new_module() unsets ->is_dot_o. Anyway, it is not a big deal because handle_symbol() is not called for the case. To sum up, all the parsed ELF files are .o files. mod->is_dot_o is unneeded. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: move -d option in scripts/Makefile.modpostMasahiro Yamada1-3/+1
Collect options for modules into a single place. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: remove -s optionMasahiro Yamada2-9/+3
The -s option was added by commit 8d8d8289df65 ("kbuild: do not do section mismatch checks on vmlinux in 2nd pass"). Now that the second pass does not parse vmlinux, this option is unneeded. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: remove get_next_text() and make {grab,release_}file staticMasahiro Yamada2-39/+2
get_next_line() is no longer used. Remove. grab_file() and release_file() are only used in modpost.c. Make them static. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: use read_text_file() and get_line() for reading text filesMasahiro Yamada2-17/+14
grab_file() mmaps a file, but it is not so efficient here because get_next_line() copies every line to the temporary buffer anyway. read_text_file() and get_line() are simpler. get_line() exploits the library function strchr(). Going forward, the missing *.symvers or *.cmd is a fatal error. This should not happen because scripts/Makefile.modpost guards the -i option files with $(wildcard $(input-symdump)). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: avoid false-positive file open errorMasahiro Yamada1-4/+3
One problem of grab_file() is that it cannot distinguish the following two cases: - It cannot read the file (the file does not exist, or read permission is not set) - It can read the file, but the file size is zero This is because grab_file() calls mmap(), which requires the mapped length is greater than 0. Hence, grab_file() fails for both cases. If an empty header file were included for checksum calculation, the following warning would be printed: WARNING: modpost: could not open ...: Invalid argument An empty file is a valid source file, so it should not fail. Use read_text_file() instead. It can read a zero-length file. Then, parse_file() will succeed with doing nothing. Going forward, the first case (it cannot read the file) is a fatal error. If the source file from which an object was compiled is missing, something went wrong. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: fix potential mmap'ed file overrun in get_src_version()Masahiro Yamada1-17/+11
I do not know how reliably this function works, but it looks dangerous to me. strchr(sources, '\n'); ... continues searching until it finds '\n' or it reaches the '\0' terminator. In other words, 'sources' should be a null-terminated string. However, grab_file() just mmaps a file, so 'sources' is not terminated with null byte. If the file does not contain '\n' at all, strchr() will go beyond the mmap'ed memory. Use read_text_file(), which loads the file content into a malloc'ed buffer, appending null byte. Here we are interested only in the first line of *.mod files. Use get_line() helper to get the first line. This also makes missing *.mod file a fatal error. Commit 4be40e22233c ("kbuild: do not emit src version warning for non-modules") ignored missing *.mod files. I do not fully understand what that commit addressed, but commit 91341d4b2c19 ("kbuild: introduce new option to enhance section mismatch analysis") introduced partial section checks by using modpost. built-in.o was parsed by modpost. Even modules had a problem because *.mod files were created after the modpost check. Commit b7dca6dd1e59 ("kbuild: create *.mod with full directory path and remove MODVERDIR") stopped doing that. Now that modpost is only invoked after the directory descend, *.mod files should always exist at the modpost stage. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: add read_text_file() and get_line() helpersMasahiro Yamada2-0/+51
modpost uses grab_file() to open a file, but it is not suitable for a text file because the mmap'ed file is not terminated by null byte. Actually, I see some issues for the use of grab_file(). The new helper, read_text_file() loads the whole file content into a malloc'ed buffer, and appends a null byte. Then, get_line() reads each line. To handle text files, I intend to replace as follows: grab_file() -> read_text_file() get_new_line() -> get_line() Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: do not call get_modinfo() for vmlinux(.o)Masahiro Yamada1-21/+24
The three calls of get_modinfo() ("license", "import_ns", "version") always return NULL for vmlinux(.o) because the built-in module info is prefixed with __MODULE_INFO_PREFIX. It is harmless to call get_modinfo(), but there is no point to search for what apparently does not exist. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: drop RCS/CVS $Revision handling in MODULE_VERSION()Masahiro Yamada3-73/+0
As far as I understood, this code gets rid of '$Revision$' or '$Revision:' of CVS, RCS or whatever in MODULE_VERSION() tags. Remove the primeval code. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: show warning if any of symbol dump files is missingMasahiro Yamada2-10/+5
If modpost fails to load a symbol dump file, it cannot check unresolved symbols, hence module dependency will not be added. Nor CRCs can be added. Currently, external module builds check only $(objtree)/Module.symvers, but it should check files specified by KBUILD_EXTRA_SYMBOLS as well. Move the warning message from the top Makefile to scripts/Makefile.modpost and print the warning if any dump file is missing. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: show warning if vmlinux is not found when processing modulesMasahiro Yamada1-2/+7
check_exports() does not print warnings about unresolved symbols if vmlinux is missing because there would be too many. This situation happens when you do 'make modules' from the clean tree, or compile external modules against a kernel tree that has not been completely built. It is dangerous to not check unresolved symbols because you might be building useless modules. At least it should be warned. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: invoke modpost only when input files are updatedMasahiro Yamada2-15/+37
Currently, the second pass of modpost is always invoked when you run 'make' or 'make modules' even if none of modules is changed. Use if_changed to invoke it only when it is necessary. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: generate vmlinux.symvers and reuse it for the second modpostMasahiro Yamada5-6/+7
The full build runs modpost twice, first for vmlinux.o and second for modules. The first pass dumps all the vmlinux symbols into Module.symvers, but the second pass parses vmlinux again instead of reusing the dump file, presumably because it needs to avoid accumulating stale symbols. Loading symbol info from a dump file is faster than parsing an ELF object. Besides, modpost deals with various issues to parse vmlinux in the second pass. A solution is to make the first pass dumps symbols into a separate file, vmlinux.symvers. The second pass reads it, and parses module .o files. The merged symbol information is dumped into Module.symvers in the same way as before. This makes further modpost cleanups possible. Also, it fixes the problem of 'make vmlinux', which previously overwrote Module.symvers, throwing away module symbols. I slightly touched scripts/link-vmlinux.sh so that vmlinux is re-linked when you cross this commit. Otherwise, vmlinux.symvers would not be generated. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: refactor -i option calculationMasahiro Yamada1-4/+2
Prepare to use -i for in-tree modpost as well. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: print symbol dump file as the build target in short logMasahiro Yamada1-13/+20
The symbol dump *.symvers is the output of modpost. Print it in the short log. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: re-add -e to set external_module flagMasahiro Yamada2-2/+8
Previously, the -i option had two functions; load a symbol dump file, and set the external_module flag. I want to assign a dedicate option for each of them. Going forward, the -i is used to load a symbol dump file, and the -e to set the external_module flag. With this, we will be able to use -i for loading in-kernel symbols. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: rename ext_sym_list to dump_listMasahiro Yamada1-13/+14
The -i option is used to include Modules.symver as well as files from $(KBUILD_EXTRA_SYMBOLS). Make the struct and variable names more generic. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: allow to pass -i option multiple times to remove -e optionMasahiro Yamada2-9/+2
Now that there is no difference between -i and -e, they can be unified. Make modpost accept the -i option multiple times, then remove -e. I will reuse -e for a different purpose. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-06modpost: track if the symbol origin is a dump file or ELF objectMasahiro Yamada2-10/+6
The meaning of sym->kernel is obscure; it is set for in-kernel symbols loaded from Modules.symvers. This happens only when we are building external modules, and it is used to determine whether to dump symbols to $(KBUILD_EXTMOD)/Modules.symvers It is clearer to remember whether the symbol or module came from a dump file or ELF object. This changes the KBUILD_EXTRA_SYMBOLS behavior. Previously, symbols loaded from KBUILD_EXTRA_SYMBOLS are accumulated into the current $(KBUILD_EXTMOD)/Modules.symvers Going forward, they will be only used to check symbol references, but not dumped into the current $(KBUILD_EXTMOD)/Modules.symvers. I believe this makes more sense. sym->vmlinux will have no user. Remove it too. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-03modpost: load KBUILD_EXTRA_SYMBOLS files in orderMasahiro Yamada1-8/+8
Currently, modpost reads extra symbol dump files in the reverse order. If '-e foo -e bar' is given, modpost reads bar, foo, in this order. This is probably not a big deal, but there is no good reason to reverse the order. Read files in the given order. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-03modpost: pass -N option only for modules modpostMasahiro Yamada1-1/+4
The built-in only code is not required to have MODULE_IMPORT_NS() to use symbols. So, the namespace is not checked for vmlinux(.o). Do not pass the meaningless -N option to the first pass of modpost. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-03modpost: move -T option close to the modpost commandMasahiro Yamada1-2/+2
The '-T -' option reads the file list from stdin. It is clearer to put it close to the piped command. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-03modpost: fix -i (--ignore-errors) MAKEFLAGS detectionMasahiro Yamada1-1/+6
$(filter -i,$(MAKEFLAGS)) works only in limited use-cases. The representation of $(MAKEFLAGS) depends on various factors: - GNU Make version (version 3.8x or version 4.x) - The presence of other flags like -j In my experiments, $(MAKEFLAGS) is expanded as follows: * GNU Make 3.8x: * without -j option: --no-print-directory -Rri * with -j option: --no-print-directory -Rr --jobserver-fds=3,4 -j -i * GNU Make 4.x: * without -j option: irR --no-print-directory * with -j option: irR -j --jobserver-fds=3,4 --no-print-directory For GNU Make 4.x, the flags are grouped as 'irR', which does not work. For the single thread build with GNU Make 3.8x, the flags are grouped as '-Rri', which does not work either. To make it work for all cases, do likewise as commit 6f0fa58e4596 ("kbuild: simplify silent build (-s) detection"). BTW, since commit ff9b45c55b26 ("kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod"), you also need to pass -k option to build final *.ko files. 'make -i -k' ignores compile errors in modules, and build as many remaining *.ko as possible. Please note this feature is kind of dangerous if other modules depend on the broken module because the generated modules will lack the correct module dependency or CRC. Honestly, I am not a big fan of it, but I am keeping this feature. Fixes: eed380f3f593 ("modpost: Optionally ignore secondary errors seen if a single module build fails") Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-03kbuild: update modules.order only when contained modules are updatedMasahiro Yamada3-24/+38
Make modules.order depend on $(obj-m), and use if_changed to build it. This will avoid unneeded update of modules.order, which will be useful to optimize the modpost stage. Currently, the second pass of modpost is always invoked. By checking the timestamp of modules.order, we can avoid the unneeded modpost. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-03kbuild: refactor KBUILD_VMLINUX_{OBJS,LIBS} calculationMasahiro Yamada1-9/+8
Do not overwrite core-y or drivers-y. Remove libs-y1 and libs-y2. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-01kbuild: merge net-y and virt-y into drivers-yMasahiro Yamada1-8/+4
This will slightly change the link order; drivers-y from arch Makefile will be linked after virt/built-in.a, but I guess this is not a big deal. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-01kbuild: merge init-y into core-yMasahiro Yamada1-6/+4
No arch Makefile specifies init-y. Merge init-y into core-y. This does not change the link order. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-01kbuild: refactor tagets caluculation for KBUILD_{BUILTIN,KBUILD_MODULES}Masahiro Yamada1-13/+12
Remove lib-target, builtin-target, modorder-target, and modtargets. Instead, add targets-for-builtin and targets-for-modules. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-01kbuild: refactor subdir-ym calculationMasahiro Yamada1-9/+4
Remove the unneeded variables, __subdir-y and __subdir-m. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-01kbuild: merge two 'ifdef CONFIG_TRIM_UNUSED_KSYMS' blocksMasahiro Yamada1-7/+5
This hunk has two 'ifdef CONFIG_TRIM_UNUSED_KSYMS ... endif' blocks with no other code interleaved. Merge them. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-01kbuild: force to build vmlinux if CONFIG_MODVERSION=yMasahiro Yamada1-5/+8
This code does not work as stated in the comment. $(CONFIG_MODVERSIONS) is always empty because it is expanded before include/config/auto.conf is included. Hence, 'make modules' with CONFIG_MODVERSION=y cannot record the version CRCs. This has been broken since 2003, commit ("kbuild: Enable modules to be build using the "make dir/" syntax"). [1] [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=15c6240cdc44bbeef3c4797ec860f9765ef4f1a7 Cc: linux-stable <stable@vger.kernel.org> # v2.5.71+ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-29Makefile: support compressed debug infoNick Desaulniers2-0/+23
As debug information gets larger and larger, it helps significantly save the size of vmlinux images to compress the information in the debug information sections. Note: this debug info is typically split off from the final compressed kernel image, which is why vmlinux is what's used in conjunction with GDB. Minimizing the debug info size should have no impact on boot times, or final compressed kernel image size. All of the debug sections will have a `C` flag set. $ readelf -S <object file> $ bloaty vmlinux.gcc75.compressed.dwarf4 -- \ vmlinux.gcc75.uncompressed.dwarf4 FILE SIZE VM SIZE -------------- -------------- +0.0% +18 [ = ] 0 [Unmapped] -73.3% -114Ki [ = ] 0 .debug_aranges -76.2% -2.01Mi [ = ] 0 .debug_frame -73.6% -2.89Mi [ = ] 0 .debug_str -80.7% -4.66Mi [ = ] 0 .debug_abbrev -82.9% -4.88Mi [ = ] 0 .debug_ranges -70.5% -9.04Mi [ = ] 0 .debug_line -79.3% -10.9Mi [ = ] 0 .debug_loc -39.5% -88.6Mi [ = ] 0 .debug_info -18.2% -123Mi [ = ] 0 TOTAL $ bloaty vmlinux.clang11.compressed.dwarf4 -- \ vmlinux.clang11.uncompressed.dwarf4 FILE SIZE VM SIZE -------------- -------------- +0.0% +23 [ = ] 0 [Unmapped] -65.6% -871 [ = ] 0 .debug_aranges -77.4% -1.84Mi [ = ] 0 .debug_frame -82.9% -2.33Mi [ = ] 0 .debug_abbrev -73.1% -2.43Mi [ = ] 0 .debug_str -84.8% -3.07Mi [ = ] 0 .debug_ranges -65.9% -8.62Mi [ = ] 0 .debug_line -86.2% -40.0Mi [ = ] 0 .debug_loc -42.0% -64.1Mi [ = ] 0 .debug_info -22.1% -122Mi [ = ] 0 TOTAL For x86_64 defconfig + LLVM=1 (before): Elapsed (wall clock) time (h:mm:ss or m:ss): 3:22.03 Maximum resident set size (kbytes): 43856 For x86_64 defconfig + LLVM=1 (after): Elapsed (wall clock) time (h:mm:ss or m:ss): 3:32.52 Maximum resident set size (kbytes): 1566776 Thanks to: Nick Clifton helped us to provide the minimal binutils version. Sedat Dilek found an increase in size of debug .deb package. Cc: Nick Clifton <nickc@redhat.com> Suggested-by: David Blaikie <blaikie@google.com> Reviewed-by: Fangrui Song <maskray@google.com> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-29modpost: refactor sech_name()Masahiro Yamada1-12/+11
Use sym_get_data_by_offset() helper to get access to the .shstrtab section data. No functional change is intended because elf->sechdrs[elf->secindex_strings].sh_addr is 0 for both ET_REL and ET_EXEC object types. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-29modpost: fix potential segmentation fault for addend_i386_rel()Masahiro Yamada1-9/+9
This may not be a practical problem, but the second pass of ARCH=i386 modpost causes segmentation fault if the -s option is not passed. MODPOST 12 modules Segmentation fault (core dumped) make[2]: *** [scripts/Makefile.modpost:94: __modpost] Error 139 make[1]: *** [Makefile:1339: modules] Error 2 make[1]: *** Waiting for unfinished jobs.... The segmentation fault occurs when section_rel() is called for vmlinux, which is untested in regular builds. The cause of the problem is reloc_location() returning a wrong pointer for ET_EXEC object type. In this case, you need to subtract sechdr->sh_addr, otherwise it would get access beyond the mmap'ed memory. Add sym_get_data_by_offset() helper to avoid code duplication. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-29kbuild: disallow multi-word in M= or KBUILD_EXTMODMasahiro Yamada2-1/+4
$(firstword ...) in scripts/Makefile.modpost was added by commit 3f3fd3c05585 ("[PATCH] kbuild: allow multi-word $M in Makefile.modpost") to build multiple external module directories. It was a solution to resolve symbol dependencies when an external module depends on another external module. Commit 0d96fb20b7ed ("kbuild: Add new Kbuild variable KBUILD_EXTRA_SYMBOLS") introduced another solution by passing symbol info via KBUILD_EXTRA_SYMBOLS, then broke the multi-word M= support. include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \ $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile) ... does not work if KBUILD_EXTMOD contains multiple words. This feature has been broken for more than a decade. Remove the bitrotten code, and stop parsing if M or KBUILD_EXTMOD contains multiple words. As Documentation/kbuild/modules.rst explains, if your module depends on another one, there are two solutions: - add a common top-level Kbuild file - use KBUILD_EXTRA_SYMBOLS Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-26kbuild: make modules.order rule consistent with built-in.aMasahiro Yamada2-4/+8
built-in.a contains the built-in object paths from the current and sub directories. module.order collects the module paths from the current and sub directories. Make their build rules look more symmetrical. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-26kbuild: rename subdir-obj-y to subdir-builtinMasahiro Yamada1-4/+5
I think subdir-builtin is clearer. While I was here, I made its build rule explicit. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-26kbuild: move subdir-obj-y to scripts/Makefile.buildMasahiro Yamada2-5/+2
Save $(addprefix ...) for subdir-obj-y. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-26kbuild: clear KBUILD_MODULES in top Makefile if CONFIG_MODULES=nMasahiro Yamada2-1/+5
Do not try to build any module-related artifacts when CONFIG_MODULES is disabled. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>