20 May, 2019

1 commit

  • If you want to see if your linker supports a certain flag, then ask the
    linker directly with ld-option (not the compiler with cc-ldoption).
    Checking for linker flag support is an antipattern that complicates the
    usage of various linkers other than bfd via -fuse-ld={bfd|gold|lld}.

    Cc: clang-built-linux@googlegroups.com
    Suggested-by: Masahiro Yamada
    Signed-off-by: Nick Desaulniers
    Signed-off-by: Masahiro Yamada

    Nick Desaulniers
     

07 May, 2019

1 commit

  • 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
    Signed-off-by: Gleb Fotengauer-Malinovskiy
    Signed-off-by: Alexey Gladkov
    Acked-by: Jessica Yu
    Signed-off-by: Masahiro Yamada

    Alexey Gladkov
     

17 Mar, 2019

1 commit

  • Currently, every arch/*/include/uapi/asm/Kbuild explicitly includes
    the common Kbuild.asm file. Factor out the duplicated include directives
    to scripts/Makefile.asm-generic so that no architecture would opt out
    of the mandatory-y mechanism.

    um is not forced to include mandatory-y since it is a very exceptional
    case which does not support UAPI.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

04 Mar, 2019

1 commit

  • There is no more direct user of this macro; it is only used by
    cc-ifversion.

    Calling this macro is not efficient since it invokes the compiler to
    get the compiler version. CONFIG_GCC_VERSION is already calculated in
    the Kconfig stage, so Makefile can reuse it.

    Here is a note about the slight difference between cc-version and
    CONFIG_GCC_VERSION:

    When using Clang, cc-version is evaluated to '0402' because Clang
    defines __GNUC__ and __GNUC__MINOR__, and looks like GCC 4.2 in the
    version point of view. On the other hand, CONFIG_GCC_VERSION=0
    when $(CC) is clang.

    There are currently two users of cc-ifversion:
    arch/mips/loongson64/Platform
    arch/powerpc/Makefile

    They are not affected by this change.

    The format of cc-version is , while CONFIG_GCC_VERSION
    . I adjusted cc-ifversion for the difference of
    the number of digits.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

20 Feb, 2019

1 commit

  • Commit 06300b21f4c7 ("kbuild: support building individual files for
    external modules") introduced the '/' target. It works only for
    external modules to build all .o files, but skip the modpost stage.

    However, 'make /' looks a bit weird to me. 'make ./' is more sensible
    if you want to build all objects under the current directory, and it
    works as expected.

    Let's change '/' into a phony target that is an alias of './', but
    I may feel like deprecating it in the future.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

28 Jan, 2019

2 commits

  • The top Makefile does not need to export KBUILD_VMLINUX_INIT and
    KBUILD_VMLINUX_MAIN separately.

    Put every built-in.a into KBUILD_VMLINUX_OBJS. The order of
    $(head-y), $(init-y), $(core-y), ... is still retained.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • The symbol table in the final archive is unneeded; the linker does not
    require the symbol table after the --whole-archive option. Every object
    file in the archive is included in the link anyway.

    Pass thin archives from subdirectories directly to the linker, and
    remove the final archiving step.

    Fix up the document and comments as well.

    Signed-off-by: Masahiro Yamada
    Acked-by: Nicholas Piggin

    Masahiro Yamada
     

06 Jan, 2019

1 commit

  • Some time ago, Sam pointed out a certain degree of overwrap between
    generic-y and mandatory-y. (https://lkml.org/lkml/2017/7/10/121)

    I tweaked the meaning of mandatory-y a little bit; now it defines the
    minimum set of ASM headers that all architectures must have.

    If arch does not have specific implementation of a mandatory header,
    Kbuild will let it fallback to the asm-generic one by automatically
    generating a wrapper. This will allow to drop lots of redundant
    generic-y defines.

    Previously, "mandatory" was used in the context of UAPI, but I guess
    this can be extended to kernel space ASM headers.

    Suggested-by: Sam Ravnborg
    Signed-off-by: Masahiro Yamada
    Acked-by: Sam Ravnborg

    Masahiro Yamada
     

01 Dec, 2018

1 commit

  • SUBDIRS has been kept as a backward compatibility since
    commit ("[PATCH] kbuild: external module support") in 2002.

    We do not need multiple ways to do the same thing, so I will remove
    SUBDIRS after the Linux 5.3 release. I cleaned up in-tree code, and
    updated the document so that nobody would try to use it.

    Meanwhile, display the following warning if SUBDIRS is used.

    Makefile:189: ================= WARNING ================
    Makefile:190: 'SUBDIRS' will be removed after Linux 5.3
    Makefile:191: Please use 'M=' or 'KBUILD_EXTMOD' instead
    Makefile:192: ==========================================

    Signed-off-by: Masahiro Yamada
    Acked-by: Boris Brezillon # for scx200_docflash.c
    Acked-by: Guenter Roeck # for scx200_wdt.c

    Masahiro Yamada
     

01 Nov, 2018

1 commit


10 Sep, 2018

1 commit

  • This is a respin with a wider audience (all that get_maintainer returned)
    and I know this spams a *lot* of people. Not sure what would be the correct
    way, so my apologies for ruining your inbox.

    The 00-INDEX files are supposed to give a summary of all files present
    in a directory, but these files are horribly out of date and their
    usefulness is brought into question. Often a simple "ls" would reveal
    the same information as the filenames are generally quite descriptive as
    a short introduction to what the file covers (it should not surprise
    anyone what Documentation/sched/sched-design-CFS.txt covers)

    A few years back it was mentioned that these files were no longer really
    needed, and they have since then grown further out of date, so perhaps
    it is time to just throw them out.

    A short status yields the following _outdated_ 00-INDEX files, first
    counter is files listed in 00-INDEX but missing in the directory, last
    is files present but not listed in 00-INDEX.

    List of outdated 00-INDEX:
    Documentation: (4/10)
    Documentation/sysctl: (0/1)
    Documentation/timers: (1/0)
    Documentation/blockdev: (3/1)
    Documentation/w1/slaves: (0/1)
    Documentation/locking: (0/1)
    Documentation/devicetree: (0/5)
    Documentation/power: (1/1)
    Documentation/powerpc: (0/5)
    Documentation/arm: (1/0)
    Documentation/x86: (0/9)
    Documentation/x86/x86_64: (1/1)
    Documentation/scsi: (4/4)
    Documentation/filesystems: (2/9)
    Documentation/filesystems/nfs: (0/2)
    Documentation/cgroup-v1: (0/2)
    Documentation/kbuild: (0/4)
    Documentation/spi: (1/0)
    Documentation/virtual/kvm: (1/0)
    Documentation/scheduler: (0/2)
    Documentation/fb: (0/1)
    Documentation/block: (0/1)
    Documentation/networking: (6/37)
    Documentation/vm: (1/3)

    Then there are 364 subdirectories in Documentation/ with several files that
    are missing 00-INDEX alltogether (and another 120 with a single file and no
    00-INDEX).

    I don't really have an opinion to whether or not we /should/ have 00-INDEX,
    but the above 00-INDEX should either be removed or be kept up to date. If
    we should keep the files, I can try to keep them updated, but I rather not
    if we just want to delete them anyway.

    As a starting point, remove all index-files and references to 00-INDEX and
    see where the discussion is going.

    Signed-off-by: Henrik Austad
    Acked-by: "Paul E. McKenney"
    Just-do-it-by: Steven Rostedt
    Reviewed-by: Jens Axboe
    Acked-by: Paul Moore
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mark Brown
    Acked-by: Mike Rapoport
    Cc: [Almost everybody else]
    Signed-off-by: Jonathan Corbet

    Henrik Austad
     

22 Aug, 2018

2 commits

  • Fixes: 8377bd2b9ee1 ("kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS")
    Signed-off-by: Michal Suchanek
    Acked-by: Laura Abbott
    Signed-off-by: Masahiro Yamada

    Michal Suchanek
     
  • Currently, Kconfig does not complain about the recursive dependency
    where 'imply' keywords are involved.

    [Test Code]

    config A
    bool "a"

    config B
    bool "b"
    imply A
    depends on A

    In the code above, Kconfig cannot calculate the symbol values correctly
    due to the circular dependency. For example, allyesconfig followed by
    syncconfig results in an odd behavior because CONFIG_B becomes visible
    in syncconfig.

    $ make allyesconfig
    scripts/kconfig/conf --allyesconfig Kconfig
    #
    # configuration written to .config
    #
    $ cat .config
    #
    # Automatically generated file; DO NOT EDIT.
    # Main menu
    #
    CONFIG_A=y
    $ make syncconfig
    scripts/kconfig/conf --syncconfig Kconfig
    *
    * Restart config...
    *
    *
    * Main menu
    *
    a (A) [Y/n/?] y
    b (B) [N/y/?] (NEW)

    To detect this correctly, sym_check_expr_deps() should recurse to
    not only sym->rev_dep.expr but also sym->implied.expr .

    At this moment, sym_check_print_recursive() cannot distinguish
    'select' and 'imply' since it does not know the precise context
    where the recursive dependency has been hit. This will be solved
    by the next commit.

    In fact, even the document and the unit-test are confused. Using
    'imply' does not solve recursive dependency since 'imply' addresses
    the unmet direct dependency, which 'select' could cause.

    Signed-off-by: Masahiro Yamada
    Tested-by: Dirk Gouders

    Masahiro Yamada
     

16 Aug, 2018

1 commit

  • Pull Kconfig updates from Masahiro Yamada:

    - show clearer error messages where pkg-config is needed, but not
    installed

    - rename SYMBOL_AUTO to SYMBOL_NO_WRITE to reflect its semantics

    - create all necessary directories by Kconfig tool itself instead of
    Makefile

    - update the .config unconditionally when syncconfig is invoked

    - use 'include' directive instead of '-include' where
    include/config/{auto,tristate}.conf is mandatory

    - do not try to update the .config when running install targets

    - add .DELETE_ON_ERROR to delete partially updated files

    - misc cleanups and fixes

    * tag 'kconfig-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    kconfig: remove P_ENV property type
    kconfig: remove unused sym_get_env_prop() function
    kconfig: fix the rule of mainmenu_stmt symbol
    init/Kconfig: Use short unix-style option instead of --longname
    Kbuild: Makefile.modbuiltin: include auto.conf and tristate.conf mandatory
    kbuild: remove auto.conf from prerequisite of phony targets
    kbuild: do not update config for 'make kernelrelease'
    kbuild: do not update config when running install targets
    kbuild: add .DELETE_ON_ERROR special target
    kbuild: use 'include' directive to load auto.conf from top Makefile
    kconfig: allow all config targets to write auto.conf if missing
    kconfig: make syncconfig update .config regardless of sym_change_count
    kconfig: create directories needed for syncconfig by itself
    kconfig: remove unneeded directory generation from local*config
    kconfig: split out useful helpers in confdata.c
    kconfig: rename file_write_dep and move it to confdata.c
    kconfig: fix typos in description of "choice" in kconfig-language.txt
    kconfig: handle format string before calling conf_message_callback()
    kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE
    kconfig: check for pkg-config on make {menu,n,g,x}config

    Linus Torvalds
     

25 Jul, 2018

1 commit


21 Jul, 2018

1 commit

  • Users of if_changed could easily feel invited to use it to divide a
    recipe into parts like:

    a: prereq FORCE
    $(call if_changed,do_a)
    $(call if_changed,do_b)

    But this is problematic, because if_changed should not be used more
    than once per target: in the above example, if_changed stores the
    command-line of the given command in .a.cmd and when a is up-to-date
    with respect to prereq, the file .a.cmd contains the command-line for
    the last command executed, i.e. do_b.

    When the recipe is then executed again, without any change of
    prerequisites, the command-line check for do_a will fail, do_a will be
    executed and stored in .a.cmd. The next check, however, will still see
    the old content (the file isn't re-read) and if_changed will skip
    do_b, because the command-line test will not recognize a change. On
    the next execution of the recipe the roles will flip: do_a is OK but
    do_b not and it will be executed. And so on...

    Signed-off-by: Dirk Gouders
    Signed-off-by: Masahiro Yamada

    Dirk Gouders
     

18 Jul, 2018

2 commits


06 Jul, 2018

5 commits

  • Add usage info for the Kbuild environment variable KBUILD_KCONFIG.

    Signed-off-by: Randy Dunlap
    Reviewed-by: Cao jin
    Signed-off-by: Masahiro Yamada

    Randy Dunlap
     
  • Update Documentation/kbuild/kconfig.txt, which mostly contains
    user help for using the kernel config tools.

    - Add mention of 'nconfig' embedded help text.
    - Make the section on new config symbols readable.
    - Correct how to find menuconfig search help.
    - Add section on 'nconfig' usage.
    - Mention that gconfig has multiple viewing modes/options.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Masahiro Yamada

    Randy Dunlap
     
  • Removed Kbuild documentation for INSTALL_FW_PATH.

    The kbuild symbol INSTALL_FW_PATH was removed from Kbuild tools in
    September 2017 (for 4.14) but the symbol was not deleted from
    the kbuild documentation, so do that now.

    Fixes: 5620a0d1aacd ("firmware: delete in-kernel firmware")
    Signed-off-by: Randy Dunlap
    Cc: stable@vger.kernel.org # 4.14+
    Cc: Greg Kroah-Hartman
    Signed-off-by: Masahiro Yamada

    Randy Dunlap
     
  • The supported alias for building sparc 32-bit is "sparc32",
    not "sparc", so update the alias documentation for that.
    Just using "sparc" produces a 64-bit config file.

    Signed-off-by: Randy Dunlap
    Acked-by: David S. Miller
    Signed-off-by: Masahiro Yamada

    Randy Dunlap
     
  • In Kbuild documentation, add alias for 64-bit sh ARCH ("sh64")
    to the list of ARCH aliases.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Masahiro Yamada

    Randy Dunlap
     

25 Jun, 2018

1 commit

  • I saw this type of Kconfig construct on LKML:

    config SYMBOOL
    #bool "prompt string"
    default y

    and wondered what it does. Then I wondered if '#' comments are
    even documented. They aren't, so add a little doc for that.

    Ah, good. kconfig says:
    arch/x86/Kconfig:2942:warning: config symbol defined without type

    Signed-off-by: Randy Dunlap
    Signed-off-by: Masahiro Yamada

    Randy Dunlap
     

14 Jun, 2018

1 commit

  • The changes to automatically test for working stack protector compiler
    support in the Kconfig files removed the special STACKPROTECTOR_AUTO
    option that picked the strongest stack protector that the compiler
    supported.

    That was all a nice cleanup - it makes no sense to have the AUTO case
    now that the Kconfig phase can just determine the compiler support
    directly.

    HOWEVER.

    It also meant that doing "make oldconfig" would now _disable_ the strong
    stackprotector if you had AUTO enabled, because in a legacy config file,
    the sane stack protector configuration would look like

    CONFIG_HAVE_CC_STACKPROTECTOR=y
    # CONFIG_CC_STACKPROTECTOR_NONE is not set
    # CONFIG_CC_STACKPROTECTOR_REGULAR is not set
    # CONFIG_CC_STACKPROTECTOR_STRONG is not set
    CONFIG_CC_STACKPROTECTOR_AUTO=y

    and when you ran this through "make oldconfig" with the Kbuild changes,
    it would ask you about the regular CONFIG_CC_STACKPROTECTOR (that had
    been renamed from CONFIG_CC_STACKPROTECTOR_REGULAR to just
    CONFIG_CC_STACKPROTECTOR), but it would think that the STRONG version
    used to be disabled (because it was really enabled by AUTO), and would
    disable it in the new config, resulting in:

    CONFIG_HAVE_CC_STACKPROTECTOR=y
    CONFIG_CC_HAS_STACKPROTECTOR_NONE=y
    CONFIG_CC_STACKPROTECTOR=y
    # CONFIG_CC_STACKPROTECTOR_STRONG is not set
    CONFIG_CC_HAS_SANE_STACKPROTECTOR=y

    That's dangerously subtle - people could suddenly find themselves with
    the weaker stack protector setup without even realizing.

    The solution here is to just rename not just the old RECULAR stack
    protector option, but also the strong one. This does that by just
    removing the CC_ prefix entirely for the user choices, because it really
    is not about the compiler support (the compiler support now instead
    automatially impacts _visibility_ of the options to users).

    This results in "make oldconfig" actually asking the user for their
    choice, so that we don't have any silent subtle security model changes.
    The end result would generally look like this:

    CONFIG_HAVE_CC_STACKPROTECTOR=y
    CONFIG_CC_HAS_STACKPROTECTOR_NONE=y
    CONFIG_STACKPROTECTOR=y
    CONFIG_STACKPROTECTOR_STRONG=y
    CONFIG_CC_HAS_SANE_STACKPROTECTOR=y

    where the "CC_" versions really are about internal compiler
    infrastructure, not the user selections.

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

    Linus Torvalds
     

11 Jun, 2018

1 commit


29 May, 2018

2 commits

  • Add a document for the macro language introduced to Kconfig.

    The motivation of this work is to move the compiler option tests to
    Kconfig from Makefile. A number of kernel features require the
    compiler support. Enabling such features blindly in Kconfig ends up
    with a lot of nasty build-time testing in Makefiles. If a chosen
    feature turns out unsupported by the compiler, what the build system
    can do is either to disable it (silently!) or to forcibly break the
    build, despite Kconfig has let the user to enable it. By moving the
    compiler capability tests to Kconfig, features unsupported by the
    compiler will be hidden automatically.

    This change was strongly prompted by Linus Torvalds. You can find
    his suggestions [1] [2] in ML. The original idea was to add a new
    attribute with 'option shell=...', but I found more generalized text
    expansion would make Kconfig more powerful and lovely. The basic
    ideas are from Make, but there are some differences.

    [1]: https://lkml.org/lkml/2016/12/9/577
    [2]: https://lkml.org/lkml/2018/2/7/527

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Kees Cook
    Reviewed-by: Randy Dunlap

    Masahiro Yamada
     
  • To get access to environment variables, Kconfig needs to define a
    symbol using "option env=" syntax. It is tedious to add a symbol entry
    for each environment variable given that we need to define much more
    such as 'CC', 'AS', 'srctree' etc. to evaluate the compiler capability
    in Kconfig.

    Adding '$' for symbol references is grammatically inconsistent.
    Looking at the code, the symbols prefixed with 'S' are expanded by:
    - conf_expand_value()
    This is used to expand 'arch/$ARCH/defconfig' and 'defconfig_list'
    - sym_expand_string_value()
    This is used to expand strings in 'source' and 'mainmenu'

    All of them are fixed values independent of user configuration. So,
    they can be changed into the direct expansion instead of symbols.

    This change makes the code much cleaner. The bounce symbols 'SRCARCH',
    'ARCH', 'SUBARCH', 'KERNELVERSION' are gone.

    sym_init() hard-coding 'UNAME_RELEASE' is also gone. 'UNAME_RELEASE'
    should be replaced with an environment variable.

    ARCH_DEFCONFIG is a normal symbol, so it should be simply referenced
    without '$' prefix.

    The new syntax is addicted by Make. The variable reference needs
    parentheses, like $(FOO), but you can omit them for single-letter
    variables, like $F. Yet, in Makefiles, people tend to use the
    parenthetical form for consistency / clarification.

    At this moment, only the environment variable is supported, but I will
    extend the concept of 'variable' later on.

    The variables are expanded in the lexer so we can simplify the token
    handling on the parser side.

    For example, the following code works.

    [Example code]

    config MY_TOOLCHAIN_LIST
    string
    default "My tools: CC=$(CC), AS=$(AS), CPP=$(CPP)"

    [Result]

    $ make -s alldefconfig && tail -n 1 .config
    CONFIG_MY_TOOLCHAIN_LIST="My tools: CC=gcc, AS=as, CPP=gcc -E"

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

    Masahiro Yamada
     

04 Apr, 2018

1 commit

  • Pull Kconfig updates from Masahiro Yamada:

    - improve checkpatch for more precise Kconfig code checking

    - clarify effective selects by grouping reverse dependencies in help

    - do not write out '# CONFIG_FOO is not set' from invisible symbols

    - make oldconfig as silent as it should be

    - rename 'silentoldconfig' to 'syncconfig'

    - add unit-test framework and several test cases

    - warn unmet dependency of tristate symbols

    - make unmet dependency warnings readable, removing false positives

    - improve recursive include detection

    - use yylineno to simplify the line number tracking

    - misc cleanups

    * tag 'kconfig-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (30 commits)
    kconfig: use yylineno option instead of manual lineno increments
    kconfig: detect recursive inclusion earlier
    kconfig: remove duplicated file name and lineno of recursive inclusion
    kconfig: do not include both curses.h and ncurses.h for nconfig
    kconfig: make unmet dependency warnings readable
    kconfig: warn unmet direct dependency of tristate symbols selected by y
    kconfig: tests: test if recursive inclusion is detected
    kconfig: tests: test if recursive dependencies are detected
    kconfig: tests: test randconfig for choice in choice
    kconfig: tests: test defconfig when two choices interact
    kconfig: tests: check visibility of tristate choice values in y choice
    kconfig: tests: check unneeded "is not set" with unmet dependency
    kconfig: tests: test if new symbols in choice are asked
    kconfig: tests: test automatic submenu creation
    kconfig: tests: add basic choice tests
    kconfig: tests: add framework for Kconfig unit testing
    kbuild: add PYTHON2 and PYTHON3 variables
    kconfig: remove redundant streamline_config.pl prerequisite
    kconfig: rename silentoldconfig to syncconfig
    kconfig: invoke oldconfig instead of silentoldconfig from local*config
    ...

    Linus Torvalds
     

26 Mar, 2018

5 commits

  • As commit cedd55d49dee ("kconfig: Remove silentoldconfig from help
    and docs; fix kconfig/conf's help") mentioned, 'silentoldconfig' is a
    historical misnomer. That commit removed it from help and docs since
    it is an internal interface. If so, it should be allowed to rename
    it to something more intuitive. 'syncconfig' is the one I came up
    with because it updates the .config if necessary, then synchronize
    include/generated/autoconf.h and include/config/* with it.

    You should not manually invoke 'silentoldcofig'. Display warning if
    used in case existing scripts are doing wrong.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Ulf Magnusson

    Masahiro Yamada
     
  • Documentation/kbuild/makefiles.txt lists variables used in Makefile
    whereas Documentation/kbuild/kbuild.txt describes user assignable
    parameters given via environments or the command line.

    The top Makefile and arch/*/Makefile accumulate proper linker flags to
    LDFLAGS_vmlinux. So, users can not override it from the command line.
    Generally, per-file options are not supposed to be user-assignable.
    Remove the misleading entry from kbuild.txt.

    If we need a way to append user-specific flags for linking the kernel,
    LDFLAGS_KERNEL would be a consistent choice because we already expose
    LDFLAGS_MODULE counter-part to users.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Documentation/kbuild/makefiles.txt lists variables used in Makefile
    whereas Documentation/kbuild/kbuild.txt describes user assignable
    parameters given via environments or the command line.

    LDFLAGS_MODULE is a command line interface, so it should be dropped
    from makefiles.txt.

    Some lines below in this file, it is clearly explained that
    KBUILD_LDFLAGS_MODULE is the right one for the internal use:

    KBUILD_LDFLAGS_MODULE Options for $(LD) when linking modules

    $(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options
    used when linking modules. This is often a linker script.
    From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).

    Then, kbuild.txt explains LDFLAGS_MODULE, like follows:

    LDFLAGS_MODULE
    --------------------------------------------------
    Additional options used for $(LD) when linking modules.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Incremental linking is gone, so rename built-in.o to built-in.a, which
    is the usual extension for archive files.

    This patch does two things, first is a simple search/replace:

    git grep -l 'built-in\.o' | xargs sed -i 's/built-in\.o/built-in\.a/g'

    The second is to invert nesting of nested text manipulations to avoid
    filtering built-in.a out from libs-y2:

    -libs-y2 := $(filter-out %.a, $(patsubst %/, %/built-in.a, $(libs-y)))
    +libs-y2 := $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y)))

    Signed-off-by: Nicholas Piggin
    Signed-off-by: Masahiro Yamada

    Nicholas Piggin
     
  • This removes the old `ld -r` incremental link option, which has not
    been selected by any architecture since June 2017.

    Signed-off-by: Nicholas Piggin
    Signed-off-by: Masahiro Yamada

    Nicholas Piggin
     

