1. 16 11月, 2017 1 次提交
  2. 13 11月, 2017 3 次提交
    • M
      kbuild: do not call cc-option before KBUILD_CFLAGS initialization · 433dc2eb
      Masahiro Yamada 提交于
      Some $(call cc-option,...) are invoked very early, even before
      KBUILD_CFLAGS, etc. are initialized.
      
      The returned string from $(call cc-option,...) depends on
      KBUILD_CPPFLAGS, KBUILD_CFLAGS, and GCC_PLUGINS_CFLAGS.
      
      Since they are exported, they are not empty when the top Makefile
      is recursively invoked.
      
      The recursion occurs in several places.  For example, the top
      Makefile invokes itself for silentoldconfig.  "make tinyconfig",
      "make rpm-pkg" are the cases, too.
      
      In those cases, the second call of cc-option from the same line
      runs a different shell command due to non-pristine KBUILD_CFLAGS.
      
      To get the same result all the time, KBUILD_* and GCC_PLUGINS_CFLAGS
      must be initialized before any call of cc-option.  This avoids
      garbage data in the .cache.mk file.
      
      Move all calls of cc-option below the config targets because target
      compiler flags are unnecessary for Kconfig.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NDouglas Anderson <dianders@chromium.org>
      433dc2eb
    • D
      kbuild: Cache a few more calls to the compiler · 4e562071
      Douglas Anderson 提交于
      These are a few stragglers that I left out of the original patch to
      cache calls to the C compiler ("kbuild: Add a cache for generated
      variables") because they bleed out into the main Makefile and thus
      uglify things a little bit.  The idea is the same here, though.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NIngo Molnar <mingo@kernel.org>
      Tested-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      4e562071
    • D
      kbuild: Add a cache for generated variables · 3298b690
      Douglas Anderson 提交于
      While timing a "no-op" build of the kernel (incrementally building the
      kernel even though nothing changed) in the Chrome OS build system I
      found that it was much slower than I expected.
      
      Digging into things a bit, I found that quite a bit of the time was
      spent invoking the C compiler even though we weren't actually building
      anything.  Currently in the Chrome OS build system the C compiler is
      called through a number of wrappers (one of which is written in
      python!) and can take upwards of 100 ms to invoke even if we're not
      doing anything difficult, so these invocations of the compiler were
      taking a lot of time.  Worse the invocations couldn't seem to take
      advantage of the multiple cores on my system.
      
      Certainly it seems like we could make the compiler invocations in the
      Chrome OS build system faster, but only to a point.  Inherently
      invoking a program as big as a C compiler is a fairly heavy
      operation.  Thus even if we can speed the compiler calls it made sense
      to track down what was happening.
      
      It turned out that all the compiler invocations were coming from
      usages like this in the kernel's Makefile:
      
      KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
      
      Due to the way cc-option and similar statements work the above
      contains an implicit call to the C compiler.  ...and due to the fact
      that we're storing the result in KBUILD_CFLAGS, a simply expanded
      variable, the call will happen every time the Makefile is parsed, even
      if there are no users of KBUILD_CFLAGS.
      
      Rather than redoing this computation every time, it makes a lot of
      sense to cache the result of all of the Makefile's compiler calls just
      like we do when we compile a ".c" file to a ".o" file.  Conceptually
      this is quite a simple idea.  ...and since the calls to invoke the
      compiler and similar tools are centrally located in the Kbuild.include
      file this doesn't even need to be super invasive.
      
      Implementing the cache in a simple-to-use and efficient way is not
      quite as simple as it first sounds, though.  To get maximum speed we
      really want the cache in a format that make can natively understand
      and make doesn't really have an ability to load/parse files. ...but
      make _can_ import other Makefiles, so the solution is to store the
      cache in Makefile format.  This requires coming up with a valid/unique
      Makefile variable name for each value to be cached, but that's
      solvable with some cleverness.
      
      After this change, we'll automatically create a ".cache.mk" file that
      will contain our cached variables.  We'll load this on each invocation
      of make and will avoid recomputing anything that's already in our
      cache.  The cache is stored in a format that it shouldn't need any
      invalidation since anything that might change should affect the "key"
      and any old cached value won't be used.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NIngo Molnar <mingo@kernel.org>
      Tested-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      3298b690
  3. 26 10月, 2017 1 次提交
  4. 10 10月, 2017 3 次提交
  5. 09 10月, 2017 1 次提交
  6. 02 10月, 2017 1 次提交
  7. 25 9月, 2017 1 次提交
  8. 21 9月, 2017 1 次提交
    • S
      Makefile: kselftest and kselftest-clean fail for make O=dir case · 2bc84526
      Shuah Khan 提交于
      kselftest and kselftest-clean targets fail when object directory is
      specified to relocate objects. Fix it so it can find the source tree
      to build from.
      
      make O=/tmp/kselftest_top kselftest
      
      make[1]: Entering directory '/tmp/kselftest_top'
      make[2]: Entering directory '/tmp/kselftest_top'
      make[2]: *** tools/testing/selftests: No such file or directory.  Stop.
      make[2]: Leaving directory '/tmp/kselftest_top'
      ./linux-kselftest/Makefile:1185: recipe for target
      'kselftest' failed
      make[1]: *** [kselftest] Error 2
      make[1]: Leaving directory '/tmp/kselftest_top'
      Makefile:145: recipe for target 'sub-make' failed
      make: *** [sub-make] Error 2
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      Acked-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      2bc84526
  9. 17 9月, 2017 2 次提交
  10. 15 9月, 2017 1 次提交
    • G
      firmware: delete in-kernel firmware · 5620a0d1
      Greg Kroah-Hartman 提交于
      The last firmware change for the in-kernel firmware source code was back
      in 2013.  Everyone has been relying on the out-of-tree linux-firmware
      package for a long long time.
      
      So let's drop it, it's baggage we don't need to keep dragging around
      (and having to fix random kbuild issues over time...)
      
      Cc: Kyle McMartin <kyle@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Michal Marek <mmarek@suse.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NDavid Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5620a0d1
  11. 04 9月, 2017 1 次提交
  12. 01 9月, 2017 1 次提交
    • M
      kbuild: use $(abspath ...) instead of $(shell cd ... && /bin/pwd) · 8e9b4667
      Masahiro Yamada 提交于
      Kbuild conventionally uses $(shell cd ... && /bin/pwd) idiom to get
      the absolute path of the directory because GNU Make 3.80, the minimal
      supported version at that time, did not support $(abspath ...) or
      $(realpath ...).
      
      Commit 37d69ee3 ("docs: bump minimal GNU Make version to 3.81")
      dropped the GNU Make 3.80 support, so we are now allowed to use those
      make-builtin helpers.
      
      This conversion will provide better portability without relying on
      the pwd command or its location /bin/pwd.
      
      I am intentionally using $(realpath ...) instead $(abspath ...) in
      some places.  The difference between the two is $(realpath ...)
      returns an empty string if the given path does not exist.  It is
      convenient in places where we need to error-out if the makefile fails
      to create an output directory.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NThierry Reding <treding@nvidia.com>
      8e9b4667
  13. 28 8月, 2017 1 次提交
  14. 21 8月, 2017 3 次提交
  15. 14 8月, 2017 1 次提交
  16. 09 8月, 2017 1 次提交
  17. 07 8月, 2017 1 次提交
  18. 31 7月, 2017 1 次提交
  19. 24 7月, 2017 2 次提交
  20. 16 7月, 2017 1 次提交
  21. 13 7月, 2017 1 次提交
    • L
      disable new gcc-7.1.1 warnings for now · bd664f6b
      Linus Torvalds 提交于
      I made the mistake of upgrading my desktop to the new Fedora 26 that
      comes with gcc-7.1.1.
      
      There's nothing wrong per se that I've noticed, but I now have 1500
      lines of warnings, mostly from the new format-truncation warning
      triggering all over the tree.
      
      We use 'snprintf()' and friends in a lot of places, and often know that
      the numbers are fairly small (ie a controller index or similar), but gcc
      doesn't know that, and sees an 'int', and thinks that it could be some
      huge number.  And then complains when our buffers are not able to fit
      the name for the ten millionth controller.
      
      These warnings aren't necessarily bad per se, and we probably want to
      look through them subsystem by subsystem, but at least during the merge
      window they just mean that I can't even see if somebody is introducing
      any *real* problems when I pull.
      
      So warnings disabled for now.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bd664f6b
  22. 11 7月, 2017 2 次提交
  23. 10 7月, 2017 2 次提交
  24. 03 7月, 2017 2 次提交
  25. 30 6月, 2017 1 次提交
    • N
      kbuild: handle libs-y archives separately from built-in.o archives · 3a166fc2
      Nicholas Piggin 提交于
      The thin archives build currently puts all lib.a and built-in.o
      files together and links them with --whole-archive.
      
      This works because thin archives can recursively refer to thin
      archives. However some architectures include libgcc.a, which may
      not be a thin archive, or it may not be constructed with the "P"
      option, in which case its contents do not get linked correctly.
      
      So don't pull .a libs into the root built-in.o archive. These
      libs should already have symbol tables and indexes built, so they
      can be direct linker inputs. Move them out of the --whole-archive
      option, which restore the conditional linking behaviour of lib.a
      to thin archives builds.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      3a166fc2
  26. 26 6月, 2017 1 次提交
  27. 25 6月, 2017 1 次提交
  28. 24 6月, 2017 1 次提交
  29. 22 6月, 2017 1 次提交