12 May, 2020

1 commit

  • Commit 21c54b774744 ("kconfig: show compiler version text in the top
    comment") added the environment variable, CC_VERSION_TEXT in the comment
    of the top Kconfig file. It can detect the compiler update, and invoke
    the syncconfig because all environment variables referenced in Kconfig
    files are recorded in include/config/auto.conf.cmd

    This commit makes it a CONFIG option in order to ensure the full rebuild
    when the compiler is updated.

    This works like follows:

    include/config/kconfig.h contains "CONFIG_CC_VERSION_TEXT" in the comment
    block.

    The top Makefile specifies "-include $(srctree)/include/linux/kconfig.h"
    to guarantee it is included from all kernel source files.

    fixdep parses every source file and all headers included from it,
    searching for words prefixed with "CONFIG_". Then, fixdep finds
    CONFIG_CC_VERSION_TEXT in include/config/kconfig.h and adds
    include/config/cc/version/text.h into every .*.cmd file.

    When the compiler is updated, syncconfig is invoked because init/Kconfig
    contains the reference to the environment variable CC_VERTION_TEXT.
    CONFIG_CC_VERSION_TEXT is updated to the new version string, and
    include/config/cc/version/text.h is touched.

    In the next rebuild, Make will rebuild every files since the timestamp
    of include/config/cc/version/text.h is newer than that of target.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

15 Jun, 2019

1 commit

  • The kbuild documentation clearly shows that the documents
    there are written at different times: some use markdown,
    some use their own peculiar logic to split sections.

    Convert everything to ReST without affecting too much
    the author's style and avoiding adding uneeded markups.

    The conversion is actually:
    - add blank lines and identation in order to identify paragraphs;
    - fix tables markups;
    - add some lists markups;
    - mark literal blocks;
    - adjust title markups.

    At its new index.rst, let's add a :orphan: while this is not linked to
    the main index.rst file, in order to avoid build warnings.

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

08 Jun, 2019

1 commit


02 Aug, 2018

3 commits


29 May, 2018

3 commits

  • Kconfig got text processing tools like we see in Make. Add Kconfig
    helper macros to scripts/Kconfig.include like we collect Makefile
    macros in scripts/Kbuild.include.

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

    Masahiro Yamada
     
  • The kernel configuration phase is now tightly coupled with the compiler
    in use. It will be nice to show the compiler information in Kconfig.

    The compiler information will be displayed like this:

    $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- config
    scripts/kconfig/conf --oldaskconfig Kconfig
    *
    * Linux/arm64 4.16.0-rc1 Kernel Configuration
    *
    *
    * Compiler: aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11) 7.2.1 20171011
    *
    *
    * General setup
    *
    Compile also drivers which will not load (COMPILE_TEST) [N/y/?]

    If you use GUI methods such as menuconfig, it will be displayed in the
    top menu.

    This is simply implemented by using the 'comment' statement. So, it
    will be saved into the .config file as well.

    This commit has a very important meaning. If the compiler is upgraded,
    Kconfig must be re-run since different compilers have different sets
    of supported options.

    All referenced environments are written to include/config/auto.conf.cmd
    so that any environment change triggers syncconfig, and prompt the user
    to input new values if needed.

    With this commit, something like follows will be added to
    include/config/auto.conf.cmd

    ifneq "$(CC_VERSION_TEXT)" "aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11) 7.2.1 20171011"
    include/config/auto.conf: FORCE
    endif

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

    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
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

20 Sep, 2010

1 commit