20 Apr, 2020

1 commit


13 Apr, 2020

1 commit


09 Apr, 2020

2 commits

  • As Documentation/kbuild/llvm.rst implies, building the kernel with a
    full set of LLVM tools gets very verbose and unwieldy.

    Provide a single switch LLVM=1 to use Clang and LLVM tools instead
    of GCC and Binutils. You can pass it from the command line or as an
    environment variable.

    Please note LLVM=1 does not turn on the integrated assembler. You need
    to pass LLVM_IAS=1 to use it. When the upstream kernel is ready for the
    integrated assembler, I think we can make it default.

    We discussed what we need, and we agreed to go with a simple boolean
    flag that switches both target and host tools:

    https://lkml.org/lkml/2020/3/28/494
    https://lkml.org/lkml/2020/4/3/43

    Some items discussed, but not adopted:

    - LLVM_DIR

    When multiple versions of LLVM are installed, I just thought supporting
    LLVM_DIR=/path/to/my/llvm/bin/ might be useful.

    CC = $(LLVM_DIR)clang
    LD = $(LLVM_DIR)ld.lld
    ...

    However, we can handle this by modifying PATH. So, we decided to not do
    this.

    - LLVM_SUFFIX

    Some distributions (e.g. Debian) package specific versions of LLVM with
    naming conventions that use the version as a suffix.

    CC = clang$(LLVM_SUFFIX)
    LD = ld.lld(LLVM_SUFFIX)
    ...

    will allow a user to pass LLVM_SUFFIX=-11 to use clang-11 etc.,
    but the suffixed versions in /usr/bin/ are symlinks to binaries in
    /usr/lib/llvm-#/bin/, so this can also be handled by PATH.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Nathan Chancellor
    Tested-by: Nathan Chancellor # build
    Tested-by: Nick Desaulniers
    Reviewed-by: Nick Desaulniers

    Masahiro Yamada
     
  • The 'AS' variable is unused for building the kernel. Only the remaining
    usage is to turn on the integrated assembler. A boolean flag is a better
    fit for this purpose.

    AS=clang was added for experts. So, I replaced it with LLVM_IAS=1,
    breaking the backward compatibility.

    Suggested-by: Nick Desaulniers
    Signed-off-by: Masahiro Yamada
    Reviewed-by: Nathan Chancellor
    Reviewed-by: Nick Desaulniers

    Masahiro Yamada
     

08 Apr, 2020

