Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Mar 14, 2021
  2. Mar 11, 2021
  3. Mar 09, 2021
  4. Mar 05, 2021
  5. Feb 28, 2021
  6. Feb 25, 2021
  7. Feb 24, 2021
  8. Feb 23, 2021
    • Sami Tolvanen's avatar
      kbuild: lto: force rebuilds when switching CONFIG_LTO · 5e95325f
      Sami Tolvanen authored
      
      When doing non-clean builds and switching between CONFIG_LTO=n and
      CONFIG_LTO=y, the build system (correctly) didn't notice that assembly
      and LTO-excluded C object files were rewritten in place by objtool (to
      add the .orc_unwind* sections), since their build command lines were the
      same between CONFIG_LTO=y and CONFIG_LTO=n. The objtool step would fail:
      
      vmlinux.o: warning: objtool: file already has .orc_unwind section, skipping
      make: *** [Makefile:1194: vmlinux] Error 255
      
      Avoid this by making sure the build will see a difference between an LTO
      and non-LTO build (by including "-fno-lto" in KBUILD_*FLAGS). This will
      get ignored when CC_FLAGS_LTO is present, and will not be included at
      all when CONFIG_LTO=n.
      
      Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      5e95325f
    • Sami Tolvanen's avatar
      tracing: add support for objtool mcount · 22c8542d
      Sami Tolvanen authored
      
      This change adds build support for using objtool to generate
      __mcount_loc sections.
      
      Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
      22c8542d
  9. Feb 17, 2021
  10. Feb 15, 2021
    • Sasha Levin's avatar
      kbuild: simplify access to the kernel's version · 88a68672
      Sasha Levin authored
      
      Instead of storing the version in a single integer and having various
      kernel (and userspace) code how it's constructed, export individual
      (major, patchlevel, sublevel) components and simplify kernel code that
      uses it.
      
      This should also make it easier on userspace.
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      88a68672
    • Sasha Levin's avatar
      kbuild: clamp SUBLEVEL to 255 · 9b82f13e
      Sasha Levin authored
      
      Right now if SUBLEVEL becomes larger than 255 it will overflow into the
      territory of PATCHLEVEL, causing havoc in userspace that tests for
      specific kernel version.
      
      While userspace code tests for MAJOR and PATCHLEVEL, it doesn't test
      SUBLEVEL at any point as ABI changes don't happen in the context of
      stable tree.
      
      Thus, to avoid overflows, simply clamp SUBLEVEL to it's maximum value in
      the context of LINUX_VERSION_CODE. This does not affect "make
      kernelversion" and such.
      
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      9b82f13e
    • Nick Desaulniers's avatar
      Kconfig: allow explicit opt in to DWARF v5 · 98cd6f52
      Nick Desaulniers authored
      DWARF v5 is the latest standard of the DWARF debug info format. GCC 11
      will change the implicit default DWARF version, if left unspecified, to
      DWARF v5.
      
      Allow users of Clang and older versions of GCC that have not changed the
      implicit default DWARF version to DWARF v5 to opt in. This can help
      testing consumers of DWARF debug info in preparation of v5 becoming more
      widespread, as well as result in significant binary size savings of the
      pre-stripped vmlinux image.
      
      DWARF5 wins significantly in terms of size when mixed with compression
      (CONFIG_DEBUG_INFO_COMPRESSED).
      
      363M    vmlinux.clang12.dwarf5.compressed
      434M    vmlinux.clang12.dwarf4.compressed
      439M    vmlinux.clang12.dwarf2.compressed
      457M    vmlinux.clang12.dwarf5
      536M    vmlinux.clang12.dwarf4
      548M    vmlinux.clang12.dwarf2
      
      515M    vmlinux.gcc10.2.dwarf5.compressed
      599M    vmlinux.gcc10.2.dwarf4.compressed
      624M    vmlinux.gcc10.2.dwarf2.compressed
      630M    vmlinux.gcc10.2.dwarf5
      765M    vmlinux.gcc10.2.dwa...
      98cd6f52
    • Nick Desaulniers's avatar
      Kbuild: make DWARF version a choice · a66049e2
      Nick Desaulniers authored
      
      Adds a default CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT which allows
      the implicit default version of DWARF emitted by the toolchain to
      progress over time.
      
      Modifies CONFIG_DEBUG_INFO_DWARF4 to be a member of a choice, making it
      mutually exclusive with CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT. Users
      may want to select this if they are using a newer toolchain, but have
      consumers of the DWARF debug info that aren't yet ready for newer DWARF
      versions' debug info.
      
      Does so in a way that's forward compatible with existing
      configs, and makes adding future versions more straightforward. This
      patch does not change the current behavior or selection of DWARF
      version for users upgrading to kernels with this patch.
      
      GCC since ~4.8 has defaulted to DWARF v4 implicitly, and GCC 11 has
      bumped this to v5.
      
      Remove the Kconfig help text  about DWARF v4 being larger.  It's
      empirically false for the latest toolchains for x86_64 defconfig, has no
      point of reference (I suspect it was DWARF v2 but that's stil
      empirically false), and debug info size is not a qualatative measure.
      
      Suggested-by: default avatarArvind Sankar <nivedita@alum.mit.edu>
      Suggested-by: default avatarFangrui Song <maskray@google.com>
      Suggested-by: default avatarJakub Jelinek <jakub@redhat.com>
      Suggested-by: default avatarMark Wielaard <mark@klomp.org>
      Suggested-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Suggested-by: default avatarNathan Chancellor <nathan@kernel.org>
      Tested-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      a66049e2
    • Masahiro Yamada's avatar
      kbuild: stop removing stale <linux/version.h> file · 0dd77e95
      Masahiro Yamada authored
      Revert commit 223c24a7
      
       ("kbuild: Automatically remove stale
      <linux/version.h> file").
      
      It was more than 6 years ago. I do not expect anybody to start
      git-bisect for such a big window.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      0dd77e95
  11. Feb 14, 2021
  12. Feb 11, 2021
  13. Feb 09, 2021
  14. Feb 07, 2021
  15. Feb 05, 2021
  16. Feb 04, 2021
  17. Jan 31, 2021
  18. Jan 29, 2021
  19. Jan 27, 2021
  20. Jan 24, 2021
  21. Jan 17, 2021
  22. Jan 14, 2021
  23. Jan 10, 2021
  24. Jan 08, 2021
  25. Jan 03, 2021
  26. Dec 27, 2020