1. 22 8月, 2018 6 次提交
    • M
      kconfig: suppress "configuration written to .config" for syncconfig · 9a9ddcf4
      Masahiro Yamada 提交于
      The top-level Makefile invokes "make syncconfig" when necessary.
      Then, Kconfig displays the following message when .config is updated.
      
        #
        # configuration written to .config
        #
      
      It is distracting because "make syncconfig" happens during the build
      stage, and does nothing important in most cases.
      Suggested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      9a9ddcf4
    • M
      kconfig: fix "Can't open ..." in parallel build · 98a4afbf
      Masahiro Yamada 提交于
      If you run "make menuconfig" or "make nconfig" with -j<N> option in a
      fresh source tree, you will see several "Can't open ..." messages:
      
        $ make -j8 menuconfig
          HOSTCC  scripts/basic/fixdep
          YACC    scripts/kconfig/zconf.tab.c
          LEX     scripts/kconfig/zconf.lex.c
        /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
        /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
        /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
        /bin/sh: 1: .:   HOSTCC  scripts/kconfig/lxdialog/checklist.o
        Can't open scripts/kconfig/.mconf-cfg
        /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
        /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
        /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
          HOSTCC  scripts/kconfig/lxdialog/inputbox.o
        /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
        /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
        /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
          UPD     scripts/kconfig/.mconf-cfg
        /bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
          HOSTCC  scripts/kconfig/lxdialog/menubox.o
          HOSTCC  scripts/kconfig/lxdialog/textbox.o
          HOSTCC  scripts/kconfig/lxdialog/util.o
          HOSTCC  scripts/kconfig/lxdialog/yesno.o
          HOSTCC  scripts/kconfig/mconf.o
          HOSTCC  scripts/kconfig/zconf.tab.o
          HOSTLD  scripts/kconfig/mconf
      
      Correct dependencies to fix this problem.
      
      Fixes: 1c5af5cf ("kconfig: refactor ncurses package checks for building mconf and nconf")
      Cc: linux-stable <stable@vger.kernel.org> # v4.18
      Reported-by: NBorislav Petkov <bp@suse.de>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: NBorislav Petkov <bp@suse.de>
      98a4afbf
    • M
      kconfig: improve the recursive dependency report · f498926c
      Masahiro Yamada 提交于
      This commit improves the messages of the recursive dependency.
      Currently, sym->dir_dep.expr is not checked.  Hence, any dependency
      in property visibility is regarded as the dependency of the symbol.
      
      [Test Code 1]
      
        config A
                bool "a"
                depends on B
      
        config B
                bool "b"
                depends on A
      
      [Test Code 2]
      
        config A
                bool "a" if B
      
        config B
                bool "b"
                depends on A
      
      For both cases above, the same message is displayed:
      
              symbol B depends on A
              symbol A depends on B
      
      This commit changes the message for the latter, like this:
      
              symbol B depends on A
              symbol A prompt is visible depending on B
      
      Also, 'select' and 'imply' are distinguished.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: NDirk Gouders <dirk@gouders.net>
      f498926c
    • M
      kconfig: report recursive dependency involving 'imply' · 5e8c5299
      Masahiro Yamada 提交于
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: NDirk Gouders <dirk@gouders.net>
      5e8c5299
    • M
      kconfig: error out when seeing recursive dependency · f1575595
      Masahiro Yamada 提交于
      Originally, recursive dependency was a fatal error for Kconfig
      because Kconfig cannot compute symbol values in such a situation.
      
      Commit d595cea6 ("kconfig: print more info when we see a recursive
      dependency") changed it to a warning, which I guess was not intentional.
      
      Get it back to an error again.
      
      Also, rename the unit test directory "warn_recursive_dep" to
      "err_recursive_dep" so that it matches to the behavior.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: NDirk Gouders <dirk@gouders.net>
      f1575595
    • R
      kconfig: add build-only configurator targets · 4bf6a9af
      Randy Dunlap 提交于
      Add build-only targets for build_menuconfig, build_nconfig,
      build_xconfig, and build_gconfig.
      (targets must end in "config" to qualify in top-level Makefile)
      
      This allows these target to be built without execution (e.g., to
      look for errors or warnings) and/or to be built and checked by sparse.
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      4bf6a9af
  2. 14 8月, 2018 2 次提交
  3. 13 8月, 2018 1 次提交
  4. 25 7月, 2018 7 次提交
    • M
      kconfig: allow all config targets to write auto.conf if missing · 00c864f8
      Masahiro Yamada 提交于
      Currently, only syncconfig creates or updates include/config/auto.conf
      and some other files.  Other config targets create or update only the
      .config file.
      
      When you configure and build the kernel from a pristine source tree,
      any config target is followed by syncconfig in the build stage since
      include/config/auto.conf is missing.
      
      We are moving compiler tests from Makefile to Kconfig.  It means that
      parsing Kconfig files will be more costly since Kconfig invokes the
      compiler commands internally.  Thus, we want to avoid invoking Kconfig
      twice (one for *config to create the .config, and one for syncconfig
      to synchronize the auto.conf).  If auto.conf does not exist, we can
      generate all configuration files in the first configuration stage,
      which will save the syncconfig in the build stage.
      
      Please note this should be done only when auto.conf is missing.  If
      *config blindly did this, time stamp files under include/config/ would
      be unnecessarily touched, triggering unneeded rebuild of objects.
      
      I assume a scenario like this:
      
       1. You have a source tree that has already been built
          with CONFIG_FOO disabled
      
       2. Run "make menuconfig" to enable CONFIG_FOO
      
       3. CONFIG_FOO turns out to be unnecessary.
          Run "make menuconfig" again to disable CONFIG_FOO
      
       4. Run "make"
      
      In this case, include/config/foo.h should not be touched since there
      is no change in CONFIG_FOO.  The sync process should be delayed until
      the user really attempts to build the kernel.
      
      This commit has another motivation; I want to suppress the 'No such
      file or directory' warning from the 'include' directive.
      
      The top-level Makefile includes auto.conf with '-include' directive,
      like this:
      
        ifeq ($(dot-config),1)
        -include include/config/auto.conf
        endif
      
      This looks strange because auto.conf is mandatory when dot-config is 1.
      I guess only the reason of using '-include' is to suppress the warning
      'include/config/auto.conf: No such file or directory' when building
      from a clean tree.  However, this has a side-effect; Make considers
      the files included by '-include' are optional.  Hence, Make continues
      to build even if it fails to generate include/config/auto.conf.  I will
      change this in the next commit, but the warning message is annoying.
      (At least, kbuild test robot reports it as a regression.)
      
      With this commit, Kconfig will generate all configuration files together
      with the .config and I guess it is a solution good enough to suppress
      the warning.
      
      Note:
      GNU Make 4.2 or later does not display the warning from the 'include'
      directive if include files are successfully generated.  See GNU Make
      commit 87a5f98d248f ("[SV 102] Don't show unnecessary include file
      errors.")  However, older GNU Make versions are still widely used.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      00c864f8
    • M
      kconfig: make syncconfig update .config regardless of sym_change_count · 16952b77
      Masahiro Yamada 提交于
      syncconfig updates the .config only when sym_change_count > 0, i.e.
      any change in config symbols has been detected.
      
      Not only symbols but also comments are contained in the .config file.
      If only comments are updated, they are not fed back to the .config,
      then the stale comments are left-over.  Of course, this is just a
      matter of comments, but why not fix it.
      
      I see some scenarios where this happens.
      
      Scenario A:
      
       1. You have a source tree that has already been configured.
      
       2. Linus increments the version number in the top-level Makefile
          (i.e. he commits a new release)
      
       3. You pull it, and run 'make'
      
       4. syncconfig is invoked because the environment variable,
          KERNELVERSION is updated, but the .config is not updated since
          no config symbol is changed.
      
       5. The .config file contains a kernel version in the top line:
      
          # Automatically generated file; DO NOT EDIT.
          # Linux/arm64 4.18.0-rc2 Kernel Configuration
      
          ... which points to a previous version.
      
      Scenario B:
      
       1. You have a source tree that has already been configured.
      
       2. You upgrade the compiler, but it still has the same version number.
          This may happen if you regularly build the latest compiler from
          the source code.
      
       3. You run 'make'
      
       4. syncconfig is invoked because the environment variable,
          CC_VERSION_TEXT is updated, but the .config is not updated since
          no config symbol is changed.
      
       5. The .config file contains the version string of the compiler:
      
          #
          # Compiler: aarch64-linux-gcc (GCC) 9.0.0 20180628 (experimental)
          #
      
          ... which carries the information of the old compiler.
      
      If KCONFIG_NOSILENTUPDATE is set, syncconfig is not allowed to update
      the .config file.  Otherwise, it is fine to update it regardless of
      sym_change_count.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      16952b77
    • M
      kconfig: create directories needed for syncconfig by itself · 79123b13
      Masahiro Yamada 提交于
      'make syncconfig' creates some files such as include/config/auto.conf,
      include/generate/autoconf.h, etc. but the necessary directory creation
      relies on scripts/kconfig/Makefile.
      
      To make Kconfig self-contained, create directories as needed in
      conf_write_autoconf().
      
      This change allows scripts/kconfig/Makefile cleanups; syncconfig can
      be merged into simple-targets.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      79123b13
    • M
      kconfig: remove unneeded directory generation from local*config · adc18acf
      Masahiro Yamada 提交于
      Commit 17263baf ("kconfig: Create include/generated for
      localmodconfig") added the 'mkdir' line because local{yes,mod}config
      ran streamline_config.pl followed by silentoldconfig at that time.
      
      Since commit 81d2bc22 ("kconfig: invoke oldconfig instead of
      silentoldconfig from local*config"), no sub-directory is required.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      adc18acf
    • M
      kconfig: split out useful helpers in confdata.c · 0608182a
      Masahiro Yamada 提交于
      Split out helpers:
       is_present() - check if the given path exists
       is_dir() - check if the given path exists and it is a directory
       make_parent_dir() - create the parent directories of the given path
      
      These helpers will be reused in later commits.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      0608182a
    • M
      kconfig: rename file_write_dep and move it to confdata.c · a2ff4040
      Masahiro Yamada 提交于
      file_write_dep() is called only from conf_write_autoconf().
      Move it from util.c to confdata.c to make it static.
      Also, rename it to conf_write_dep() since it should belong to
      the group of conf_write* functions.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      a2ff4040
    • M
      kconfig: handle format string before calling conf_message_callback() · 5accd7f3
      Masahiro Yamada 提交于
      As you see in mconf.c and nconf.c, conf_message_callback() hooks are
      likely to end up with the boilerplate of vsnprintf().  Process the
      string format before calling conf_message_callback() so that it
      receives a simple string.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NDirk Gouders <dirk@gouders.net>
      5accd7f3
  5. 18 7月, 2018 3 次提交
  6. 28 6月, 2018 2 次提交
  7. 25 6月, 2018 1 次提交
    • D
      kconfig: fix line numbers for if-entries in menu tree · b2d00d7c
      Dirk Gouders 提交于
      The line numers for if-entries in the menu tree are off by one or more
      lines which is confusing when debugging for correctness of unrelated changes.
      
      According to the git log, commit a02f0570 (kconfig: improve
      error handling in the parser) was the last one that changed that part
      of the parser and replaced
      
      	"if_entry: T_IF expr T_EOL"
      by
      	"if_entry: T_IF expr nl"
      
      but the commit message does not state why this has been done.
      
      When reverting that part of the commit, only the line numers are
      corrected (checked with cdebug = DEBUG_PARSE in zconf.y), otherwise
      the menu tree remains unchanged (checked with zconfdump() enabled in
      conf.c).
      
      An example for the corrected line numbers:
      
      drivers/soc/Kconfig:15:source drivers/soc/tegra/Kconfig
      drivers/soc/tegra/Kconfig:4:if
      drivers/soc/tegra/Kconfig:6:if
      
      changes to:
      
      drivers/soc/Kconfig:15:source drivers/soc/tegra/Kconfig
      drivers/soc/tegra/Kconfig:1:if
      drivers/soc/tegra/Kconfig:4:if
      Signed-off-by: NDirk Gouders <dirk@gouders.net>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      b2d00d7c
  8. 11 6月, 2018 1 次提交
  9. 05 6月, 2018 3 次提交
  10. 29 5月, 2018 14 次提交