2 commits

  • Kbuild supports not only obj-y but also lib-y to list objects linked to
    vmlinux.

    The difference between them is that all the objects from obj-y are
    forcibly linked to vmlinux, whereas the objects from lib-y are linked
    as needed; if there is no user of a lib-y object, it is not linked.

    lib-y is intended to list utility functions that may be called from all
    over the place (and may be unused at all), but it is a problem for
    EXPORT_SYMBOL(). Even if there is no call-site in the vmlinux, we need
    to keep exported symbols for the use from loadable modules.

    Commit 7f2084fa55e6 ("[kbuild] handle exports in lib-y objects reliably")
    worked around it by linking a dummy object, lib-ksyms.o, which contains
    references to all the symbols exported from lib.a in that directory.
    It uses the linker script command, EXTERN. Unfortunately, the meaning of
    EXTERN of ld.lld is different from that of ld.bfd. Therefore, this does
    not work with LD=ld.lld (CBL issue #515).

    Anyway, the build rule of lib-ksyms.o is somewhat tricky. So, I want to
    get rid of it.

    At first, I was thinking of accumulating lib-y objects into obj-y
    (or even replacing lib-y with obj-y entirely), but the lib-y syntax
    is used beyond the ordinary use in lib/ and arch/*/lib/.

    Examples:

    - drivers/firmware/efi/libstub/Makefile builds lib.a, which is linked
    into vmlinux in the own way (arm64), or linked to the decompressor
    (arm, x86).

    - arch/alpha/lib/Makefile builds lib.a which is linked not only to
    vmlinux, but also to bootloaders in arch/alpha/boot/Makefile.

    - arch/xtensa/boot/lib/Makefile builds lib.a for use from
    arch/xtensa/boot/boot-redboot/Makefile.

    One more thing, adding everything to obj-y would increase the vmlinux
    size of allnoconfig (or tinyconfig).

    For less impact, I tweaked the destination of lib.a at the top Makefile;
    when CONFIG_MODULES=y, lib.a goes to KBUILD_VMLINUX_OBJS, which is
    forcibly linked to vmlinux, otherwise lib.a goes to KBUILD_VMLINUX_LIBS
    as before.

    The size impact for normal usecases is quite small since at lease one
    symbol in every lib-y object is eventually called by someone. In case
    you are intrested, here are the figures.

    x86_64_defconfig:

    text data bss dec hex filename
    19566602 5422072 1589328 26578002 1958c52 vmlinux.before
    19566932 5422104 1589328 26578364 1958dbc vmlinux.after

    The case with the biggest impact is allnoconfig + CONFIG_MODULES=y.

    ARCH=x86 allnoconfig + CONFIG_MODULES=y:

    text data bss dec hex filename
    1175162 254740 1220608 2650510 28718e vmlinux.before
    1177974 254836 1220608 2653418 287cea vmlinux.after

    Hopefully this is still not a big deal. The per-file trimming with the
    static library is not so effective after all.

    If fine-grained optimization is desired, some architectures support
    CONFIG_LD_DEAD_CODE_DATA_ELIMINATION, which trims dead code per-symbol
    basis. When LTO is supported in mainline, even better optimization will
    be possible.

    Link: https://github.com/ClangBuiltLinux/linux/issues/515
    Signed-off-by: Masahiro Yamada
    Reported-by: kbuild test robot
    Reviewed-by: Nick Desaulniers

    Masahiro Yamada
     
  • Currently, we disable -Wtautological-compare, which in turn disables a
    bunch of more specific tautological comparison warnings that are useful
    for the kernel such as -Wtautological-bitwise-compare. See clang's
    documentation below for the other warnings that are suppressed by
    -Wtautological-compare. Now that all of the major/noisy warnings have
    been fixed, enable -Wtautological-compare so that more issues can be
    caught at build time by various continuous integration setups.

    -Wtautological-constant-out-of-range-compare is kept disabled under a
    normal build but visible at W=1 because there are places in the kernel
    where a constant or variable size can change based on the kernel
    configuration. These are not fixed in a clean/concise way and the ones
    I have audited so far appear to be harmless. It is not a subgroup but
    rather just one warning so we do not lose out on much coverage by
    default.

    Link: https://github.com/ClangBuiltLinux/linux/issues/488
    Link: http://releases.llvm.org/10.0.0/tools/clang/docs/DiagnosticsReference.html#wtautological-compare
    Link: https://bugs.llvm.org/show_bug.cgi?id=42666
    Signed-off-by: Nathan Chancellor
    Signed-off-by: Masahiro Yamada

    Nathan Chancellor
     

01 Apr, 2020

2 commits

  • Pull Kbuild updates from Masahiro Yamada:
    "Build system:

    - add CONFIG_UNUSED_KSYMS_WHITELIST, which will be useful to define a
    fixed set of export symbols for Generic Kernel Image (GKI)

    - allow to run 'make dt_binding_check' without .config

    - use full schema for checking DT examples in *.yaml files

    - make modpost fail for missing MODULE_IMPORT_NS(), which makes more
    sense because we know the produced modules are never loadable

    - Remove unused 'AS' variable

    Kconfig:

    - sanitize DEFCONFIG_LIST, and remove ARCH_DEFCONFIG from Kconfig
    files

    - relax the 'imply' behavior so that symbols implied by 'y' can
    become 'm'

    - make 'imply' obey 'depends on' in order to make 'imply' really weak

    Misc:

    - add documentation on building the kernel with Clang/LLVM

    - revive __HAVE_ARCH_STRLEN for 32bit sparc to use optimized strlen()

    - fix warning from deb-pkg builds when CONFIG_DEBUG_INFO=n

    - various script and Makefile cleanups"

    * tag 'kbuild-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits)
    Makefile: Update kselftest help information
    kbuild: deb-pkg: fix warning when CONFIG_DEBUG_INFO is unset
    kbuild: add outputmakefile to no-dot-config-targets
    kbuild: remove AS variable
    net: wan: wanxl: refactor the firmware rebuild rule
    net: wan: wanxl: use $(M68KCC) instead of $(M68KAS) for rebuilding firmware
    net: wan: wanxl: use allow to pass CROSS_COMPILE_M68k for rebuilding firmware
    kbuild: add comment about grouped target
    kbuild: add -Wall to KBUILD_HOSTCXXFLAGS
    kconfig: remove unused variable in qconf.cc
    sparc: revive __HAVE_ARCH_STRLEN for 32bit sparc
    kbuild: refactor Makefile.dtbinst more
    kbuild: compute the dtbs_install destination more simply
    Makefile: disallow data races on gcc-10 as well
    kconfig: make 'imply' obey the direct dependency
    kconfig: allow symbols implied by y to become m
    net: drop_monitor: use IS_REACHABLE() to guard net_dm_hw_report()
    modpost: return error if module is missing ns imports and MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=n
    modpost: rework and consolidate logging interface
    kbuild: allow to run dt_binding_check without kernel configuration
    ...

    Linus Torvalds
     
  • Update kselftest help information.

    Signed-off-by: Shuah Khan
    Signed-off-by: Masahiro Yamada

    Shuah Khan
     

30 Mar, 2020

1 commit


29 Mar, 2020

4 commits

  • The target outputmakefile is used to generate a Makefile
    for out-of-tree builds and does not depend on the kernel
    configuration.

    Signed-off-by: David Engraf
    Signed-off-by: Masahiro Yamada

    David Engraf
     
  • As commit 5ef872636ca7 ("kbuild: get rid of misleading $(AS) from
    documents") noted, we rarely use $(AS) directly in the kernel build.

    Now that the only/last user of $(AS) in drivers/net/wan/Makefile was
    converted to $(CC), $(AS) is no longer used in the build process.

    You can still pass in AS=clang, which is just a switch to turn on
    the LLVM integrated assembler.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Nick Desaulniers
    Tested-by: Nick Desaulniers
    Reviewed-by: Nathan Chancellor

    Masahiro Yamada
     
  • GNU Make commit 8c888d95f618 ("[SV 8297] Implement "grouped targets"
    for explicit rules.") added the '&:' syntax.

    I think '&:' is a perfect fit here, but we cannot use it any time
    soon. Just add a TODO comment.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Add -Wall to catch more warnings for C++ host programs.

    When I submitted the previous version, the 0-day bot reported
    -Wc++11-compat warnings for old GCC:

    HOSTCXX -fPIC scripts/gcc-plugins/latent_entropy_plugin.o
    In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/tm.h:28:0,
    from scripts/gcc-plugins/gcc-common.h:15,
    from scripts/gcc-plugins/latent_entropy_plugin.c:78:
    /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/config/elfos.h:102:21: warning: C++11 requires a space between string literal and macro [-Wc++11-compat]
    fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
    ^
    /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/config/elfos.h:170:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat]
    fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
    ^
    In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/tm.h:42:0,
    from scripts/gcc-plugins/gcc-common.h:15,
    from scripts/gcc-plugins/latent_entropy_plugin.c:78:
    /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/defaults.h:126:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat]
    fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
    ^

    The source of the warnings is in the plugin headers, so we have no
    control of it. I just suppressed them by adding -Wno-c++11-compat to
    scripts/gcc-plugins/Makefile.

    Signed-off-by: Masahiro Yamada
    Acked-by: Kees Cook

    Masahiro Yamada
     

25 Mar, 2020

1 commit


23 Mar, 2020

1 commit


20 Mar, 2020

1 commit

  • …/masahiroy/linux-kbuild

    Pull Kbuild fixes from Masahiro Yamada:

    - fix __uint128_t capability test in Kconfig when GCC that defaults to
    32-bit is used to build the 64-bit kernel

    - suppress new noisy Clang warnings -Wpointer-to-enum-cast

    - move the namespace field in Module.symvers for the backward
    compatibility reason for the depmod tool

    - use available compression for initramdisk when INTRAMFS_SOURCE is
    defined, which was the original behavior

    - fix modpost to handle correct large section numbers when it refers to
    modversion CRCs and module namespaces

    - fix comments and documents

    * tag 'kbuild-fixes-v5.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    scripts/kallsyms: fix wrong kallsyms_relative_base
    modpost: Get proper section index by get_secindex() instead of st_shndx
    initramfs: restore default compression behavior
    modpost: move the namespace field in Module.symvers last
    kbuild: Disable -Wpointer-to-enum-cast
    kbuild: doc: fix references to other documents
    int128: fix __uint128_t compiler test in Kconfig
    kconfig: introduce m32-flag and m64-flag
    kbuild: Fix inconsistent comment

    Linus Torvalds
     

19 Mar, 2020

1 commit


16 Mar, 2020

1 commit


13 Mar, 2020

3 commits

  • The dt_binding_check target is located outside of the
    'ifneq ($(dtstree),) ... endif' block.

    So, you can run 'make dt_binding_check' on any architecture.
    This makes a perfect sense because the dt-schema is arch-agnostic.

    The only one problem I see is that scripts/dtc/dtc is not always built.
    For example, ARCH=x86 defconfig does not define CONFIG_DTC. Kbuild
    descends into scripts/dtc/ with doing nothing. Then, it fails to build
    *.example.dt.yaml files.

    Let's build scripts/dtc/dtc forcibly when running dt_binding_check.

    The dt-schema does not depend on any CONFIG option either, so you
    should be able to run dt_binding_check without the .config file.

    Going forward, you can directly run 'make dt_binding_check' in a
    pristine source tree.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Rob Herring

    Masahiro Yamada
     
  • Since commit 93512dad334d ("dt-bindings: Improve validation build error
    handling"), 'make dtbs_check' does not validate the schema fully.

    If you want to check everything, you need to run two commands separately.

    $ make ARCH=arm dt_binding_check
    $ make ARCH=arm dtbs_check

    They are exclusive each other, so you cannot do like this:

    $ make ARCH=arm dt_binding_check dtbs_check

    In this case, dt-doc-validate and dt-extract-example are skipped
    because CHECK_DTBS is set.

    Let's make it possible to run these two targets in a single command.
    It will be useful for schema writers.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Rob Herring

    Masahiro Yamada
     
  • 'make dtbs_check' checks the shecma in addition to building *.dtb files,
    in other words, 'make dtbs_check' is a super-set of 'make dtbs'.
    So, you do not have to do 'make dtbs dtbs_check', but I want to keep
    the build system as robust as possible in any use.

    Currently, 'dtbs' and 'dtbs_check' are independent of each other.
    In parallel building, two threads descend into arch/*/boot/dts/,
    one for dtbs and the other for dtbs_check, then end up with building
    the same DTB simultaneously.

    This commit fixes the concurrency issue. Otherwise, I see build errors
    like follows:

    $ make ARCH=arm64 defconfig
    $ make -j16 ARCH=arm64 DT_SCHEMA_FILES=Documentation/devicetree/bindings/arm/psci.yaml dtbs dtbs_check

    DTC arch/arm64/boot/dts/qcom/sdm845-cheza-r2.dtb
    DTC arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtb
    DTC arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-lite2.dtb
    DTC arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-lite2.dtb
    DTC arch/arm64/boot/dts/freescale/imx8mn-evk.dtb
    DTC arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dtb
    DTC arch/arm64/boot/dts/zte/zx296718-pcbox.dtb
    DTC arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dt.yaml
    DTC arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dtb
    DTC arch/arm64/boot/dts/xilinx/zynqmp-zc1254-revA.dtb
    DTC arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dtb
    DTC arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet-inx.dtb
    DTC arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dtb
    CHECK arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dt.yaml
    fixdep: error opening file: arch/arm64/boot/dts/allwinner/.sun50i-h6-orangepi-lite2.dtb.d: No such file or directory
    make[2]: *** [scripts/Makefile.lib:296: arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-lite2.dtb] Error 2
    make[2]: *** Deleting file 'arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-lite2.dtb'
    make[2]: *** Waiting for unfinished jobs....
    DTC arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet-kd.dtb
    DTC arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dtb
    DTC arch/arm64/boot/dts/xilinx/zynqmp-zc1275-revA.dtb
    DTC arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dtb
    fixdep: parse error; no targets found
    make[2]: *** [scripts/Makefile.lib:296: arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dtb] Error 1
    make[2]: *** Deleting file 'arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dtb'
    make[1]: *** [scripts/Makefile.build:505: arch/arm64/boot/dts/allwinner] Error 2
    make[1]: *** Waiting for unfinished jobs....
    DTC arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dtb

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Rob Herring

    Masahiro Yamada
     

12 Mar, 2020

1 commit

  • The commit 2042b5486bd3 ("kbuild: unset variables in top Makefile
    instead of setting 0") renamed the variable from "config-targets"
    to "config-build", the comment should be consistent accordingly.

    Signed-off-by: Kaiden PK Yu (余泊鎧)
    Signed-off-by: SZ Lin (林上智)
    Signed-off-by: Masahiro Yamada

    SZ Lin (林上智)
     

09 Mar, 2020

1 commit


03 Mar, 2020

2 commits

  • When doing a cold build, autoksyms.h starts empty, and is updated late
    in the build process to have visibility over the symbols used by in-tree
    drivers. But since the symbol whitelist is known upfront, it can be used
    to pre-populate autoksyms.h and maximize the amount of code that can be
    compiled to its final state in a single pass, hence reducing build time.

    Do this by using gen_autoksyms.sh to initialize autoksyms.h instead of
    creating an empty file.

    Acked-by: Nicolas Pitre
    Tested-by: Matthias Maennich
    Reviewed-by: Matthias Maennich
    Signed-off-by: Quentin Perret
    Signed-off-by: Masahiro Yamada

    Quentin Perret
     
  • Most of the Kconfig commands (except defconfig and all*config) read
    the .config file as a base set of CONFIG options.

    When it does not exist, the files in DEFCONFIG_LIST are searched in
    this order and loaded if found.

    I do not see much sense in the last two lines in DEFCONFIG_LIST.

    [1] ARCH_DEFCONFIG

    The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
    ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.

    arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
    64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
    should be a fixed string because the base config file is loaded before
    the symbol evaluation stage.

    Using KBUILD_DEFCONFIG makes more sense because it is fixed before
    Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
    in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
    with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".

    [2] arch/$(ARCH)/defconfig

    This file path is no longer valid. The defconfig files are always located
    in the arch configs/ directories.

    $ find arch -name defconfig | sort
    arch/alpha/configs/defconfig
    arch/arm64/configs/defconfig
    arch/csky/configs/defconfig
    arch/nds32/configs/defconfig
    arch/riscv/configs/defconfig
    arch/s390/configs/defconfig
    arch/unicore32/configs/defconfig

    The path arch/*/configs/defconfig is already covered by
    "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
    not necessary.

    I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
    the 7 architectures listed above would end up with endless loop of
    syncconfig.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

02 Mar, 2020

2 commits

  • This CONFIG option was added by commit 35bb5b1e0e84 ("Add option to
    enable -Wframe-larger-than= on gcc 4.4"). At that time, the cc-option
    check was needed.

    According to Documentation/process/changes.rst, the current minimal
    supported version of GCC is 4.6, so you can assume GCC supports it.
    Clang supports it as well.

    Remove the cc-option switch and redundant comments.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Nathan Chancellor
    Reviewed-by: Nick Desaulniers

    Masahiro Yamada
     
  • Linus Torvalds
     

27 Feb, 2020

3 commits


24 Feb, 2020

1 commit


17 Feb, 2020

1 commit


10 Feb, 2020

1 commit


06 Feb, 2020

1 commit

  • Currently, the single-target build does not work when two
    or more sub-directories are given:

    $ make fs/ kernel/ lib/
    CALL scripts/checksyscalls.sh
    CALL scripts/atomic/check-atomics.sh
    DESCEND objtool
    make[2]: Nothing to be done for 'kernel/'.
    make[2]: Nothing to be done for 'fs/'.
    make[2]: Nothing to be done for 'lib/'.

    Make it work properly.

    Reported-by: Linus Torvalds
    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

02 Feb, 2020

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - detect missing include guard in UAPI headers

    - do not create orphan built-in.a or obj-y objects

    - generate modules.builtin more simply, and drop tristate.conf

    - simplify built-in initramfs creation

    - make linux-headers deb package thinner

    - optimize the deb package build script

    - misc cleanups

    * tag 'kbuild-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits)
    builddeb: split libc headers deployment out into a function
    builddeb: split kernel headers deployment out into a function
    builddeb: remove redundant make for ARCH=um
    builddeb: avoid invoking sub-shells where possible
    builddeb: remove redundant $objtree/
    builddeb: match temporary directory name to the package name
    builddeb: remove unneeded files in hdrobjfiles for headers package
    kbuild: use -S instead of -E for precise cc-option test in Kconfig
    builddeb: allow selection of .deb compressor
    kbuild: remove 'Building modules, stage 2.' log
    kbuild: remove *.tmp file when filechk fails
    kbuild: remove PYTHON2 variable
    modpost: assume STT_SPARC_REGISTER is defined
    gen_initramfs.sh: remove intermediate cpio_list on errors
    initramfs: refactor the initramfs build rules
    gen_initramfs.sh: always output cpio even without -o option
    initramfs: add default_cpio_list, and delete -d option support
    initramfs: generate dependency list and cpio at the same time
    initramfs: specify $(src)/gen_initramfs.sh as a prerequisite in Makefile
    initramfs: make initramfs compression choice non-optional
    ...

    Linus Torvalds
     

27 Jan, 2020

1 commit


20 Jan, 2020

1 commit


15 Jan, 2020

1 commit


13 Jan, 2020

1 commit


07 Jan, 2020

1 commit

  • Commit bc081dd6e9f6 ("kbuild: generate modules.builtin") added
    infrastructure to generate modules.builtin, the list of all
    builtin modules.

    Basically, it works like this:

    - Kconfig generates include/config/tristate.conf, the list of
    tristate CONFIG options with a value in a capital letter.

    - scripts/Makefile.modbuiltin makes Kbuild descend into
    directories to collect the information of builtin modules.

    I am not a big fan of it because Kbuild ends up with traversing
    the source tree twice.

    I am not sure how perfectly it should work, but this approach cannot
    avoid false positives; even if the relevant CONFIG option is tristate,
    some Makefiles forces obj-m to obj-y.

    Some examples are:

    arch/powerpc/platforms/powermac/Makefile:
    obj-$(CONFIG_NVRAM:m=y) += nvram.o

    net/ipv6/Makefile:
    obj-$(subst m,y,$(CONFIG_IPV6)) += inet6_hashtables.o

    net/netlabel/Makefile:
    obj-$(subst m,y,$(CONFIG_IPV6)) += netlabel_calipso.o

    Nobody has complained about (or noticed) it, so it is probably fine to
    have false positives in modules.builtin.

    This commit simplifies the implementation. Let's exploit the fact
    that every module has MODULE_LICENSE(). (modpost shows a warning if
    MODULE_LICENSE is missing. If so, 0-day bot would already have blocked
    such a module.)

    I added MODULE_FILE to . When the code is being compiled
    as builtin, it will be filled with the file path of the module, and
    collected into modules.builtin.info. Then, scripts/link-vmlinux.sh
    extracts the list of builtin modules out of it.

    This new approach fixes the false-positives above, but adds another
    type of false-positives; non-modular code may have MODULE_LICENSE()
    by mistake. This is not a big deal, it is just the code is always
    orphan. We can clean it up if we like. You can see cleanup examples by:

    $ git log --grep='make.* explicitly non-modular'

    To sum up, this commits deletes lots of code, but still produces almost
    equivalent results. Please note it does not increase the vmlinux size at
    all. As you can see in include/asm-generic/vmlinux.lds.h, the .modinfo
    section is discarded in the link stage.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada