Skip to content
Snippets Groups Projects
  1. May 12, 2020
    • Masahiro Yamada's avatar
      kbuild: ensure full rebuild when the compiler is updated · 8b59cd81
      Masahiro Yamada authored
      
      Commit 21c54b77 ("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: default avatarMasahiro Yamada <masahiroy@kernel.org>
      8b59cd81
  2. Jun 14, 2019
    • Mauro Carvalho Chehab's avatar
      docs: kbuild: convert docs to ReST and rename to *.rst · cd238eff
      Mauro Carvalho Chehab authored
      
      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: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      cd238eff
  3. Jun 07, 2019
  4. Aug 01, 2018
  5. May 28, 2018
    • Masahiro Yamada's avatar
      kconfig: add basic helper macros to scripts/Kconfig.include · e1cfdc0e
      Masahiro Yamada authored
      
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarUlf Magnusson <ulfalizer@gmail.com>
      e1cfdc0e
    • Masahiro Yamada's avatar
      kconfig: show compiler version text in the top comment · 21c54b77
      Masahiro Yamada authored
      
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      21c54b77
    • Masahiro Yamada's avatar
      kconfig: reference environment variables directly and remove 'option env=' · 104daea1
      Masahiro Yamada authored
      
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      104daea1
  6. Nov 02, 2017
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      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...
      b2441318
  7. Sep 20, 2010
Loading