aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2021-02-16Kbuild: Make composite object searching more genericElliot Berman1-4/+8
Reduce repeated logic around expanding composite objects. Signed-off-by: Elliot Berman <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2021-02-16kbuild: use always-y instead of extra-yMasahiro Yamada2-7/+7
As commit d0e628cd817f ("kbuild: doc: clarify the difference between extra-y and always-y") explained, extra-y should be used for listing the prerequisites of vmlinux. These targets are not related to vmlinux. always-y is a better fix. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Rob Herring <[email protected]>
2021-02-16genksyms: remove useless case DOTSMasahiro Yamada1-1/+0
This switch statement does not list out all the cases. Since the 'default' covers all the rest, the 'DOTS' case is unneeded. Signed-off-by: Masahiro Yamada <[email protected]>
2021-02-16genksyms: remove dead code for ST_TABLE_*Masahiro Yamada1-54/+0
No one sets lexstate to ST_TABLE_*. It is is very old code, and I do not know what was the plan at that time. Let's remove the dead code. Signed-off-by: Masahiro Yamada <[email protected]>
2021-02-16genksyms: make source_file a local variable in lexerMasahiro Yamada3-2/+3
This is only used in yylex() in lex.l Signed-off-by: Masahiro Yamada <[email protected]>
2021-02-16kbuild: check the minimum compiler version in KconfigMasahiro Yamada4-39/+88
Paul Gortmaker reported a regression in the GCC version check. [1] If you use GCC 4.8, the build breaks before showing the error message "error Sorry, your version of GCC is too old - please use 4.9 or newer." I do not want to apply his fix-up since it implies we would not be able to remove any cc-option test. Anyway, I admit checking the GCC version in <linux/compiler-gcc.h> is too late. Almost at the same time, Linus also suggested to move the compiler version error to Kconfig time. [2] I unified the two similar scripts, gcc-version.sh and clang-version.sh into cc-version.sh. The old scripts invoked the compiler multiple times (3 times for gcc-version.sh, 4 times for clang-version.sh). I refactored the code so the new one invokes the compiler just once, and also tried my best to use shell-builtin commands where possible. The new script runs faster. $ time ./scripts/clang-version.sh clang 120000 real 0m0.029s user 0m0.012s sys 0m0.021s $ time ./scripts/cc-version.sh clang Clang 120000 real 0m0.009s user 0m0.006s sys 0m0.004s cc-version.sh also shows an error message if the compiler is too old: $ make defconfig CC=clang-9 *** Default configuration is based on 'x86_64_defconfig' *** *** Compiler is too old. *** Your Clang version: 9.0.1 *** Minimum Clang version: 10.0.1 *** scripts/Kconfig.include:46: Sorry, this compiler is not supported. make[1]: *** [scripts/kconfig/Makefile:81: defconfig] Error 1 make: *** [Makefile:602: defconfig] Error 2 The new script takes care of ICC because we have <linux/compiler-intel.h> although I am not sure if building the kernel with ICC is well-supported. [1]: https://lore.kernel.org/r/[email protected] [2]: https://lore.kernel.org/r/CAHk-=wh-+TMHPTFo1qs-MYyK7tZh-OQovA=pP3=e06aCVp6_kA@mail.gmail.com Fixes: 87de84c9140e ("kbuild: remove cc-option test of -Werror=date-time") Reported-by: Paul Gortmaker <[email protected]> Suggested-by: Linus Torvalds <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Tested-by: Nick Desaulniers <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Reviewed-by: Miguel Ojeda <[email protected]> Tested-by: Miguel Ojeda <[email protected]> Tested-by: Sedat Dilek <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2021-02-14Merge tag 'kbuild-fixes-v5.11-3' of ↵Linus Torvalds2-0/+4
git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Fix CONFIG_TRIM_UNUSED_KSYMS build for ppc64 - Use pkg-config for scripts/sign-file.c CFLAGS * tag 'kbuild-fixes-v5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: scripts: set proper OpenSSL include dir also for sign-file sparc: remove wrong comment from arch/sparc/include/asm/Kbuild kbuild: fix CONFIG_TRIM_UNUSED_KSYMS build for ppc64
2021-02-15scripts: set proper OpenSSL include dir also for sign-fileRolf Eike Beer1-0/+1
Fixes: 2cea4a7a1885 ("scripts: use pkg-config to locate libcrypto") Signed-off-by: Rolf Eike Beer <[email protected]> Cc: [email protected] # 5.6.x Signed-off-by: Masahiro Yamada <[email protected]>
2021-02-13scripts/recordmcount.pl: support big endian for ARCH shRong Chen1-1/+5
The kernel test robot reported the following issue: CC [M] drivers/soc/litex/litex_soc_ctrl.o sh4-linux-objcopy: Unable to change endianness of input file(s) sh4-linux-ld: cannot find drivers/soc/litex/.tmp_gl_litex_soc_ctrl.o: No such file or directory sh4-linux-objcopy: 'drivers/soc/litex/.tmp_mx_litex_soc_ctrl.o': No such file The problem is that the format of input file is elf32-shbig-linux, but sh4-linux-objcopy wants to output a file which format is elf32-sh-linux: $ sh4-linux-objdump -d drivers/soc/litex/litex_soc_ctrl.o | grep format drivers/soc/litex/litex_soc_ctrl.o: file format elf32-shbig-linux Link: https://lkml.kernel.org/r/[email protected] Link: https://lore.kernel.org/linux-mm/[email protected] Signed-off-by: Rong Chen <[email protected]> Reported-by: kernel test robot <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: Rich Felker <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2021-02-12of: Remove of_dev_{get,put}()Rob Herring1-1/+0
of_dev_get() and of_dev_put are just wrappers for get_device()/put_device() on a platform_device. There's also already platform_device_{get,put}() wrappers for this purpose. Let's update the few users and remove of_dev_{get,put}(). Cc: Michael Ellerman <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Frank Rowand <[email protected]> Cc: Patrice Chotard <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Julia Lawall <[email protected]> Cc: Gilles Muller <[email protected]> Cc: Nicolas Palix <[email protected]> Cc: Michal Marek <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-02-12Merge branch 'linus' into locking/core, to pick up upstream fixesIngo Molnar13-34/+26
Signed-off-by: Ingo Molnar <[email protected]>
2021-02-12kbuild: LD_VERSION redenominationMasahiro Yamada1-1/+1
Commit ccbef1674a15 ("Kbuild, lto: add ld-version and ld-ifversion macros") introduced scripts/ld-version.sh for GCC LTO. At that time, this script handled 5 version fields because GCC LTO needed the downstream binutils. (https://lkml.org/lkml/2014/4/8/272) The code snippet from the submitted patch was as follows: # We need HJ Lu's Linux binutils because mainline binutils does not # support mixing assembler and LTO code in the same ld -r object. # XXX check if the gcc plugin ld is the expected one too # XXX some Fedora binutils should also support it. How to check for that? ifeq ($(call ld-ifversion,-ge,22710001,y),y) ... However, GCC LTO was not merged into the mainline after all. (https://lkml.org/lkml/2014/4/8/272) So, the 4th and 5th fields were never used, and finally removed by commit 0d61ed17dd30 ("ld-version: Drop the 4th and 5th version components"). Since then, the last 4-digits returned by this script is always zeros. Remove the meaningless last 4-digits. This makes the version format consistent with GCC_VERSION, CLANG_VERSION, LLD_VERSION. Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Will Deacon <[email protected]> Acked-by: Thomas Bogendoerfer <[email protected]>
2021-02-12kbuild: fix CONFIG_TRIM_UNUSED_KSYMS build for ppc64Masahiro Yamada1-0/+3
Stephen Rothwell reported a build error on ppc64 when CONFIG_TRIM_UNUSED_KSYMS is enabled. Jessica Yu pointed out the cause of the error with the reference to the ppc64 ELF ABI: "Symbol names with a dot (.) prefix are reserved for holding entry point addresses. The value of a symbol named ".FN", if it exists, is the entry point of the function "FN". As it turned out, CONFIG_TRIM_UNUSED_KSYMS has never worked for ppc64, but this issue has been unnoticed until recently because this option depends on !UNUSED_SYMBOLS hence is disabled by all{mod,yes}config. (Then, it was uncovered by another patch removing UNUSED_SYMBOLS.) Removing the dot prefix in scripts/gen_autoksyms.sh fixes the issue. Please note it must be done before 'sort -u' because modules have both ._mcount and _mcount undefined when CONFIG_FUNCTION_TRACER=y. Link: https://lore.kernel.org/lkml/[email protected]/ Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: Jessica Yu <[email protected]>
2021-02-10checkpatch: Don't check for mutex_trylock_recursive()Sebastian Andrzej Siewior1-6/+0
mutex_trylock_recursive() has been removed from the tree, there is no need to check for it. Remove traces of mutex_trylock_recursive()'s existence. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
2021-02-08module: remove EXPORT_UNUSED_SYMBOL*Christoph Hellwig4-46/+5
EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the unused functionality as we generally just remove unused code anyway. Reviewed-by: Miroslav Benes <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jessica Yu <[email protected]>
2021-02-08module: remove EXPORT_SYMBOL_GPL_FUTUREChristoph Hellwig3-15/+1
As far as I can tell this has never been used at all, and certainly not any time recently. Reviewed-by: Miroslav Benes <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jessica Yu <[email protected]>
2021-02-05kallsyms: fix nonconverging kallsyms table with lldArnd Bergmann1-0/+6
ARM randconfig builds with lld sometimes show a build failure from kallsyms: Inconsistent kallsyms data Try make KALLSYMS_EXTRA_PASS=1 as a workaround The problem is the veneers/thunks getting added by the linker extend the symbol table, which in turn leads to more veneers being needed, so it may take a few extra iterations to converge. This bug has been fixed multiple times before, but comes back every time a new symbol name is used. lld uses a different set of identifiers from ld.bfd, so the additional ones need to be added as well. I looked through the sources and found that arm64 and mips define similar prefixes, so I'm adding those as well, aside from the ones I observed. I'm not sure about powerpc64, which seems to already be handled through a section match, but if it comes back, the "__long_branch_" and "__plt_" prefixes would have to get added as well. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2021-02-04kbuild: Add support to build overlays (%.dtbo)Viresh Kumar2-0/+8
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 <[email protected]> Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/434ba2467dd0cd011565625aeb3450650afe0aae.1611904394.git.viresh.kumar@linaro.org
2021-02-04scripts: dtc: Remove the unused fdtdump.c fileViresh Kumar1-163/+0
This was copied from external DTC repository long back and isn't used anymore. Over that the dtc tool can be used to generate the dts source back from the dtb. Remove the unused fdtdump.c file. Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/7ea1a9e7fd5d75b7adfc2a4c40dde2d4ea3fddf8.1611904394.git.viresh.kumar@linaro.org
2021-02-04scripts: dtc: Build fdtoverlay toolViresh Kumar1-1/+7
We will start building overlays for platforms soon in the kernel and would need fdtoverlay going forward. Lets start building it. The fdtoverlay program applies one or more overlay dtb blobs to a base dtb blob. The kernel build system would later use fdtoverlay to generate the overlaid blobs based on platform specific configurations. Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/4a201dea3ba11a00cab7e936dfc1140dac1a1ae3.1611904394.git.viresh.kumar@linaro.org
2021-02-04scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9Rob Herring15-71/+350
This adds the following commits from upstream: 183df9e9c2b9 gitignore: Ignore the swp files 0db6d09584e1 gitignore: Add cscope files 307afa1a7be8 Update Jon Loeliger's email ca16a723fa9d fdtdump: Fix gcc11 warning 64990a272e8f srcpos: increase MAX_SRCFILE_DEPTH 163f0469bf2e dtc: Allow overlays to have .dtbo extension 3b01518e688d Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into f7e5737f26aa tests: Fix overlay_overlay_nosugar test case 7cd5d5fe43d5 libfdt: Tweak description of assume-aligned load helpers a7c404099349 libfdt: Internally perform potentially unaligned loads bab85e48a6f4 meson: increase default timeout for tests f8b46098824d meson: do not assume python is installed, skip tests 30a56bce4f0b meson: fix -Wall warning 5e735860c478 libfdt: Check for 8-byte address alignment in fdt_ro_probe_() 67849a327927 build-sys: add meson build 05874d08212d pylibfdt: allow build out of tree 3bc3a6b9fe0c dtc: Fix signedness comparisons warnings: Wrap (-1) e1147b159e92 dtc: Fix signedness comparisons warnings: change types 04cf1fdc0fcf convert-dtsv0: Fix signedness comparisons warning b30013edb878 libfdt: Fix kernel-doc comments Signed-off-by: Rob Herring <[email protected]>
2021-02-03scripts: dtc: Fetch fdtoverlay.c from external DTC projectViresh Kumar1-1/+2
We will start building overlays for platforms soon in the kernel and would need fdtoverlay tool going forward. Lets start fetching it. Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/28f66f70602225bb6aeb58e924c20bde9d864327.1611904394.git.viresh.kumar@linaro.org
2021-02-03scripts/clang-tools: switch explicitly to Python 3Masahiro Yamada2-2/+2
For the same reason as commit 51839e29cb59 ("scripts: switch explicitly to Python 3"), switch some more scripts, which I tested and confirmed working on Python 3. Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Nathan Chancellor <[email protected]>
2021-02-01Docs: drop Python 2 supportJonathan Corbet1-2/+2
The kernel build system as a whole is dropping support for Python 2, so we should do the same. The effects are rather small, especially considering that much of the deleted code was not doing anything under any version of Python anyway. Signed-off-by: Jonathan Corbet <[email protected]>
2021-02-01kbuild: remove PYTHON variableMasahiro Yamada1-1/+1
Python retired in 2020, and some distributions do not provide the 'python' command any more. As in commit 51839e29cb59 ("scripts: switch explicitly to Python 3"), we need to use more specific 'python3' to invoke scripts even if they are written in a way compatible with both Python 2 and 3. This commit removes the variable 'PYTHON', and switches the existing users to 'PYTHON3'. BTW, PEP 394 (https://www.python.org/dev/peps/pep-0394/) is a helpful material. Signed-off-by: Masahiro Yamada <[email protected]>
2021-01-28scripts/kernel-doc: add internal hyperlink to DOC: sectionsMichal Wajdeczko1-0/+1
While DOC: section titles are not converted into RST headings sections and are only decorated with strong emphasis markup, nothing stops us from generating internal hyperlinks for them, to mimic implicit hyperlinks to RST headings. Signed-off-by: Michal Wajdeczko <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Chris Wilson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Corbet <[email protected]>
2021-01-28Revert "checkpatch: add check for keyword 'boolean' in Kconfig definitions"Masahiro Yamada1-7/+0
This reverts commit 327953e9af6c59ad111b28359e59e3ec0cbd71b6. You cannot use 'boolean' since commit b92d804a5179 ("kconfig: drop 'boolean' keyword"). This check is no longer needed. Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Joe Perches <[email protected]>
2021-01-28scripts: use pkg-config to locate libcryptoRolf Eike Beer1-2/+6
Otherwise build fails if the headers are not in the default location. While at it also ask pkg-config for the libs, with fallback to the existing value. Signed-off-by: Rolf Eike Beer <[email protected]> Cc: [email protected] # 5.6.x Signed-off-by: Masahiro Yamada <[email protected]>
2021-01-27ver_linux: Eliminate duplicate code in ldconfig processing logicAlexander Kapshuk1-7/+5
The code that acquires the version strings for libc and libcpp is identical, as is the printversion call. The only difference being the name of the library being printed. Refactor the code by unifying the bits that are common to both libraries. Signed-off-by: Alexander Kapshuk <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-01-27spdxcheck.py: Use Python 3Bert Vermeulen1-1/+1
Python 2.x has been officially EOL'ed for some time, and in any case the git module for it is hard to come by. Signed-off-by: Bert Vermeulen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-01-27kconfig: mconf: fix HOSTCC callEnrico Weigelt, metux IT consult1-1/+1
Commit c0f975af1745 ("kconfig: Support building mconf with vendor sysroot ncurses") introduces a bug when HOSTCC contains parameters: the whole command line is treated as the program name (with spaces in it). Therefore, we have to remove the quotes. Fixes: c0f975af1745 ("kconfig: Support building mconf with vendor sysroot ncurses") Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2021-01-23kbuild: simplify GCC_PLUGINS enablement in dummy-tools/gccMasahiro Yamada1-7/+3
With commit 1e860048c53e ("gcc-plugins: simplify GCC plugin-dev capability test") applied, this hunk can be way simplified because now scripts/gcc-plugins/Kconfig only checks plugin-version.h Signed-off-by: Masahiro Yamada <[email protected]>
2021-01-22scripts: switch explicitly to Python 3Andy Shevchenko2-2/+2
Some distributions are about to switch to Python 3 support only. This means that /usr/bin/python, which is Python 2, is not available anymore. Hence, switch scripts to use Python 3 explicitly. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2021-01-18scripts: kernel-doc: validate kernel-doc markup with the actual namesMauro Carvalho Chehab1-16/+46
Kernel-doc currently expects that the kernel-doc markup to come just before the function/enum/struct/union/typedef prototype. Yet, if it find things like: /** * refcount_add - add a value to a refcount * @i: the value to add to the refcount * @r: the refcount */ static inline void __refcount_add(int i, refcount_t *r, int *oldp); static inline void refcount_add(int i, refcount_t *r); Kernel-doc will do the wrong thing: foobar.h:6: warning: Function parameter or member 'oldp' not described in '__refcount_add' .. c:function:: void __refcount_add (int i, refcount_t *r, int *oldp) add a value to a refcount **Parameters** ``int i`` the value to add to the refcount ``refcount_t *r`` the refcount ``int *oldp`` *undescribed* Basically, it will document "__refcount_add" with the kernel-doc markup for refcount_add. If both functions have the same arguments, this won't even produce any warning! Add a logic to check if the kernel-doc identifier matches the actual name of the C function or data structure that will be documented. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Link: https://lore.kernel.org/r/081546f141a496d6cabb99a4adc140444c705e93.1610610937.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet <[email protected]>
2021-01-14scripts/mod: disable LTO for empty.cSami Tolvanen1-0/+1
With CONFIG_LTO_CLANG, clang generates LLVM IR instead of ELF object files. As empty.o is used for probing target properties, disable LTO for it to produce an object file instead. Signed-off-by: Sami Tolvanen <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-01-14modpost: lto: strip .lto from module namesSami Tolvanen3-10/+21
With LTO, everything is compiled into LLVM bitcode, so we have to link each module into native code before modpost. Kbuild uses the .lto.o suffix for these files, which also ends up in module information. This change strips the unnecessary .lto suffix from the module name. Suggested-by: Bill Wendling <[email protected]> Signed-off-by: Sami Tolvanen <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-01-14init: lto: ensure initcall orderingSami Tolvanen3-2/+289
With LTO, the compiler doesn't necessarily obey the link order for initcalls, and initcall variables need globally unique names to avoid collisions at link time. This change exports __KBUILD_MODNAME and adds the initcall_id() macro, which uses it together with __COUNTER__ and __LINE__ to help ensure these variables have unique names, and moves each variable to its own section when LTO is enabled, so the correct order can be specified using a linker script. The generate_initcall_ordering.pl script uses nm to find initcalls from the object files passed to the linker, and generates a linker script that specifies the same order for initcalls that we would have without LTO. With LTO enabled, the script is called in link-vmlinux.sh through jobserver-exec to limit the number of jobs spawned. Signed-off-by: Sami Tolvanen <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-01-14kbuild: lto: add a default list of used symbolsSami Tolvanen1-0/+5
With CONFIG_LTO_CLANG, LLVM bitcode has not yet been compiled into a binary when the .mod files are generated, which means they don't yet contain references to certain symbols that will be present in the final binaries. This includes intrinsic functions, such as memcpy, memmove, and memset [1], and stack protector symbols [2]. This change adds a default symbol list to use with CONFIG_TRIM_UNUSED_KSYMS when Clang's LTO is used. [1] https://llvm.org/docs/LangRef.html#standard-c-c-library-intrinsics [2] https://llvm.org/docs/LangRef.html#llvm-stackprotector-intrinsic Signed-off-by: Sami Tolvanen <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-01-14kbuild: lto: merge module sectionsSami Tolvanen1-0/+24
LLD always splits sections with LTO, which increases module sizes. This change adds linker script rules to merge the split sections in the final module. Suggested-by: Nick Desaulniers <[email protected]> Signed-off-by: Sami Tolvanen <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-01-14kbuild: lto: fix module versioningSami Tolvanen3-4/+58
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 <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-01-14kbuild: add support for Clang LTOSami Tolvanen4-12/+59
This change adds build system support for Clang's Link Time Optimization (LTO). With -flto, instead of ELF object files, Clang produces LLVM bitcode, which is compiled into native code at link time, allowing the final binary to be optimized globally. For more details, see: https://llvm.org/docs/LinkTimeOptimization.html The Kconfig option CONFIG_LTO_CLANG is implemented as a choice, which defaults to LTO being disabled. To use LTO, the architecture must select ARCH_SUPPORTS_LTO_CLANG and support: - compiling with Clang, - compiling all assembly code with Clang's integrated assembler, - and linking with LLD. While using CONFIG_LTO_CLANG_FULL results in the best runtime performance, the compilation is not scalable in time or memory. CONFIG_LTO_CLANG_THIN enables ThinLTO, which allows parallel optimization and faster incremental builds. ThinLTO is used by default if the architecture also selects ARCH_SUPPORTS_LTO_CLANG_THIN: https://clang.llvm.org/docs/ThinLTO.html To enable LTO, LLVM tools must be used to handle bitcode files, by passing LLVM=1 and LLVM_IAS=1 options to make: $ make LLVM=1 LLVM_IAS=1 defconfig $ scripts/config -e LTO_CLANG_THIN $ make LLVM=1 LLVM_IAS=1 To prepare for LTO support with other compilers, common parts are gated behind the CONFIG_LTO option, and LTO can be disabled for specific files by filtering out CC_FLAGS_LTO. Signed-off-by: Sami Tolvanen <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-01-11Merge 5.11-rc3 into char-misc-nextGreg Kroah-Hartman6-13/+14
We need the char/misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-01-10Merge tag 'kbuild-fixes-v5.11' of ↵Linus Torvalds3-11/+4
git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Search for <ncurses.h> in the default header path of HOSTCC - Tweak the option order to be kind to old BSD awk - Remove 'kvmconfig' and 'xenconfig' shorthands - Fix documentation * tag 'kbuild-fixes-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: Documentation: kbuild: Fix section reference kconfig: remove 'kvmconfig' and 'xenconfig' shorthands lib/raid6: Let $(UNROLL) rules work with macOS userland kconfig: Support building mconf with vendor sysroot ncurses kconfig: config script: add a little user help MAINTAINERS: adjust GCC PLUGINS after gcc-plugin.sh removal
2021-01-08tracing: move function tracer options to KconfigSami Tolvanen1-4/+2
Move function tracer options to Kconfig to make it easier to add new methods for generating __mcount_loc, and to make the options available also when building kernel modules. Note that FTRACE_MCOUNT_USE_* options are updated on rebuild and therefore, work even if the .config was generated in a different environment. Signed-off-by: Sami Tolvanen <[email protected]> Acked-by: Steven Rostedt (VMware) <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-01-07fpga: dfl: add dfl bus support to MODULE_DEVICE_TABLE()Xu Yilun2-0/+17
Device Feature List (DFL) is a linked list of feature headers within the device MMIO space. It is used by FPGA to enumerate multiple sub features within it. Each feature can be uniquely identified by DFL type and feature id, which can be read out from feature headers. A dfl bus helps DFL framework modularize DFL device drivers for different sub features. The dfl bus matches its devices and drivers by DFL type and feature id. This patch adds dfl bus support to MODULE_DEVICE_TABLE() by adding info about struct dfl_device_id in devicetable-offsets.c and add a dfl entry point in file2alias.c. Acked-by: Wu Hao <[email protected]> Signed-off-by: Xu Yilun <[email protected]> Signed-off-by: Wu Hao <[email protected]> Signed-off-by: Matthew Gerlach <[email protected]> Signed-off-by: Russ Weight <[email protected]> Signed-off-by: Moritz Fischer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-01-06gcc-plugins: fix gcc 11 indigestion with plugins...Valdis Klētnieks1-2/+2
Fedora Rawhide has started including gcc 11,and the g++ compiler throws a wobbly when it hits scripts/gcc-plugins: HOSTCXX scripts/gcc-plugins/latent_entropy_plugin.so In file included from /usr/include/c++/11/type_traits:35, from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/system.h:244, from /usr/lib/gcc/x86_64-redhat-linux/11/plugin/include/gcc-plugin.h:28, from scripts/gcc-plugins/gcc-common.h:7, from scripts/gcc-plugins/latent_entropy_plugin.c:78: /usr/include/c++/11/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options. 32 | #error This file requires compiler and library support \ In fact, it works just fine with c++11, which has been in gcc since 4.8, and we now require 4.9 as a minimum. Signed-off-by: Valdis Kletnieks <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/82487.1609006918@turing-police
2021-01-07platform/surface: aggregator: Add dedicated bus and device typeMaximilian Luz2-0/+31
The Surface Aggregator EC provides varying functionality, depending on the Surface device. To manage this functionality, we use dedicated client devices for each subsystem or virtual device of the EC. While some of these clients are described as standard devices in ACPI and the corresponding client drivers can be implemented as platform drivers in the kernel (making use of the controller API already present), many devices, especially on newer Surface models, cannot be found there. To simplify management of these devices, we introduce a new bus and client device type for the Surface Aggregator subsystem. The new device type takes care of managing the controller reference, essentially guaranteeing its validity for as long as the client device exists, thus alleviating the need to manually establish device links for that purpose in the client driver (as has to be done with the platform devices). Signed-off-by: Maximilian Luz <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2021-01-04kconfig: remove 'kvmconfig' and 'xenconfig' shorthandsMasahiro Yamada1-10/+0
Linux 5.10 is out. Remove the 'kvmconfig' and 'xenconfig' shorthands as previously announced. Signed-off-by: Masahiro Yamada <[email protected]>
2021-01-04kconfig: Support building mconf with vendor sysroot ncursesJohn Millikin1-1/+3
Changes the final fallback path in the ncurses locator for mconf to support host compilers with a non-default sysroot. This is similar to the hardcoded search for ncurses under '/usr/include', but can support compilers that keep their default header and library directories elsewhere. For nconfig, do nothing because the only vendor compiler I'm aware of with this layout (Apple Clang) ships an ncurses version that's too old for nconfig anyway. Signed-off-by: John Millikin <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
2021-01-04kconfig: config script: add a little user helpRandy Dunlap1-0/+1
Give the user a clue about the problem along with the 35 lines of usage/help text. Signed-off-by: Randy Dunlap <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: [email protected] Signed-off-by: Masahiro Yamada <[email protected]>