1. 13 11月, 2017 4 次提交
    • N
      kbuild: fix linker feature test macros when cross compiling with Clang · 86a9df59
      Nick Desaulniers 提交于
      I was not seeing my linker flags getting added when using ld-option when
      cross compiling with Clang. Upon investigation, this seems to be due to
      a difference in how GCC vs Clang handle cross compilation.
      
      GCC is configured at build time to support one backend, that is implicit
      when compiling.  Clang is explicit via the use of `-target <triple>` and
      ships with all supported backends by default.
      
      GNU Make feature test macros that compile then link will always fail
      when cross compiling with Clang unless Clang's triple is passed along to
      the compiler. For example:
      
      $ clang -x c /dev/null -c -o temp.o
      $ aarch64-linux-android/bin/ld -E temp.o
      aarch64-linux-android/bin/ld:
      unknown architecture of input file `temp.o' is incompatible with
      aarch64 output
      aarch64-linux-android/bin/ld:
      warning: cannot find entry symbol _start; defaulting to
      0000000000400078
      $ echo $?
      1
      
      $ clang -target aarch64-linux-android- -x c /dev/null -c -o temp.o
      $ aarch64-linux-android/bin/ld -E temp.o
      aarch64-linux-android/bin/ld:
      warning: cannot find entry symbol _start; defaulting to 00000000004002e4
      $ echo $?
      0
      
      This causes conditional checks that invoke $(CC) without the target
      triple, then $(LD) on the result, to always fail.
      Suggested-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: NMatthias Kaehlcke <mka@chromium.org>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      86a9df59
    • M
      kbuild: shrink .cache.mk when it exceeds 1000 lines · e17c400a
      Masahiro Yamada 提交于
      The cache files are only cleaned away by "make clean".  If you continue
      incremental builds, the cache files will grow up little by little.
      It is not a big deal in general use cases because compiler flags do not
      change quite often.
      
      However, if you do build-test for various architectures, compilers, and
      kernel configurations, you will end up with huge cache files soon.
      
      When the cache file exceeds 1000 lines, shrink it down to 500 by "tail".
      The Least Recently Added lines are cut. (not Least Recently Used)
      I hope it will work well enough.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NDouglas Anderson <dianders@chromium.org>
      e17c400a
    • 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
    • M
      kbuild: add forward declaration of default target to Makefile.asm-generic · a7d34df3
      Masahiro Yamada 提交于
      $(kbuild-file) and Kbuild.include are included before the default
      target "all".
      
      We will add a target into Kbuild.include.  In advance, add a forward
      declaration of the default target.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NDouglas Anderson <dianders@chromium.org>
      a7d34df3
  2. 30 10月, 2017 1 次提交
  3. 26 10月, 2017 1 次提交
  4. 10 10月, 2017 1 次提交
  5. 09 10月, 2017 2 次提交
  6. 28 9月, 2017 1 次提交
  7. 20 9月, 2017 4 次提交
    • F
      scripts/dtc: dtx_diff - 2nd update of include dts paths to match build · 35f3c984
      Frank Rowand 提交于
      Update dtx_diff include paths in the same manner as:
      commit b12869a8 ("of: remove drivers/of/testcase-data from
      include search path for CPP"), commit 5ffa2aed ("of: remove
      arch/$(SRCARCH)/boot/dts from include search path for CPP"), and
      commit 50f9ddaf ("of: search scripts/dtc/include-prefixes path
      for both CPP and DTC").
      
      Remove proposed include path kernel/dts/, which was never implemented
      for the dtb build.
      
      For the diff case, each source file is compiled separately.  For
      each of those compiles, provide the location of the source file
      as an include path, not the location of both source files.
      Signed-off-by: NFrank Rowand <frank.rowand@sony.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      35f3c984
    • M
      kbuild: rpm-pkg: fix version number handling · 25b080bd
      Masahiro Yamada 提交于
      The "Release:" field of the spec file is determined based on the
      .version file.
      
      However, the .version file is not copied to the source tar file.
      So, when we build the kernel from the source package, the UTS_VERSION
      always indicates #1.  This does not match with "rpm -q".
      
      The kernel UTS_VERSION and "rpm -q" do not agree for binrpm-pkg, either.
      Please note the kernel has already been built before the spec file is
      created.  Currently, mkspec invokes mkversion.  This script returns an
      incremented version.  So, the "Release:" field of the spec file is
      greater than the version in the kernel by one.
      
      For the source package build (where .version file is missing), we can
      give KBUILD_BUILD_VERSION=%{release} to the build command.
      
      For the binary package build, we can simply read out the .version file
      because it contains the version number that was used for building the
      kernel image.
      
      We can remove scripts/mkversion because scripts/package/Makefile need
      not touch the .version file.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      25b080bd
    • M
      kbuild: deb-pkg: remove firmware package support · cc18abbe
      Masahiro Yamada 提交于
      Commit 5620a0d1 ("firmware: delete in-kernel firmware") deleted
      in-kernel firmware support, including the firmware install command.
      
      So, the firmware package does not make sense any more.  Remove it.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NRiku Voipio <riku.voipio@linaro.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cc18abbe
    • M
      kbuild: rpm-pkg: delete firmware_install to fix build error · 9e090074
      Masahiro Yamada 提交于
      Commit 5620a0d1 ("firmware: delete in-kernel firmware") deleted
      in-kernel firmware support, including "make firmware_install".
      
      Since then, "make rpm-pkg" / "make binrpm-pkg" fails to build with
      the error:
      
        make[2]: *** No rule to make target `firmware_install'.  Stop.
      
      Commit df85b2d7 ("firmware: Restore support for built-in firmware")
      restored the build infrastructure for CONFIG_EXTRA_FIRMWARE, but this
      is out of the scope of "make firmware_install".  So, the right thing to
      do is to kill the use of "make firmware_install".
      
      Fixes: 5620a0d1 ("firmware: delete in-kernel firmware")
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9e090074
  8. 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
  9. 12 9月, 2017 2 次提交
  10. 10 9月, 2017 1 次提交
  11. 09 9月, 2017 6 次提交
  12. 07 9月, 2017 1 次提交
  13. 02 9月, 2017 1 次提交
  14. 01 9月, 2017 3 次提交
  15. 31 8月, 2017 1 次提交
  16. 24 8月, 2017 1 次提交
  17. 22 8月, 2017 3 次提交
  18. 21 8月, 2017 1 次提交
  19. 20 8月, 2017 1 次提交
  20. 10 8月, 2017 1 次提交
  21. 09 8月, 2017 3 次提交