01 Feb, 2018

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "Documentation updates for 4.16.

    New stuff includes refcount_t documentation, errseq documentation,
    kernel-doc support for nested structure definitions, the removal of
    lots of crufty kernel-doc support for unused formats, SPDX tag
    documentation, the beginnings of a manual for subsystem maintainers,
    and lots of fixes and updates.

    As usual, some of the changesets reach outside of Documentation/ to
    effect kerneldoc comment fixes. It also adds the new LICENSES
    directory, of which Thomas promises I do not need to be the
    maintainer"

    * tag 'docs-4.16' of git://git.lwn.net/linux: (65 commits)
    linux-next: docs-rst: Fix typos in kfigure.py
    linux-next: DOC: HWPOISON: Fix path to debugfs in hwpoison.txt
    Documentation: Fix misconversion of #if
    docs: add index entry for networking/msg_zerocopy
    Documentation: security/credentials.rst: explain need to sort group_list
    LICENSES: Add MPL-1.1 license
    LICENSES: Add the GPL 1.0 license
    LICENSES: Add Linux syscall note exception
    LICENSES: Add the MIT license
    LICENSES: Add the BSD-3-clause "Clear" license
    LICENSES: Add the BSD 3-clause "New" or "Revised" License
    LICENSES: Add the BSD 2-clause "Simplified" license
    LICENSES: Add the LGPL-2.1 license
    LICENSES: Add the LGPL 2.0 license
    LICENSES: Add the GPL 2.0 license
    Documentation: Add license-rules.rst to describe how to properly identify file licenses
    scripts: kernel_doc: better handle show warnings logic
    fs/*/Kconfig: drop links to 404-compliant http://acl.bestbits.at
    doc: md: Fix a file name to md-fault.c in fault-injection.txt
    errseq: Add to documentation tree
    ...

    Linus Torvalds
     

06 Jan, 2018

1 commit

  • Since commit 31847b67bec0 ("kconfig: allow use of relations other than
    (in)equality") it is possible to use relational operators in Kconfig
    statements. However, those operators give unexpected results when
    applied to bool/tristate values:

    (n < y) = y (correct)
    (m < y) = y (correct)
    (n < m) = n (wrong)

    This happens because relational operators process bool and tristate
    symbols as strings and m sorts before n. It makes little sense to do a
    lexicographical compare on bool and tristate values though.

    Documentation/kbuild/kconfig-language.txt states that expression can have
    a value of 'n', 'm' or 'y' (or 0, 1, 2 respectively for calculations).
    Let's make it so for relational comparisons with bool/tristate
    expressions as well and document them. If at least one symbol is an
    actual string then the lexicographical compare works just as before.

    Signed-off-by: Nicolas Pitre
    Acked-by: Randy Dunlap
    Tested-by: Randy Dunlap
    Signed-off-by: Masahiro Yamada

    Nicolas Pitre
     

12 Dec, 2017

1 commit

  • Document the preference [1] for new CONFIG options to "default n" (or
    not use default at all) in order to minimizes changes to the config,
    especially to avoid "make oldconfig" growing unnecessarily from release
    to release.

    Document the exceptions where it is acceptable to use "default y/m" for
    new CONFIG options.

    1. https://lkml.org/lkml/2017/11/18/257

    Cc: "Yann E. MORIN"
    Cc: Masahiro Yamada
    Cc: Michal Marek
    Cc: Jonathan Corbet
    Cc: linux-kbuild@vger.kernel.org
    Cc: linux-doc@vger.kernel.org
    Signed-off-by: Darren Hart (VMware)
    Signed-off-by: Jonathan Corbet

    Darren Hart (VMware)
     

15 Nov, 2017

1 commit

  • Pull DeviceTree updates from Rob Herring:
    "A bigger diffstat than usual with the kbuild changes and a tree wide
    fix in the binding documentation.

    Summary:

    - kbuild cleanups and improvements for dtbs

    - Code clean-up of overlay code and fixing for some long standing
    memory leak and race condition in applying overlays

    - Improvements to DT memory usage making sysfs/kobjects optional and
    skipping unflattening of disabled nodes. This is part of kernel
    tinification efforts.

    - Final piece of removing storing the full path for every DT node.
    The prerequisite conversion of printk's to use device_node format
    specifier happened in 4.14.

    - Sync with current upstream dtc. This brings additional checks to
    dtb compiling.

    - Binding doc tree wide removal of leading 0s from examples

    - RTC binding documentation adding missing devices and some
    consolidation of duplicated bindings

    - Vendor prefix documentation for nutsboard, Silicon Storage
    Technology, shimafuji, Tecon Microprocessor Technologies, DH
    electronics GmbH, Opal Kelly, and Next Thing"

    * tag 'devicetree-for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (55 commits)
    dt-bindings: usb: add #phy-cells to usb-nop-xceiv
    dt-bindings: Remove leading zeros from bindings notation
    kbuild: handle dtb-y and CONFIG_OF_ALL_DTBS natively in Makefile.lib
    MIPS: dts: remove bogus bcm96358nb4ser.dtb from dtb-y entry
    kbuild: clean up *.dtb and *.dtb.S patterns from top-level Makefile
    .gitignore: move *.dtb and *.dtb.S patterns to the top-level .gitignore
    .gitignore: sort normal pattern rules alphabetically
    dt-bindings: add vendor prefix for Next Thing Co.
    scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9
    of: dynamic: fix memory leak related to properties of __of_node_dup
    of: overlay: make pr_err() string unique
    of: overlay: pr_err from return NOTIFY_OK to overlay apply/remove
    of: overlay: remove unneeded check for NULL kbasename()
    of: overlay: remove a dependency on device node full_name
    of: overlay: simplify applying symbols from an overlay
    of: overlay: avoid race condition between applying multiple overlays
    of: overlay: loosen overly strict phandle clash check
    of: overlay: expand check of whether overlay changeset can be removed
    of: overlay: detect cases where device tree may become corrupt
    of: overlay: minor restructuring
    ...

    Linus Torvalds
     

09 Nov, 2017

1 commit


24 Oct, 2017

1 commit

  • It does several fixes:
    1. move the displaced ld example to its reasonable place.
    2. add new example for command gzip.
    3. fix 2 number errors.
    4. fix format of chapter 7.x, make it looks the same as other chapters.

    Signed-off-by: Cao jin
    Signed-off-by: Masahiro Yamada

    Cao jin