Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'kbuild-fixes-v5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

- Use the 'python3' command to invoke python scripts because some
distributions do not provide the 'python' command any more.

- Clean-up and update documents

- Use pkg-config to search libcrypto

- Fix duplicated debug flags

- Ignore some more stubs in scripts/kallsyms.c

* tag 'kbuild-fixes-v5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kallsyms: fix nonconverging kallsyms table with lld
kbuild: fix duplicated flags in DEBUG_CFLAGS
scripts/clang-tools: switch explicitly to Python 3
kbuild: remove PYTHON variable
Documentation/llvm: Add a section about supported architectures
Revert "checkpatch: add check for keyword 'boolean' in Kconfig definitions"
scripts: use pkg-config to locate libcrypto
kconfig: mconf: fix HOSTCC call
doc: gcc-plugins: update gcc-plugins.rst
kbuild: simplify GCC_PLUGINS enablement in dummy-tools/gcc
Documentation/Kbuild: Remove references to gcc-plugin.sh
scripts: switch explicitly to Python 3

+94 -55
+1 -1
Documentation/Makefile
··· 75 75 cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \ 76 76 PYTHONDONTWRITEBYTECODE=1 \ 77 77 BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \ 78 - $(PYTHON) $(srctree)/scripts/jobserver-exec \ 78 + $(PYTHON3) $(srctree)/scripts/jobserver-exec \ 79 79 $(SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \ 80 80 $(SPHINXBUILD) \ 81 81 -b $2 \
+21 -26
Documentation/kbuild/gcc-plugins.rst
··· 11 11 We can analyse, change and add further code during compilation via 12 12 callbacks [2]_, GIMPLE [3]_, IPA [4]_ and RTL passes [5]_. 13 13 14 - The GCC plugin infrastructure of the kernel supports all gcc versions from 15 - 4.5 to 6.0, building out-of-tree modules, cross-compilation and building in a 16 - separate directory. 17 - Plugin source files have to be compilable by both a C and a C++ compiler as well 18 - because gcc versions 4.5 and 4.6 are compiled by a C compiler, 19 - gcc-4.7 can be compiled by a C or a C++ compiler, 20 - and versions 4.8+ can only be compiled by a C++ compiler. 14 + The GCC plugin infrastructure of the kernel supports building out-of-tree 15 + modules, cross-compilation and building in a separate directory. 16 + Plugin source files have to be compilable by a C++ compiler. 21 17 22 - Currently the GCC plugin infrastructure supports only the x86, arm, arm64 and 23 - powerpc architectures. 18 + Currently the GCC plugin infrastructure supports only some architectures. 19 + Grep "select HAVE_GCC_PLUGINS" to find out which architectures support 20 + GCC plugins. 24 21 25 22 This infrastructure was ported from grsecurity [6]_ and PaX [7]_. 26 23 ··· 44 47 This is a compatibility header for GCC plugins. 45 48 It should be always included instead of individual gcc headers. 46 49 47 - **$(src)/scripts/gcc-plugin.sh** 48 - 49 - This script checks the availability of the included headers in 50 - gcc-common.h and chooses the proper host compiler to build the plugins 51 - (gcc-4.7 can be built by either gcc or g++). 52 - 53 50 **$(src)/scripts/gcc-plugins/gcc-generate-gimple-pass.h, 54 51 $(src)/scripts/gcc-plugins/gcc-generate-ipa-pass.h, 55 52 $(src)/scripts/gcc-plugins/gcc-generate-simple_ipa-pass.h, 56 53 $(src)/scripts/gcc-plugins/gcc-generate-rtl-pass.h** 57 54 58 55 These headers automatically generate the registration structures for 59 - GIMPLE, SIMPLE_IPA, IPA and RTL passes. They support all gcc versions 60 - from 4.5 to 6.0. 56 + GIMPLE, SIMPLE_IPA, IPA and RTL passes. 61 57 They should be preferred to creating the structures by hand. 62 58 63 59 ··· 58 68 ===== 59 69 60 70 You must install the gcc plugin headers for your gcc version, 61 - e.g., on Ubuntu for gcc-4.9:: 71 + e.g., on Ubuntu for gcc-10:: 62 72 63 - apt-get install gcc-4.9-plugin-dev 73 + apt-get install gcc-10-plugin-dev 64 74 65 75 Or on Fedora:: 66 76 67 77 dnf install gcc-plugin-devel 68 78 69 - Enable a GCC plugin based feature in the kernel config:: 79 + Enable the GCC plugin infrastructure and some plugin(s) you want to use 80 + in the kernel config:: 70 81 71 - CONFIG_GCC_PLUGIN_CYC_COMPLEXITY = y 82 + CONFIG_GCC_PLUGINS=y 83 + CONFIG_GCC_PLUGIN_CYC_COMPLEXITY=y 84 + CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y 85 + ... 72 86 73 - To compile only the plugin(s):: 87 + To compile the minimum tool set including the plugin(s):: 74 88 75 - make gcc-plugins 89 + make scripts 76 90 77 91 or just run the kernel make and compile the whole kernel with 78 92 the cyclomatic complexity GCC plugin. ··· 85 91 4. How to add a new GCC plugin 86 92 ============================== 87 93 88 - The GCC plugins are in $(src)/scripts/gcc-plugins/. You can use a file or a directory 89 - here. It must be added to $(src)/scripts/gcc-plugins/Makefile, 90 - $(src)/scripts/Makefile.gcc-plugins and $(src)/arch/Kconfig. 94 + The GCC plugins are in scripts/gcc-plugins/. You need to put plugin source files 95 + right under scripts/gcc-plugins/. Creating subdirectories is not supported. 96 + It must be added to scripts/gcc-plugins/Makefile, scripts/Makefile.gcc-plugins 97 + and a relevant Kconfig file. 91 98 See the cyc_complexity_plugin.c (CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) GCC plugin.
+44
Documentation/kbuild/llvm.rst
··· 63 63 Currently, the integrated assembler is disabled by default. You can pass 64 64 ``LLVM_IAS=1`` to enable it. 65 65 66 + Supported Architectures 67 + ----------------------- 68 + 69 + LLVM does not target all of the architectures that Linux supports and 70 + just because a target is supported in LLVM does not mean that the kernel 71 + will build or work without any issues. Below is a general summary of 72 + architectures that currently work with ``CC=clang`` or ``LLVM=1``. Level 73 + of support corresponds to "S" values in the MAINTAINERS files. If an 74 + architecture is not present, it either means that LLVM does not target 75 + it or there are known issues. Using the latest stable version of LLVM or 76 + even the development tree will generally yield the best results. 77 + An architecture's ``defconfig`` is generally expected to work well, 78 + certain configurations may have problems that have not been uncovered 79 + yet. Bug reports are always welcome at the issue tracker below! 80 + 81 + .. list-table:: 82 + :widths: 10 10 10 83 + :header-rows: 1 84 + 85 + * - Architecture 86 + - Level of support 87 + - ``make`` command 88 + * - arm 89 + - Supported 90 + - ``LLVM=1`` 91 + * - arm64 92 + - Supported 93 + - ``LLVM=1`` 94 + * - mips 95 + - Maintained 96 + - ``CC=clang`` 97 + * - powerpc 98 + - Maintained 99 + - ``CC=clang`` 100 + * - riscv 101 + - Maintained 102 + - ``CC=clang`` 103 + * - s390 104 + - Maintained 105 + - ``CC=clang`` 106 + * - x86 107 + - Supported 108 + - ``LLVM=1`` 109 + 66 110 Getting Help 67 111 ------------ 68 112
+1 -1
Documentation/kbuild/makefiles.rst
··· 755 755 bits on the scripts nonetheless. 756 756 757 757 Kbuild provides variables $(CONFIG_SHELL), $(AWK), $(PERL), 758 - $(PYTHON) and $(PYTHON3) to refer to interpreters for the respective 758 + and $(PYTHON3) to refer to interpreters for the respective 759 759 scripts. 760 760 761 761 Example::
+4 -3
Makefile
··· 452 452 INSTALLKERNEL := installkernel 453 453 DEPMOD = depmod 454 454 PERL = perl 455 - PYTHON = python 456 455 PYTHON3 = python3 457 456 CHECK = sparse 458 457 BASH = bash ··· 507 508 508 509 export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC 509 510 export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL 510 - export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX 511 + export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX 511 512 export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD 512 513 export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE 513 514 ··· 811 812 KBUILD_CFLAGS += -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang 812 813 endif 813 814 815 + DEBUG_CFLAGS := 816 + 814 817 # Workaround for GCC versions < 5.0 815 818 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801 816 819 ifdef CONFIG_CC_IS_GCC 817 - DEBUG_CFLAGS := $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments)) 820 + DEBUG_CFLAGS += $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments)) 818 821 endif 819 822 820 823 ifdef CONFIG_DEBUG_INFO
+1 -1
arch/ia64/Makefile
··· 69 69 $(call if_changed,objcopy) 70 70 71 71 unwcheck: vmlinux 72 - -$(Q)READELF=$(READELF) $(PYTHON) $(srctree)/arch/ia64/scripts/unwcheck.py $< 72 + -$(Q)READELF=$(READELF) $(PYTHON3) $(srctree)/arch/ia64/scripts/unwcheck.py $< 73 73 74 74 archclean: 75 75
+1 -1
arch/ia64/scripts/unwcheck.py
··· 1 - #!/usr/bin/env python 1 + #!/usr/bin/env python3 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # 4 4 # Usage: unwcheck.py FILE
+6 -2
scripts/Makefile
··· 3 3 # scripts contains sources for various helper programs used throughout 4 4 # the kernel for the build process. 5 5 6 + CRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto) 7 + CRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null) 8 + 6 9 hostprogs-always-$(CONFIG_BUILD_BIN2C) += bin2c 7 10 hostprogs-always-$(CONFIG_KALLSYMS) += kallsyms 8 11 hostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount ··· 17 14 18 15 HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include 19 16 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include 20 - HOSTLDLIBS_sign-file = -lcrypto 21 - HOSTLDLIBS_extract-cert = -lcrypto 17 + HOSTLDLIBS_sign-file = $(CRYPTO_LIBS) 18 + HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS) 19 + HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS) 22 20 23 21 ifdef CONFIG_UNWINDER_ORC 24 22 ifeq ($(ARCH),x86_64)
+1 -1
scripts/bloat-o-meter
··· 1 - #!/usr/bin/env python 1 + #!/usr/bin/env python3 2 2 # 3 3 # Copyright 2004 Matt Mackall <mpm@selenic.com> 4 4 #
-7
scripts/checkpatch.pl
··· 3390 3390 } 3391 3391 } 3392 3392 3393 - # discourage the use of boolean for type definition attributes of Kconfig options 3394 - if ($realfile =~ /Kconfig/ && 3395 - $line =~ /^\+\s*\bboolean\b/) { 3396 - WARN("CONFIG_TYPE_BOOLEAN", 3397 - "Use of boolean is deprecated, please use bool instead.\n" . $herecurr); 3398 - } 3399 - 3400 3393 if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && 3401 3394 ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { 3402 3395 my $flag = $1;
+1 -1
scripts/clang-tools/gen_compile_commands.py
··· 1 - #!/usr/bin/env python 1 + #!/usr/bin/env python3 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # 4 4 # Copyright (C) Google LLC, 2018
+1 -1
scripts/clang-tools/run-clang-tools.py
··· 1 - #!/usr/bin/env python 1 + #!/usr/bin/env python3 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # 4 4 # Copyright (C) Google LLC, 2020
+1 -1
scripts/diffconfig
··· 1 - #!/usr/bin/env python 1 + #!/usr/bin/env python3 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # 4 4 # diffconfig - a tool to compare .config files.
+3 -7
scripts/dummy-tools/gcc
··· 75 75 fi 76 76 fi 77 77 78 - # For scripts/gcc-plugin.sh 78 + # To set GCC_PLUGINS 79 79 if arg_contain -print-file-name=plugin "$@"; then 80 80 plugin_dir=$(mktemp -d) 81 81 82 - sed -n 's/.*#include "\(.*\)"/\1/p' $(dirname $0)/../gcc-plugins/gcc-common.h | 83 - while read header 84 - do 85 - mkdir -p $plugin_dir/include/$(dirname $header) 86 - touch $plugin_dir/include/$header 87 - done 82 + mkdir -p $plugin_dir/include 83 + touch $plugin_dir/include/plugin-version.h 88 84 89 85 echo $plugin_dir 90 86 exit 0
+1 -1
scripts/jobserver-exec
··· 1 - #!/usr/bin/env python 1 + #!/usr/bin/env python3 2 2 # SPDX-License-Identifier: GPL-2.0+ 3 3 # 4 4 # This determines how many parallel tasks "make" is expecting, as it is
+6
scripts/kallsyms.c
··· 112 112 "__crc_", /* modversions */ 113 113 "__efistub_", /* arm64 EFI stub namespace */ 114 114 "__kvm_nvhe_", /* arm64 non-VHE KVM namespace */ 115 + "__AArch64ADRPThunk_", /* arm64 lld */ 116 + "__ARMV5PILongThunk_", /* arm lld */ 117 + "__ARMV7PILongThunk_", 118 + "__ThumbV7PILongThunk_", 119 + "__LA25Thunk_", /* mips lld */ 120 + "__microLA25Thunk_", 115 121 NULL 116 122 }; 117 123
+1 -1
scripts/kconfig/mconf-cfg.sh
··· 35 35 36 36 # As a final fallback before giving up, check if $HOSTCC knows of a default 37 37 # ncurses installation (e.g. from a vendor-specific sysroot). 38 - if echo '#include <ncurses.h>' | "${HOSTCC}" -E - >/dev/null 2>&1; then 38 + if echo '#include <ncurses.h>' | ${HOSTCC} -E - >/dev/null 2>&1; then 39 39 echo cflags=\"-D_GNU_SOURCE\" 40 40 echo libs=\"-lncurses\" 41 41 exit 0