1. 26 3月, 2018 5 次提交
    • 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
    • M
      kbuild: move 'scripts' target below · d8821622
      Masahiro Yamada 提交于
      Just a trivial change to prepare for the next commit.
      This target is still invisible from external module building.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      d8821622
    • M
      kbuild: clear LDFLAGS in the top Makefile · ce99d0bf
      Masahiro Yamada 提交于
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      ce99d0bf
    • M
      kbuild: process mixture of clean/build targets one by one · 22340a06
      Masahiro Yamada 提交于
      Support parallel building of clean, config, and build targets in a
      single command.
      
      For example,
      
        make -j<N> clean all
      
      or
      
        make -j<N> mrproper defconfig all
      
      They should be handled one by one.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      22340a06
    • N
      kbuild: rename built-in.o to built-in.a · f49821ee
      Nicholas Piggin 提交于
      Incremental linking is gone, so rename built-in.o to built-in.a, which
      is the usual extension for archive files.
      
      This patch does two things, first is a simple search/replace:
      
      git grep -l 'built-in\.o' | xargs sed -i 's/built-in\.o/built-in\.a/g'
      
      The second is to invert nesting of nested text manipulations to avoid
      filtering built-in.a out from libs-y2:
      
      -libs-y2 := $(filter-out %.a, $(patsubst %/, %/built-in.a, $(libs-y)))
      +libs-y2 := $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y)))
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      f49821ee
  2. 12 3月, 2018 1 次提交
  3. 05 3月, 2018 1 次提交
  4. 02 3月, 2018 1 次提交
  5. 01 3月, 2018 2 次提交
    • L
      kbuild: disable sparse warnings about unknown attributes · 6c49f359
      Luc Van Oostenryck 提交于
      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: NLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Acked-by: NRandy Dunlap <rdunlap@infradead.org>
      Tested-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      6c49f359
    • U
      Makefile: Fix lying comment re. silentoldconfig · 61277981
      Ulf Magnusson 提交于
      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: NUlf Magnusson <ulfalizer@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      61277981
  6. 26 2月, 2018 1 次提交
  7. 21 2月, 2018 1 次提交
  8. 19 2月, 2018 1 次提交
  9. 12 2月, 2018 1 次提交
  10. 07 2月, 2018 5 次提交
  11. 29 1月, 2018 1 次提交
  12. 22 1月, 2018 1 次提交
  13. 15 1月, 2018 1 次提交
  14. 08 1月, 2018 1 次提交
  15. 01 1月, 2018 1 次提交
  16. 31 12月, 2017 1 次提交
    • L
      kbuild: add '-fno-stack-check' to kernel build options · 3ce120b1
      Linus Torvalds 提交于
      It appears that hardened gentoo enables "-fstack-check" by default for
      gcc.
      
      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: NAlexander Tsoy <alexander@tsoy.me>
      Reported-and-tested-by: NToralf 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: NLinus Torvalds <torvalds@linux-foundation.org>
      3ce120b1
  17. 24 12月, 2017 1 次提交
  18. 18 12月, 2017 1 次提交
  19. 16 12月, 2017 1 次提交
  20. 11 12月, 2017 1 次提交
  21. 06 12月, 2017 1 次提交
  22. 04 12月, 2017 1 次提交
  23. 27 11月, 2017 1 次提交
  24. 23 11月, 2017 3 次提交
  25. 18 11月, 2017 3 次提交
    • M
      kbuild: create built-in.o automatically if parent directory wants it · f7adc312
      Masahiro Yamada 提交于
      "obj-y += foo/" syntax requires Kbuild to visit the "foo" subdirectory
      and link built-in.o from that directory.  This means foo/Makefile is
      responsible for creating built-in.o even if there is no object to
      link (in this case, built-in.o is an empty archive).
      
      We have had several fixups like commit 4b024242 ("kbuild: Fix
      linking error built-in.o no such file or directory"), then ended up
      with a complex condition as follows:
      
        ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),)
        builtin-target := $(obj)/built-in.o
        endif
      
      We still have more cases not covered by the above, so we need to add
        obj- := dummy.o
      in several places just for creating empty built-in.o.
      
      A key point is, the parent Makefile knows whether built-in.o is needed
      or not.  If a subdirectory needs to create built-in.o, its parent can
      tell the fact when descending.
      
      If non-empty $(need-builtin) flag is passed from the parent, built-in.o
      should be created.  $(obj-y) should be still checked to support the
      single target "%/".  All of ugly tricks will go away.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NSam Ravnborg <sam@ravnborg.org>
      f7adc312
    • B
      kbuild: /bin/pwd -> pwd · 16f8259c
      Bjørn Forsman 提交于
      Most places use pwd and rely on $PATH lookup. Moving the remaining
      absolute path /bin/pwd users over for consistency.
      
      Also, a reason for doing /bin/pwd -> pwd instead of the other way around
      is because I believe build systems should make little assumptions on
      host filesystem layout. Case in point, we do this kind of patching
      already in NixOS.
      
      Ref. commit 028568d8
      ("kbuild: revert $(realpath ...) to $(shell cd ... && /bin/pwd)").
      Signed-off-by: NBjørn Forsman <bjorn.forsman@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      16f8259c
    • V
      Makefile: support flag -fsanitizer-coverage=trace-cmp · d677a4d6
      Victor Chibotaru 提交于
      The flag enables Clang instrumentation of comparison operations
      (currently not supported by GCC).  This instrumentation is needed by the
      new KCOV device to collect comparison operands.
      
      Link: http://lkml.kernel.org/r/20171011095459.70721-2-glider@google.comSigned-off-by: NVictor Chibotaru <tchibo@google.com>
      Signed-off-by: NAlexander Potapenko <glider@google.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Andrey Konovalov <andreyknvl@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Alexander Popov <alex.popov@linux.com>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Vegard Nossum <vegard.nossum@oracle.com>
      Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
      Cc: <syzkaller@googlegroups.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d677a4d6
  26. 16 11月, 2017 2 次提交