1. 30 8月, 2021 1 次提交
  2. 23 8月, 2021 1 次提交
  3. 16 8月, 2021 1 次提交
  4. 09 8月, 2021 1 次提交
  5. 05 8月, 2021 2 次提交
  6. 02 8月, 2021 1 次提交
  7. 26 7月, 2021 1 次提交
  8. 19 7月, 2021 1 次提交
  9. 18 7月, 2021 1 次提交
  10. 16 7月, 2021 1 次提交
    • L
      Revert "Makefile: Enable -Wimplicit-fallthrough for Clang" · d936eb23
      Linus Torvalds 提交于
      This reverts commit b7eb335e.
      
      It turns out that the problem with the clang -Wimplicit-fallthrough
      warning is not about the kernel source code, but about clang itself, and
      that the warning is unusable until clang fixes its broken ways.
      
      In particular, when you enable this warning for clang, you not only get
      warnings about implicit fallthroughs.  You also get this:
      
         warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough]
      
      which is completely broken becasue it
      
       (a) doesn't even tell you where the problem is (seriously: no line
           numbers, no filename, no nothing).
      
       (b) is fundamentally broken anyway, because there are perfectly valid
           reasons to have a fallthrough statement even if it turns out that
           it can perhaps not be reached.
      
      In the kernel, an example of that second case is code in the scheduler:
      
                      switch (state) {
                      case cpuset:
                              if (IS_ENABLED(CONFIG_CPUSETS)) {
                                      cpuset_cpus_allowed_fallback(p);
                                      state = possible;
                                      break;
                              }
                              fallthrough;
                      case possible:
      
      where if CONFIG_CPUSETS is enabled you actually never hit the
      fallthrough case at all.  But that in no way makes the fallthrough
      wrong.
      
      So the warning is completely broken, and enabling it for clang is a very
      bad idea.
      
      In the meantime, we can keep the gcc option enabled, and make the gcc
      build use
      
          -Wimplicit-fallthrough=5
      
      which means that we will at least continue to require a proper
      fallthrough statement, and that gcc won't silently accept the magic
      comment versions. Because gcc does this all correctly, and while the odd
      "=5" part is kind of obscure, it's documented in [1]:
      
        "-Wimplicit-fallthrough=5 doesn’t recognize any comments as
         fallthrough comments, only attributes disable the warning"
      
      so if clang ever fixes its bad behavior we can try enabling it there again.
      
      Link: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html [1]
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d936eb23
  11. 15 7月, 2021 1 次提交
    • G
      Makefile: Enable -Wimplicit-fallthrough for Clang · b7eb335e
      Gustavo A. R. Silva 提交于
      With the recent fixes for fallthrough warnings, it is now possible to
      enable -Wimplicit-fallthrough for Clang.
      
      It's important to mention that since we have adopted the use of the
      pseudo-keyword macro fallthrough; we also want to avoid having more
      /* fall through */ comments being introduced. Notice that contrary
      to GCC, Clang doesn't recognize any comments as implicit fall-through
      markings when the -Wimplicit-fallthrough option is enabled. So, in
      order to avoid having more comments being introduced, we have to use
      the option -Wimplicit-fallthrough=5 for GCC, which similar to Clang,
      will cause a warning in case a code comment is intended to be used
      as a fall-through marking.
      Co-developed-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
      b7eb335e
  12. 12 7月, 2021 1 次提交
  13. 28 6月, 2021 1 次提交
  14. 21 6月, 2021 1 次提交
  15. 17 6月, 2021 1 次提交
    • M
      kbuild: remove trailing slashes from $(KBUILD_EXTMOD) · 74ee585b
      Masahiro Yamada 提交于
      M= (or KBUILD_EXTMOD) generally expects a directory path without any
      trailing slashes, like M=a/b/c.
      
      If you add a trailing slash, like M=a/b/c/, you will get ugly build
      logs (two slashes in a series), but it still works fine as long as it
      is consistent between 'make modules' and 'make modules_install'.
      
      The following commands correctly build and install the modules.
      
        $ make M=a/b/c/ modules
        $ sudo make M=a/b/c/ modules_install
      
      Since commit ccae4cfa ("kbuild: refactor scripts/Makefile.modinst"),
      a problem happens if you add a trailing slash only for modules_install.
      
        $ make M=a/b/c modules
        $ sudo make M=a/b/c/ modules_install
      
      No module is installed in this case, Johannes Berg reported. [1]
      
      Trim any trailing slashes from $(KBUILD_EXTMOD).
      
      I used the 'dirname' command to remove all the trailing slashes in
      case someone adds more slashes like M=a/b/c/////. The Make's built-in
      function, $(dir ...) cannot take care of such a case.
      
      [1]: https://lore.kernel.org/lkml/10cc8522b27a051e6a9c3e158a4c4b6414fd04a0.camel@sipsolutions.net/
      
      Fixes: ccae4cfa ("kbuild: refactor scripts/Makefile.modinst")
      Reported-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      74ee585b
  16. 15 6月, 2021 1 次提交
  17. 14 6月, 2021 1 次提交
  18. 08 6月, 2021 1 次提交
  19. 07 6月, 2021 1 次提交
  20. 31 5月, 2021 1 次提交
  21. 27 5月, 2021 1 次提交
  22. 26 5月, 2021 1 次提交
  23. 25 5月, 2021 1 次提交
    • N
      Makefile: LTO: have linker check -Wframe-larger-than · 24845dcb
      Nick Desaulniers 提交于
      -Wframe-larger-than= requires stack frame information, which the
      frontend cannot provide. This diagnostic is emitted late during
      compilation once stack frame size is available.
      
      When building with LTO, the frontend simply lowers C to LLVM IR and does
      not have stack frame information, so it cannot emit this diagnostic.
      When the linker drives LTO, it restarts optimizations and lowers LLVM IR
      to object code. At that point, it has stack frame information but
      doesn't know to check for a specific max stack frame size.
      
      I consider this a bug in LLVM that we need to fix. There are some
      details we're working out related to LTO such as which value to use when
      there are multiple different values specified per TU, or how to
      propagate these to compiler synthesized routines properly, if at all.
      
      Until it's fixed, ensure we don't miss these. At that point we can wrap
      this in a compiler version guard or revert this based on the minimum
      support version of Clang.
      
      The error message is not generated during link:
        LTO     vmlinux.o
      ld.lld: warning: stack size limit exceeded (8224) in foobarbaz
      
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Reported-by: 八两学士's avatarCandle Sun <candlesea@gmail.com>
      Suggested-by: NFangrui Song <maskray@google.com>
      Signed-off-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20210312010942.1546679-1-ndesaulniers@google.com
      24845dcb
  24. 24 5月, 2021 4 次提交
  25. 17 5月, 2021 1 次提交
  26. 10 5月, 2021 1 次提交
  27. 06 5月, 2021 3 次提交
  28. 03 5月, 2021 1 次提交
  29. 01 5月, 2021 2 次提交
  30. 26 4月, 2021 1 次提交
  31. 25 4月, 2021 3 次提交
    • N
      kbuild: Add $(KBUILD_HOSTLDFLAGS) to 'has_libelf' test · f634ca65
      Nathan Chancellor 提交于
      Normally, invocations of $(HOSTCC) include $(KBUILD_HOSTLDFLAGS), which
      in turn includes $(HOSTLDFLAGS), which allows users to pass in their own
      flags when linking. However, the 'has_libelf' test does not, meaning
      that if a user requests a specific linker via HOSTLDFLAGS=-fuse-ld=...,
      it is not respected and the build might error.
      
      For example, if a user building with clang wants to use all of the LLVM
      tools without any GNU tools, they might remove all of the GNU tools from
      their system or PATH then build with
      
      $ make HOSTLDFLAGS=-fuse-ld=lld LLVM=1 LLVM_IAS=1
      
      which says use all of the LLVM tools, the integrated assembler, and
      ld.lld for linking host executables. Without this change, the build will
      error because $(HOSTCC) uses its default linker, rather than the one
      requested via -fuse-ld=..., which is GNU ld in clang's case in a default
      configuration.
      
      error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please
      install libelf-dev, libelf-devel or elfutils-libelf-devel
      make[1]: *** [Makefile:1260: prepare-objtool] Error 1
      
      Add $(KBUILD_HOSTLDFLAGS) to the 'has_libelf' test so that the linker
      choice is respected.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/479Signed-off-by: NNathan Chancellor <nathan@kernel.org>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      f634ca65
    • M
      kbuild: merge scripts/Makefile.modsign to scripts/Makefile.modinst · 961ab4a3
      Masahiro Yamada 提交于
      scripts/Makefile.modsign is a subset of scripts/Makefile.modinst,
      and duplicates the code. Let's merge them.
      
      By the way, you do not need to run 'make modules_sign' explicitly
      because modules are signed as a part of 'make modules_install' when
      CONFIG_MODULE_SIG_ALL=y. If CONFIG_MODULE_SIG_ALL=n, mod_sign_cmd is
      set to 'true', so 'make modules_sign' is not functional.
      
      In my understanding, the reason of still keeping this is to handle
      corner cases like commit 64178cb6 ("builddeb: fix stripped module
      signatures if CONFIG_DEBUG_INFO and CONFIG_MODULE_SIG_ALL are set").
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      961ab4a3
    • M
      kbuild: move module strip/compression code into scripts/Makefile.modinst · 65ce9c38
      Masahiro Yamada 提交于
      Both mod_strip_cmd and mod_compress_cmd are only used in
      scripts/Makefile.modinst, hence there is no good reason to define them
      in the top Makefile. Move the relevant code to scripts/Makefile.modinst.
      
      Also, show separate log messages for each of install, strip, sign, and
      compress.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      65ce9c38