1. 20 Mar, 2018 7 commits
    • Stefan Agner's avatar
      kbuild: set no-integrated-as before incl. arch Makefile · c8ef0014
      Stefan Agner authored
      In order to make sure compiler flag detection for ARM works
      correctly the no-integrated-as flags need to be set before
      including the arch specific Makefile.
      Fixes: cfe17c9b ("kbuild: move cc-option and cc-disable-warning after incl. arch Makefile")
      Signed-off-by: default avatarStefan Agner <stefan@agner.ch>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    • Masahiro Yamada's avatar
      kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS · 1fd55577
      Masahiro Yamada authored
      If CONFIG_TRIM_UNUSED_KSYMS is enabled and the kernel is built from
      a pristine state, the vmlinux is linked twice.
      [1] A user runs 'make'
      [2] First build with empty autoksyms.h
      [3] adjust_autoksyms.sh updates autoksyms.h and recurses 'make vmlinux'
        --------(begin sub-make)--------
        [4] Second build with new autoksyms.h
        [5] link-vmlinux.sh is invoked because vmlinux is missing
        ---------(end sub-make)---------
      [6] link-vmlinux.sh is invoked again despite vmlinux is up-to-date.
      The reason of [6] is probably because Make already decided to update
      vmlinux at the time of [2] because vmlinux was missing when Make
      built up the dependency graph.
      Because if_changed is implemented based on $?, this issue can be
      narrowed down to how Make handles $?.
      You can test it with the following simple code:
      [Test Makefile]
        A: B
                @echo newer prerequisite: $?
                cp B A
        B: C
                cp C B
                touch A
        $ rm -f A B
        $ touch C
        $ make
        cp C B
        touch A
        newer prerequisite: B
        cp B A
      Here, 'A' has been touched in the recipe of 'B'.  So, the dependency
      'A: B' has already been met before the recipe of 'A' is executed.
      However, Make does not notice the fact that the recipe of 'B' also
      updates 'A' as a side-effect.
      The situation is similar in this case; the vmlinux has actually been
      updated in the vmlinux_prereq target.  Make cannot predict this, so
      judges the vmlinux is old.
      link-vmlinux.sh is costly, so it is better to not run it when unneeded.
      Split CONFIG_TRIM_UNUSED_KSYMS recursion to a dedicated target.
      The reason of commit 2441e78b ("kbuild: better abstract vmlinux
      sequential prerequisites") was to cater to CONFIG_BUILD_DOCSRC, but
      it was later removed by commit 18489292 ("samples: move blackfin
      gptimers-example from Documentation").
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
    • Masahiro Yamada's avatar
      kbuild: move include/config/ksym/* to include/ksym/* · e5fee03f
      Masahiro Yamada authored
      The idea of using fixdep was inspired by Kconfig, but autoksyms
      belongs to a different group.  So, I want to move those touched
      files under include/config/ksym/ to include/ksym/.
      The directory include/ksym/ can be removed by 'make clean' because
      it is meaningless for the external module building.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
    • Masahiro Yamada's avatar
      kbuild: move CONFIG_TRIM_UNUSED_KSYMS code unneeded for external module · 50caa2b4
      Masahiro Yamada authored
      The external module building does not need to parse this code because
      KBUILD_MODULES is always set anyway.
      Move this code inside the "ifeq ($(KBUILD_EXTMOD),) ... endif" block.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
    • Masahiro Yamada's avatar
      kbuild: restore autoksyms.h touch to the top Makefile · 02a46428
      Masahiro Yamada authored
      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
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
    • Masahiro Yamada's avatar
      kbuild: move 'scripts' target below · 2aa8b409
      Masahiro Yamada authored
      Just a trivial change to prepare for the next commit.
      This target is still invisible from external module building.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    • Masahiro Yamada's avatar
      kbuild: clear LDFLAGS in the top Makefile · 8c533b27
      Masahiro Yamada authored
      Currently LDFLAGS is not cleared, so same flags are accumulated in
      LDFLAGS when the top Makefile is recursively invoked.
      I found unneeded rebuild for ARCH=arm64 when CONFIG_TRIM_UNUSED_KSYMS
      is enabled.  If include/generated/autoksyms.h is updated, the top
      Makefile is recursively invoked, then arch/arm64/Makefile adds one
      more '-maarch64linux'.  Due to the command line change, modules are
      rebuilt needlessly.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
  2. 19 Mar, 2018 1 commit
  3. 15 Mar, 2018 1 commit
    • Arnd Bergmann's avatar
      arch: remove tile port · 7c664dd0
      Arnd Bergmann authored
      The Tile architecture port was added by Chris Metcalf in 2010, and
      maintained until early 2018 when he orphaned it due to his departure
      from Mellanox, and nobody else stepped up to maintain it. The product
      line is still around in the form of the BlueField SoC, but no longer
      uses the Tile architecture.
      There are also still products for sale with Tile-GX SoCs, notably the
      Mikrotik CCR router family. The products all use old (linux-3.3) kernels
      with lots of patches and won't be upgraded by their manufacturers. There
      have been efforts to port both OpenWRT and Debian to these, but both
      projects have stalled and are very unlikely to be continued in the future.
      Given that we are reasonably sure that nobody is still using the port
      with an upstream kernel any more, it seems better to remove it now while
      the port is in a good shape than to let it bitrot for a few years first.
      Cc: Chris Metcalf <chris.d.metcalf@gmail.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Link: http://www.mellanox.com/page/npu_multicore_overview
      Link: https://jenkins.debian.net/view/rebootstrap/job/rebootstrap_tilegx_gcc7/Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
  4. 14 Mar, 2018 1 commit
    • Masahiro Yamada's avatar
      kbuild: add PYTHON2 and PYTHON3 variables · 250d5146
      Masahiro Yamada authored
      The variable 'PYTHON' allows users to specify a proper executable
      name in case the default 'python' does not work.  However, this does
      not address the case where both Python 2.x and 3.x scripts are used
      in one source tree.
      PEP 394 (https://www.python.org/dev/peps/pep-0394/) provides a
      convention for Python scripts portability.  Here is a quotation:
        In order to tolerate differences across platforms, all new code
        that needs to invoke the Python interpreter should not specify
        'python', but rather should specify either 'python2' or 'python3'.
        This distinction should be made in shebangs, when invoking from a
        shell script, when invoking via the system() call, or when invoking
        in any other context.
        One exception to this is scripts that are deliberately written to
        be source compatible with both Python 2.x and 3.x. Such scripts may
        continue to use python on their shebang line without affecting their
      To meet this requirement, this commit adds new variables 'PYTHON2'
      and 'PYTHON3'.
      arch/ia64/scripts/unwcheck.py is the only script that has ever used
      $(PYTHON).  Recent commit bd5edbe6 ("ia64: convert unwcheck.py to
      python3") converted it to be compatible with both Python 2.x and 3.x,
      so this is the exceptional case where the use of 'python' is allowed.
      So, I did not touch arch/ia64/Makefile.
      tools/perf/Makefile.config sets PYTHON and PYTHON2 by itself, so it
      is not affected by this commit.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
  5. 12 Mar, 2018 4 commits
  6. 04 Mar, 2018 1 commit
  7. 02 Mar, 2018 1 commit
  8. 01 Mar, 2018 2 commits
    • Luc Van Oostenryck's avatar
      kbuild: disable sparse warnings about unknown attributes · 6c49f359
      Luc Van Oostenryck authored
      Currently, sparse issues warnings on code using an attribute
      it doesn't know about.
      One of the problem with this is that these warnings have no
      value for the developer, it's just noise for him. At best these
      warnings tell something about some deficiencies of sparse itself
      but not about a potential problem with code analyzed.
      A second problem with this is that sparse release are, alas,
      less frequent than new attributes are added to GCC.
      So, avoid the noise by asking sparse to not warn about
      attributes it doesn't know about.
      Reference: https://marc.info/?l=linux-sparse&m=151871600016790
      Reference: https://marc.info/?l=linux-sparse&m=151871725417322Signed-off-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    • Ulf Magnusson's avatar
      Makefile: Fix lying comment re. silentoldconfig · 61277981
      Ulf Magnusson authored
      The comment above the silentoldconfig invocation is outdated.
      'make oldconfig' updates just .config and doesn't touch the
      include/config/ tree.
      This came up in https://lkml.org/lkml/2018/2/12/415.
      While fixing the comment, make it more informative by explaining the
      purpose of the unfortunately named silentoldconfig.
      I can't make sense of the comment re. auto.conf.cmd and a cleaned tree.
      include/config/auto.conf and include/config/auto.conf.cmd are both
      created simultaneously by silentoldconfig (in
      scripts/kconfig/confdata.c, by conf_write_autoconf()), and nothing seems
      to remove auto.conf.cmd that wouldn't remove auto.conf. Remove that part
      of the comment rather than blindly copying it. It might be a leftover
      from an older way of doing things.
      The include/config/auto.conf.cmd prerequisite might be there to ensure
      that silentoldconfig gets rerun if conf_write_autoconf() fails between
      writing out auto.conf.cmd and auto.conf (a comment in the function
      indicates that auto.conf is deliberately written out last to mark
      completion of the operation). It seems the Makefile dependency between
      include/config/auto.conf and .config would already take care of that
      though, since include/config/auto.conf would still be out of date re.
      .config if the operation fails.
      Cop out and leave the prerequisite in for now.
      Signed-off-by: default avatarUlf Magnusson <ulfalizer@gmail.com>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
  9. 26 Feb, 2018 1 commit
  10. 21 Feb, 2018 1 commit
  11. 19 Feb, 2018 1 commit
  12. 11 Feb, 2018 1 commit
  13. 07 Feb, 2018 5 commits
  14. 28 Jan, 2018 1 commit
  15. 21 Jan, 2018 1 commit
  16. 14 Jan, 2018 1 commit
  17. 07 Jan, 2018 1 commit
  18. 31 Dec, 2017 1 commit
  19. 30 Dec, 2017 1 commit
    • Linus Torvalds's avatar
      kbuild: add '-fno-stack-check' to kernel build options · 3ce120b1
      Linus Torvalds authored
      It appears that hardened gentoo enables "-fstack-check" by default for
      That doesn't work _at_all_ for the kernel, because the kernel stack
      doesn't act like a user stack at all: it's much smaller, and it doesn't
      auto-expand on use.  So the extra "probe one page below the stack" code
      generated by -fstack-check just breaks the kernel in horrible ways,
      causing infinite double faults etc.
      [ I have to say, that the particular code gcc generates looks very
        stupid even for user space where it works, but that's a separate
        issue.  ]
      Reported-and-tested-by: default avatarAlexander Tsoy <alexander@tsoy.me>
      Reported-and-tested-by: default avatarToralf Förster <toralf.foerster@gmx.de>
      Cc: stable@kernel.org
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  20. 24 Dec, 2017 1 commit
  21. 18 Dec, 2017 1 commit
  22. 16 Dec, 2017 1 commit
  23. 11 Dec, 2017 1 commit
  24. 06 Dec, 2017 1 commit
  25. 03 Dec, 2017 1 commit
  26. 27 Nov, 2017 1 commit