1. 11 11月, 2019 1 次提交
    • M
      kconfig: split util.c out of parser.y · 521b29b6
      Masahiro Yamada 提交于
      util.c exists both in scripts/kconfig/ and scripts/kconfig/lxdialog.
      
      Prior to commit 54b8ae66 ("kbuild: change *FLAGS_<basetarget>.o
      to take the path relative to $(obj)"), Kbuild could not pass different
      flags to source files with the same basename. Now that this issue
      was solved, you can split util.c out of parser.y and compile them
      independently of each other.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      521b29b6
  2. 04 9月, 2019 1 次提交
    • M
      kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj) · 54b8ae66
      Masahiro Yamada 提交于
      Kbuild provides per-file compiler flag addition/removal:
      
        CFLAGS_<basetarget>.o
        CFLAGS_REMOVE_<basetarget>.o
        AFLAGS_<basetarget>.o
        AFLAGS_REMOVE_<basetarget>.o
        CPPFLAGS_<basetarget>.lds
        HOSTCFLAGS_<basetarget>.o
        HOSTCXXFLAGS_<basetarget>.o
      
      The <basetarget> is the filename of the target with its directory and
      suffix stripped.
      
      This syntax comes into a trouble when two files with the same basename
      appear in one Makefile, for example:
      
        obj-y += foo.o
        obj-y += dir/foo.o
        CFLAGS_foo.o := <some-flags>
      
      Here, the <some-flags> applies to both foo.o and dir/foo.o
      
      The real world problem is:
      
        scripts/kconfig/util.c
        scripts/kconfig/lxdialog/util.c
      
      Both files are compiled into scripts/kconfig/mconf, but only the
      latter should be given with the ncurses flags.
      
      It is more sensible to use the relative path to the Makefile, like this:
      
        obj-y += foo.o
        CFLAGS_foo.o := <some-flags>
        obj-y += dir/foo.o
        CFLAGS_dir/foo.o := <other-flags>
      
      At first, I attempted to replace $(basetarget) with $*. The $* variable
      is replaced with the stem ('%') part in a pattern rule. This works with
      most of cases, but does not for explicit rules.
      
      For example, arch/ia64/lib/Makefile reuses rule_as_o_S in its own
      explicit rules, so $* will be empty, resulting in ignoring the per-file
      AFLAGS.
      
      I introduced a new variable, target-stem, which can be used also from
      explicit rules.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NMarc Zyngier <maz@kernel.org>
      54b8ae66
  3. 29 8月, 2019 1 次提交
  4. 17 7月, 2019 1 次提交
  5. 09 6月, 2019 2 次提交
  6. 19 5月, 2019 1 次提交
  7. 18 5月, 2019 1 次提交
  8. 13 2月, 2019 2 次提交
  9. 14 1月, 2019 1 次提交
  10. 06 1月, 2019 2 次提交
  11. 28 12月, 2018 3 次提交
  12. 01 11月, 2018 2 次提交
  13. 03 9月, 2018 1 次提交
  14. 22 8月, 2018 2 次提交
    • 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
    • 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
  15. 25 7月, 2018 2 次提交
  16. 18 7月, 2018 2 次提交
  17. 05 6月, 2018 2 次提交
  18. 28 5月, 2018 4 次提交
  19. 07 4月, 2018 2 次提交
    • M
      kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically · b23d1a24
      Masahiro Yamada 提交于
      Files generated by if_changed* must be added to 'targets' to include
      *.cmd files.  Otherwise, they would be regenerated every time.
      
      The build system automatically adds objects to 'targets' where
      appropriate, such as obj-y, extra-y, etc. but does nothing for
      intermediate files.  So, each Makefile needs to add them by itself.
      
      There are some common cases where objects are generated by chained
      rules.  Lexers and parsers are compiled like follows:
      
         %.lex.o <- %.lex.c <- %.l
         %.tab.o <- %.tab.c <- %.y
      
      They are common patterns, so it is reasonable to take care of them
      in the core Makefile instead of requiring each Makefile to do so.
      
      At this moment, you cannot delete 'target += zconf.lex.c' in the
      Kconfig Makefile because zconf.lex.c is included from zconf.tab.c
      instead of being compiled separately.  It should be deleted after
      Kconfig is more refactored.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NFrank Rowand <frowand.list@gmail.com>
      b23d1a24
    • M
      kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile · 9a8dfb39
      Masahiro Yamada 提交于
      Files suffixed by .lex.c, .tab.[ch] are generated lexers, parsers,
      respectively.  Clean them up globally from the top Makefile.
      
      Some of the final host programs those lexer/parser are linked into
      are necessary for building external modules, but the intermediates
      are unneeded.  They can be cleaned away by 'make clean' instead of
      'make mrproper'.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NFrank Rowand <frowand.list@gmail.com>
      9a8dfb39
  20. 26 3月, 2018 5 次提交
    • M
      kconfig: tests: add framework for Kconfig unit testing · 022a4bf6
      Masahiro Yamada 提交于
      Many parts in Kconfig are so cryptic and need refactoring.  However,
      its complexity prevents us from moving forward.  There are several
      naive corner cases where it is difficult to notice breakage.  If
      those are covered by unit tests, we will be able to touch the code
      with more confidence.
      
      Here is a simple test framework based on pytest.  The conftest.py
      provides a fixture useful to run commands such as 'oldaskconfig' etc.
      and to compare the resulted .config, stdout, stderr with expectations.
      
      How to add test cases?
      ----------------------
      
      For each test case, you should create a subdirectory under
      scripts/kconfig/tests/ (so test cases are separated from each other).
      Every test case directory should contain the following files:
      
       - __init__.py: describes test functions
       - Kconfig: the top level Kconfig file for the test
      
      To do a useful job, test cases generally need additional data like
      input .config and information about expected results.
      
      How to run tests?
      -----------------
      
      You need python3 and pytest.  Then, run "make testconfig".  O= option
      is supported.  If V=1 is given, detailed logs captured during tests
      are displayed.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      022a4bf6
    • U
      kconfig: remove redundant streamline_config.pl prerequisite · 2a616258
      Ulf Magnusson 提交于
      The local{yes,mod}config targets currently have streamline_config.pl as
      a prerequisite. This is redundant, because streamline_config.pl is a
      checked-in file with no prerequisites.
      
      Remove the prerequisite and reference streamline_config.pl directly in
      the recipe of the rule instead.
      Signed-off-by: NUlf Magnusson <ulfalizer@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      2a616258
    • M
      kconfig: rename silentoldconfig to syncconfig · 911a91c3
      Masahiro Yamada 提交于
      As commit cedd55d4 ("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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      911a91c3
    • M
      kconfig: invoke oldconfig instead of silentoldconfig from local*config · 81d2bc22
      Masahiro Yamada 提交于
      The purpose of local{yes,mod}config is to arrange the .config file
      based on actually loaded modules.  It is unnecessary to update
      include/generated/autoconf.h and include/config/* stuff here.
      They will be updated as needed during the build.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      81d2bc22
    • M
      kbuild: restore autoksyms.h touch to the top Makefile · 07a422bb
      Masahiro Yamada 提交于
      Commit d3fc425e ("kbuild: make sure autoksyms.h exists early")
      moved the code that touches autoksyms.h to scripts/kconfig/Makefile
      with obscure reason.
      
      From Nicolas' comment [1], he did not seem to be sure about the root
      cause.
      
      I guess I figured it out, so here is a fix-up I think is more correct.
      According to the error log in the original post [2], the build failed
      in scripts/mod/devicetable-offsets.c
      
      scripts/mod/Makefile is descended from scripts/Makefile, which is
      invoked from the top-level Makefile by the 'scripts' target.
      
      To build vmlinux and/or modules, Kbuild descend into $(vmlinux-dirs).
      This depends on 'prepare' and 'scripts' as follows:
      
        $(vmlinux-dirs): prepare scripts
      
      Because there is no dependency between 'prepare' and 'scripts', the
      parallel building can execute them simultaneously.
      
      'prepare' depends on 'prepare1', which touched autoksyms.h, while
      'scripts' descends into script/, then scripts/mod/, which needs
      <generated/autoksyms.h> if CONFIG_TRIM_UNUSED_KSYMS.  It was the
      reason of the race.
      
      I am not happy to have unrelated code in the Kconfig Makefile, so
      getting it back to the top Makefile.
      
      I removed the standalone test target because I want to use it to
      create an empty autoksyms.h file.  Here is a little improvement;
      unnecessary autoksyms.h is not created when CONFIG_TRIM_UNUSED_KSYMS
      is disabled.
      
      [1] https://lkml.org/lkml/2016/11/30/734
      [2] https://lkml.org/lkml/2016/11/30/531Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      07a422bb
  21. 28 1月, 2018 1 次提交
  22. 25 1月, 2018 1 次提交
    • M
      kconfig: announce removal of oldnoconfig if used · 312ee687
      Masahiro Yamada 提交于
      The 'oldnoconfig' is really confusing due to its counter-intuitive name.
      It was renamed by commit fb16d891 ("kconfig: replace 'oldnoconfig'
      with 'olddefconfig', and keep the old name as an alias").
      
      The 'oldnoconfig' has been kept as an alias for enough period of time,
      and finally I am planning to remove it.  I will give people a little
      more time for migration.  Meanwhile, the following message will be
      displayed if oldnoconfig is used.
      
          WARNING: "oldnoconfig" target will be removed after Linux 4.19
                    Please use "olddefconfig" instead, which is an alias.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      312ee687