- Dec 28, 2023
-
-
Íñigo Huguet authored
EditorConfig is a specification to define the most basic code formatting stuff, and it's supported by many editors and IDEs, either directly or via plugins, including VSCode/VSCodium, Vim, emacs and more. It allows to define formatting style related to indentation, charset, end of lines and trailing whitespaces. It also allows to apply different formats for different files based on wildcards, so for example it is possible to apply different configs to *.{c,h}, *.py and *.rs. In linux project, defining a .editorconfig might help to those people that work on different projects with different indentation styles, so they cannot define a global style. Now they will directly see the correct indentation on every fresh clone of the project. See https://editorconfig.org Co-developed-by:
Danny Lin <danny@kdrag0n.dev> Signed-off-by:
Danny Lin <danny@kdrag0n.dev> Signed-off-by:
Íñigo Huguet <ihuguet@redhat.com> Acked-by:
Mickaël Salaün <mic@digikod.net> Reviewed-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Tested-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Oct 03, 2023
-
-
Masahiro Yamada authored
kernel.spec is the last piece that resides outside the rpmbuild/ directory. Move all the RPM-related files to rpmbuild/ consistently. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org> Reviewed-by:
Nathan Chancellor <nathan@kernel.org> Tested-by:
Nathan Chancellor <nathan@kernel.org>
-
- Jul 24, 2023
-
-
Masahiro Yamada authored
Now kernel.spec and binkernel.spec have the exactly same contents. Use kernel.spec for binrpm-pkg as well. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Jul 04, 2023
-
-
Linus Torvalds authored
This reverts commit 534066a9. It's actively detrimental in that it hides files that shouldn't be hidden. If I have some b4 mbx file in my git directory, it either was already applied with "git am" and is now stale, or maybe it's waiting for that to happen. In neither case is "ignore it" the right option. Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Jun 22, 2023
-
-
Masahiro Yamada authored
When CONFIG_TRIM_UNUSED_KSYMS is enabled, Kbuild recursively traverses the directory tree to determine which EXPORT_SYMBOL to trim. If an EXPORT_SYMBOL turns out to be unused by anyone, Kbuild begins the second traverse, where some source files are recompiled with their EXPORT_SYMBOL() tuned into a no-op. Linus stated negative opinions about this slowness in commits: - 5cf0fd59 ("Kbuild: disable TRIM_UNUSED_KSYMS option") - a555bdd0 ("Kbuild: enable TRIM_UNUSED_KSYMS again, with some guarding") We can do this better now. The final data structures of EXPORT_SYMBOL are generated by the modpost stage, so modpost can selectively emit KSYMTAB entries that are really used by modules. Commit f73edc89 ("kbuild: unify two modpost invocations") is another ground-work to do this in a one-pass algorithm. With the list of modules, modpost sets sym->used if it is used by a module. modpost emits KSYMTAB only for symbols with sym->used==true. BTW, Nicolas explained why the trimming was implemented with recursion: https://lore.kernel.org/all/2o2rpn97-79nq-p7s2-nq5-8p83391473r@syhkavp.arg/ Actually, we never achieved that level of optimization where the chain reaction of trimming comes into play because: - CONFIG_LTO_CLANG cannot remove any unused symbols - CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is enabled only for vmlinux, but not modules If deeper trimming is required, we need to revisit this, but I guess that is unlikely to happen. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Apr 20, 2023
-
-
Chuck Lever authored
Circumvent the .gitignore wildcard to avoid warnings about ignored .kunitconfig files. As far as I can tell, the warnings are harmless and these files are not actually ignored. Reported-by:
kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/oe-kbuild-all/202304142337.jc4oUrov-lkp@intel.com/ Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Signed-off-by:
Jakub Kicinski <kuba@kernel.org>
-
- Apr 05, 2023
-
-
Andy Shevchenko authored
There are almost dozen of .kunitconfig files that are ignored but tracked. Unignore them. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
David Gow <davidgow@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
- Mar 16, 2023
-
-
Masahiro Yamada authored
Prepare to add more files to the source RPM. Also, fix the build error when KCONFIG_CONFIG is set: error: Bad file: ./.config: No such file or directory Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Feb 05, 2023
-
-
Masahiro Yamada authored
The 'b4' command creates a *.mbx file, and also a *.cover file if the patch set has a cover-letter. Ignore them. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org> Reviewed-by:
Nicolas Schier <nicolas@fjasle.eu> Reviewed-by:
Nick Desaulniers <ndesaulniers@google.com>
-
- Jan 22, 2023
-
-
Masahiro Yamada authored
Recent git versions do not accept the noted command. $ git ls-files -i --exclude-standard fatal: ls-files -i must be used with either -o or -c The -c was implied before, but we need to make it explicit since git commit b338e9f66873 ("ls-files: error out on -i unless -o or -c are specified"). Also, replace --exclude-standard with --exclude-per-directory=.gitignore so that everyone will get consistent results. git-ls-files(1) says: --exclude-standard Add the standard Git exclusions: .git/info/exclude, .gitignore in each directory, and the user's global exclusion file. We cannot predict what is locally added to .git/info/exclude or the user's global exclusion file. We can only manage .gitignore files committed to the repository. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org> Reviewed-by:
Miguel Ojeda <ojeda@kernel.org>
-
- Dec 30, 2022
-
-
Masahiro Yamada authored
Previously, *.rpm files were created under $HOME/rpmbuild/, but since commit 8818039f ("kbuild: add ability to make source rpm buildable using koji"), srcrpm-pkg creates the source rpm in the kernel tree because it sets '_srcrpmdir'. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Nov 18, 2022
-
-
Andrew Davis authored
%.dtbo.o and %.dtbo.S files are used to build-in DT Overlay. They should should not be removed by Make or the kernel will be needlessly rebuilt. These should be removed by "clean" and ignored by git like other intermediate files. Reported-by:
Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by:
Andrew Davis <afd@ti.com> Fixes: 941214a5 ("kbuild: Allow DTB overlays to built into .dtbo.S files") Tested-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by:
Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.kernel.org/r/20221114205939.27994-1-afd@ti.com Signed-off-by:
Rob Herring <robh@kernel.org>
-
- Sep 28, 2022
-
-
Miguel Ojeda authored
Having most of the new files in place, we now enable Rust support in the build system, including `Kconfig` entries related to Rust, the Rust configuration printer and a few other bits. Reviewed-by:
Kees Cook <keescook@chromium.org> Reviewed-by:
Nick Desaulniers <ndesaulniers@google.com> Tested-by:
Nick Desaulniers <ndesaulniers@google.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Co-developed-by:
Alex Gaynor <alex.gaynor@gmail.com> Signed-off-by:
Alex Gaynor <alex.gaynor@gmail.com> Co-developed-by:
Finn Behrens <me@kloenk.de> Signed-off-by:
Finn Behrens <me@kloenk.de> Co-developed-by:
Adam Bratschi-Kaye <ark.email@gmail.com> Signed-off-by:
Adam Bratschi-Kaye <ark.email@gmail.com> Co-developed-by:
Wedson Almeida Filho <wedsonaf@google.com> Signed-off-by:
Wedson Almeida Filho <wedsonaf@google.com> Co-developed-by:
Michael Ellerman <mpe@ellerman.id.au> Signed-off-by:
Michael Ellerman <mpe@ellerman.id.au> Co-developed-by:
Sven Van Asbroeck <thesven73@gmail.com> Signed-off-by:
Sven Van Asbroeck <thesven73@gmail.com> Co-developed-by:
Gary Guo <gary@garyguo.net> Signed-off-by:
Gary Guo <gary@garyguo.net> Co-developed-by:
Boris-Chengbiao Zhou <bobo1239@web.de> Signed-off-by:
Boris-Chengbiao Zhou <bobo1239@web.de> Co-developed-by:
Boqun Feng <boqun.feng@gmail.com> Signed-off-by:
Boqun Feng <boqun.feng@gmail.com> Co-developed-by:
Douglas Su <d0u9.su@outlook.com> Signed-off-by:
Douglas Su <d0u9.su@outlook.com> Co-developed-by:
Dariusz Sosnowski <dsosnowski@dsosnowski.pl> Signed-off-by:
Dariusz Sosnowski <dsosnowski@dsosnowski.pl> Co-developed-by:
Antonio Terceiro <antonio.terceiro@linaro.org> Signed-off-by:
Antonio Terceiro <antonio.terceiro@linaro.org> Co-developed-by:
Daniel Xu <dxu@dxuuu.xyz> Signed-off-by:
Daniel Xu <dxu@dxuuu.xyz> Co-developed-by:
Björn Roy Baron <bjorn3_gh@protonmail.com> Signed-off-by:
Björn Roy Baron <bjorn3_gh@protonmail.com> Co-developed-by:
Martin Rodriguez Reboredo <yakoyoku@gmail.com> Signed-off-by:
Martin Rodriguez Reboredo <yakoyoku@gmail.com> Signed-off-by:
Miguel Ojeda <ojeda@kernel.org>
-
Miguel Ojeda authored
This is the configuration file for the `rustfmt` tool. `rustfmt` is a tool for formatting Rust code according to style guidelines. It is very commonly used across Rust projects. The default configuration options are used. Reviewed-by:
Kees Cook <keescook@chromium.org> Co-developed-by:
Alex Gaynor <alex.gaynor@gmail.com> Signed-off-by:
Alex Gaynor <alex.gaynor@gmail.com> Co-developed-by:
Wedson Almeida Filho <wedsonaf@google.com> Signed-off-by:
Wedson Almeida Filho <wedsonaf@google.com> Signed-off-by:
Miguel Ojeda <ojeda@kernel.org>
-
Miguel Ojeda authored
The `generate_rust_analyzer.py` script generates the configuration file (`rust-project.json`) for rust-analyzer. rust-analyzer is a modular compiler frontend for the Rust language. It provides an LSP server which can be used in editors such as VS Code, Emacs or Vim. Reviewed-by:
Kees Cook <keescook@chromium.org> Co-developed-by:
Alex Gaynor <alex.gaynor@gmail.com> Signed-off-by:
Alex Gaynor <alex.gaynor@gmail.com> Co-developed-by:
Finn Behrens <me@kloenk.de> Signed-off-by:
Finn Behrens <me@kloenk.de> Co-developed-by:
Wedson Almeida Filho <wedsonaf@google.com> Signed-off-by:
Wedson Almeida Filho <wedsonaf@google.com> Co-developed-by:
Gary Guo <gary@garyguo.net> Signed-off-by:
Gary Guo <gary@garyguo.net> Co-developed-by:
Boris-Chengbiao Zhou <bobo1239@web.de> Signed-off-by:
Boris-Chengbiao Zhou <bobo1239@web.de> Co-developed-by:
Björn Roy Baron <bjorn3_gh@protonmail.com> Signed-off-by:
Björn Roy Baron <bjorn3_gh@protonmail.com> Signed-off-by:
Miguel Ojeda <ojeda@kernel.org>
-
- May 07, 2022
-
-
Masahiro Yamada authored
The *.mod files have two lines; the first line lists the member objects of the module, and the second line, if CONFIG_TRIM_UNUSED_KSYMS=y, lists the undefined symbols. Currently, we generate *.mod after constructing composite modules, otherwise, we cannot compute the second line. No prerequisite is required to print the first line. They are orthogonal. Splitting them into separate commands will ease further cleanups. This commit splits the list of undefined symbols out to *.usyms files. Previously, the list of undefined symbols ended up with a very long line, but now it has one symbol per line. Use sed like we did before commit 7d32358b ("kbuild: avoid split lines in .mod files"). Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org> Reviewed-by:
Nicolas Schier <nicolas@fjasle.eu>
-
- May 01, 2021
-
-
Masahiro Yamada authored
modules.builtin used to be created in every directory. Since commit 8b41fc44 ("kbuild: create modules.builtin without Makefile.modbuiltin or tristate.conf"), modules.builtin is created only in the top directory. Add the '/' prefix so that it matches to only the modules.builtin located in the top directory. It has been more than one year since that change. I hope this will not flood 'Untracked files' of 'git status'. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Masahiro Yamada authored
For consistency, move tags and TAGS close to the cscope and GNU Global patterns. I removed the '/' prefix in case somebody wants to manually create tag files in sub-directories. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Apr 24, 2021
-
-
Masahiro Yamada authored
The external module build shows the following warning if Module.symvers is missing in the kernel tree. WARNING: Symbol version dump "Module.symvers" is missing. Modules may not have dependencies or modversions. I think this is an important heads-up because the resulting modules may not work as expected. This happens when you did not build the entire kernel tree, for example, you might have prepared the minimal setups for external modules by 'make defconfig && make modules_preapre'. A problem is that 'make modules' creates Module.symvers even without vmlinux. In this case, that warning is suppressed since Module.symvers already exists in spite of its incomplete content. The incomplete (i.e. invalid) Module.symvers should not be created. This commit changes the second pass of modpost to dump symbols into modules-only.symvers. The final Module.symvers is created by concatenating vmlinux.symvers and modules-only.symvers if both exist. Module.symvers is supposed to collect symbols from both vmlinux and modules. It might be a bit confusing, and I am not quite sure if it is an official interface, but presumably it is difficult to rename it because some tools (e.g. kmod) parse it. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
Rasmus Villemoes authored
It can be quite useful to have ld emit a link map file, in order to debug or verify that special sections end up where they are supposed to, and to see what LD_DEAD_CODE_DATA_ELIMINATION manages to get rid of. The only reason I'm not just adding this unconditionally is that the .map file can be rather large (several MB), and that's a waste of space when one isn't interested in these things. Also make it depend on CONFIG_EXPERT. Signed-off-by:
Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Feb 04, 2021
-
-
Viresh Kumar authored
Add support for building DT overlays (%.dtbo). The overlay's source file will have the usual extension, i.e. .dts, though the blob will have .dtbo extension to distinguish it from normal blobs. Acked-by:
Masahiro Yamada <masahiroy@kernel.org> Signed-off-by:
Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by:
Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/434ba2467dd0cd011565625aeb3450650afe0aae.1611904394.git.viresh.kumar@linaro.org
-
- Jan 14, 2021
-
-
Sami Tolvanen authored
With CONFIG_MODVERSIONS, version information is linked into each compilation unit that exports symbols. With LTO, we cannot use this method as all C code is compiled into LLVM bitcode instead. This change collects symbol versions into .symversions files and merges them in link-vmlinux.sh where they are all linked into vmlinux.o at the same time. Signed-off-by:
Sami Tolvanen <samitolvanen@google.com> Reviewed-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20201211184633.3213045-4-samitolvanen@google.com
-
- Sep 10, 2020
-
-
Mauro Carvalho Chehab authored
The default way of building documentation is to use Sphinx toolchain installed via pip, inside the Kernel tree main directory. That's what's recommended by: scripts/sphinx-pre-install As it usually provides a better version of this package than the one installed, specially on LTS distros. So, add the directories created by running the commands suggested by the script. Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/ac4e23d556c7d95cb11d6d5c605f43e425b2c3c7.1599660067.git.mchehab+huawei@kernel.org Signed-off-by:
Jonathan Corbet <corbet@lwn.net>
-
- Jul 31, 2020
-
-
Adam Borowski authored
For now, that's arch/x86/boot/compressed/vmlinux.bin.zst but probably more will come, thus let's be consistent with all other compressors. Signed-off-by:
Adam Borowski <kilobyte@angband.pl> Signed-off-by:
Nick Terrell <terrelln@fb.com> Signed-off-by:
Ingo Molnar <mingo@kernel.org> Tested-by:
Sedat Dilek <sedat.dilek@gmail.com> Reviewed-by:
Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20200730190841.2071656-8-nickrterrell@gmail.com
-
- Jul 05, 2020
-
-
Paul Menzel authored
Running `make savedefconfig` creates by default `defconfig`, which is, currently, on git’s radar, for example, `git status` lists this file as untracked. So, add the file to `.gitignore`, so it’s ignored by git. Signed-off-by:
Paul Menzel <pmenzel@molgen.mpg.de> Acked-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Jun 06, 2020
-
-
Masahiro Yamada authored
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>
-
- Mar 25, 2020
-
-
Masahiro Yamada authored
Add SPDX License Identifier to all .gitignore files. Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- Mar 02, 2020
-
-
Christophe Leroy authored
Commit 68ca0fd2 ("selftest/lkdtm: Don't pollute 'git status'") introduced patterns for git to ignore files generated in tools/testing/selftests/lkdtm/ Use local .gitignore file instead of using the root one. Fixes: 68ca0fd2 ("selftest/lkdtm: Don't pollute 'git status'") Signed-off-by:
Christophe Leroy <christophe.leroy@c-s.fr> Acked-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
- Feb 20, 2020
-
-
Christophe Leroy authored
Commit 46d1a0f0 ("selftests/lkdtm: Add tests for LKDTM targets") added generation of lkdtm test scripts. Ignore those generated scripts when performing 'git status' Fixes: 46d1a0f0 ("selftests/lkdtm: Add tests for LKDTM targets") Signed-off-by:
Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org>
-
- Nov 11, 2019
-
-
Masahiro Yamada authored
The modpost, with the -d option given, generates per-module .ns_deps files. Kbuild generates per-module .mod files to carry module information. This is convenient because Make handles multiple jobs in parallel when the -j option is given. On the other hand, the modpost always runs as a single thread. I do not see a strong reason to produce separate .ns_deps files. This commit changes the modpost to generate just one file, modules.nsdeps, each line of which has the following format: <module_name>: <list of missing namespaces> Please note it contains *missing* namespaces instead of required ones. So, modules.nsdeps is empty if the namespace dependency is all good. This will work more efficiently because spatch will no longer process already imported namespaces. I removed the '(if needed)' from the nsdeps log since spatch is invoked only when needed. This also solves the stale .ns_deps problem reported by Jessica Yu: https://lkml.org/lkml/2019/10/28/467 Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Tested-by:
Jessica Yu <jeyu@kernel.org> Acked-by:
Jessica Yu <jeyu@kernel.org> Reviewed-by:
Matthias Maennich <maennich@google.com> Tested-by:
Matthias Maennich <maennich@google.com>
-
- Sep 10, 2019
-
-
Matthias Maennich authored
This patch adds an option to modpost to generate a <module>.ns_deps file per module, containing the namespace dependencies for that module. E.g. if the linked module my-module.ko would depend on the symbol myfunc.MY_NS in the namespace MY_NS, the my-module.ns_deps file created by modpost would contain the entry MY_NS to express the namespace dependency of my-module imposed by using the symbol myfunc. These files can subsequently be used by static analysis tools (like coccinelle scripts) to address issues with missing namespace imports. A later patch of this series will introduce such a script 'nsdeps' and a corresponding make target to automatically add missing MODULE_IMPORT_NS() definitions to the module's sources. For that it uses the information provided in the generated .ns_deps files. Co-developed-by:
Martijn Coenen <maco@android.com> Signed-off-by:
Martijn Coenen <maco@android.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Matthias Maennich <maennich@google.com> Signed-off-by:
Jessica Yu <jeyu@kernel.org>
-
- Aug 21, 2019
-
-
Masahiro Yamada authored
The pattern '*.order' was added by commit c6025f4c ("kbuild: ignore *.order files") to ignore modules.order files. I do not see any other user of the '.order' extension. Ignore 'modules.order' explicitly instead of '*.order'. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Jul 27, 2019
-
-
Toru Komatsu authored
This file is used by clangd to use language server protocol. It can be generated at each compile using scripts/gen_compile_commands.py. Therefore it is different depending on the environment and should be ignored. Signed-off-by:
Toru Komatsu <k0ma@utam0k.jp> Reviewed-by:
Nick Desaulniers <ndesaulniers@google.com> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- Jul 17, 2019
-
-
Masahiro Yamada authored
While descending directories, Kbuild produces objects for modules, but do not link final *.ko files; it is done in the modpost. To keep track of modules, Kbuild creates a *.mod file in $(MODVERDIR) for every module it is building. Some post-processing steps read the necessary information from *.mod files. This avoids descending into directories again. This mechanism was introduced in 2003 or so. Later, commit 551559e1 ("kbuild: implement modules.order") added modules.order. So, we can simply read it out to know all the modules with directory paths. This is easier than parsing the first line of *.mod files. $(MODVERDIR) has a flat directory structure, that is, *.mod files are named only with base names. This is based on the assumption that the module name is unique across the tree. This assumption is really fragile. Stephen Rothwell reported a race condition caused by a module name conflict: https://lkml.org/lkml/2019/5/13/991 In parallel building, two different threads could write to the same $(MODVERDIR)/*.mod simultaneously. Non-unique module names are the source of all kind of troubles, hence commit 3a48a919 ("kbuild: check uniqueness of module names") introduced a new checker script. However, it is still fragile in the build system point of view because this race happens before scripts/modules-check.sh is invoked. If it happens again, the modpost will emit unclear error messages. To fix this issue completely, create *.mod with full directory path so that two threads never attempt to write to the same file. $(MODVERDIR) is no longer needed. Since modules with directory paths are listed in modules.order, Kbuild is still able to find *.mod files without additional descending. I also killed cmd_secanalysis; scripts/mod/sumversion.c computes MD4 hash for modules with MODULE_VERSION(). When CONFIG_DEBUG_SECTION_MISMATCH=y, it occurs not only in the modpost stage, but also during directory descending, where sumversion.c may parse stale *.mod files. It would emit 'No such file or directory' warning when an object consisting a module is renamed, or when a single-obj module is turned into a multi-obj module or vice versa. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by:
Nicolas Pitre <nico@fluxnic.net>
-
- Jul 09, 2019
-
-
Masahiro Yamada authored
header-test-y does not work with headers in sub-directories. For example, you may want to write a Makefile, like this: include/linux/Kbuild: header-test-y += mtd/nand.h This entry will create a wrapper include/linux/mtd/nand.hdrtest.c with the following content: #include "mtd/nand.h" To make this work, we need to add $(srctree)/include/linux to the header search path. It would be tedious to add ccflags-y. Instead, we could change the *.hdrtest.c rule to wrap: #include "nand.h" This works for in-tree build since #include "..." searches in the relative path from the header with this directive. For O=... build, we need to add $(srctree)/include/linux/mtd to the header search path, which will be even more tedious. After all, I thought it would be handier to compile headers directly without creating wrappers. I added a new build rule to compile %.h into %.h.s The target is %.h.s instead of %.h.o because it is slightly faster. Also, as for GCC, an empty assembly is smaller than an empty object. I wrote the build rule: $(CC) $(c_flags) -S -o $@ -x c /dev/null -include $< instead of: $(CC) $(c_flags) -S -o $@ -x c $< Both work fine with GCC, but the latter is bad for Clang. This comes down to the difference in the -Wunused-function policy. GCC does not warn about unused 'static inline' functions at all. Clang does not warn about the ones in included headers, but does about the ones in the source. So, we should handle headers as headers, not as source files. In fact, this has been hidden since commit abb2ea7d ("compiler, clang: suppress warning for unused static inline functions"), but we should not rely on that. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by:
Jani Nikula <jani.nikula@intel.com> Tested-by:
Jani Nikula <jani.nikula@intel.com>
-
- Jun 15, 2019
-
-
Jani Nikula authored
Sometimes it's useful to be able to explicitly ensure certain headers remain self-contained, i.e. that they are compilable as standalone units, by including and/or forward declaring everything they depend on. Add special target header-test-y where individual Makefiles can add headers to be tested if CONFIG_HEADER_TEST is enabled. This will generate a dummy C file per header that gets built as part of extra-y. Signed-off-by:
Jani Nikula <jani.nikula@intel.com> Reviewed-by:
Sam Ravnborg <sam@ravnborg.org> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- May 18, 2019
-
-
Masahiro Yamada authored
Also, sort the patterns alphabetically. Update the comment since we have non-git files here. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- May 08, 2019
-
-
Masahiro Yamada authored
For completeness, ignore all the allconfig variants. I added a leading slash because they are only searched in the top of the tree. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
- May 07, 2019
-
-
Alexey Gladkov authored
Problem: When a kernel module is compiled as a separate module, some important information about the kernel module is available via .modinfo section of the module. In contrast, when the kernel module is compiled into the kernel, that information is not available. Information about built-in modules is necessary in the following cases: 1. When it is necessary to find out what additional parameters can be passed to the kernel at boot time. 2. When you need to know which module names and their aliases are in the kernel. This is very useful for creating an initrd image. Proposal: The proposed patch does not remove .modinfo section with module information from the vmlinux at the build time and saves it into a separate file after kernel linking. So, the kernel does not increase in size and no additional information remains in it. Information is stored in the same format as in the separate modules (null-terminated string array). Because the .modinfo section is already exported with a separate modules, we are not creating a new API. It can be easily read in the userspace: $ tr '\0' '\n' < modules.builtin.modinfo ext4.softdep=pre: crc32c ext4.license=GPL ext4.description=Fourth Extended Filesystem ext4.author=Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others ext4.alias=fs-ext4 ext4.alias=ext3 ext4.alias=fs-ext3 ext4.alias=ext2 ext4.alias=fs-ext2 md_mod.alias=block-major-9-* md_mod.alias=md md_mod.description=MD RAID framework md_mod.license=GPL md_mod.parmtype=create_on_open:bool md_mod.parmtype=start_dirty_degraded:int ... Co-Developed-by:
Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org> Signed-off-by:
Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org> Signed-off-by:
Alexey Gladkov <gladkov.alexey@gmail.com> Acked-by:
Jessica Yu <jeyu@kernel.org> Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Clarify these directory paths are relative to the top of the source tree. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com>
-