1. 28 2月, 2021 1 次提交
  2. 26 2月, 2021 1 次提交
  3. 24 2月, 2021 6 次提交
  4. 18 2月, 2021 1 次提交
  5. 16 2月, 2021 5 次提交
    • S
      kbuild: simplify access to the kernel's version · 88a68672
      Sasha Levin 提交于
      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: NSasha Levin <sashal@kernel.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      88a68672
    • S
      kbuild: clamp SUBLEVEL to 255 · 9b82f13e
      Sasha Levin 提交于
      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: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      9b82f13e
    • N
      Kconfig: allow explicit opt in to DWARF v5 · 98cd6f52
      Nick Desaulniers 提交于
      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.dwarf4
      809M    vmlinux.gcc10.2.dwarf2
      
      Though the quality of debug info is harder to quantify; size is not a
      proxy for quality.
      
      Jakub notes:
        One thing is GCC DWARF-5 support, that is whether the compiler will
        support -gdwarf-5 flag, and that support should be there from GCC 7
        onwards.
      
        All [GCC] 5.1 - 6.x did was start accepting -gdwarf-5 as experimental
        option that enabled some small DWARF subset (initially only a few
        DW_LANG_* codes newly added to DWARF5 drafts).  Only GCC 7 (released
        after DWARF 5 has been finalized) started emitting DWARF5 section
        headers and got most of the DWARF5 changes in...
      
        Another separate thing is whether the assembler does support
        the -gdwarf-5 option (i.e. if you can compile assembler files
        with -Wa,-gdwarf-5) ... That option is about whether the assembler
        will emit DWARF5 or DWARF2 .debug_line.  It is fine to compile C sources
        with -gdwarf-5 and use DWARF2 .debug_line for assembler files if as
        doesn't support it.
      
      Version check GCC so that we don't need to worry about the difference in
      command line args between GNU readelf and llvm-readelf/llvm-dwarfdump to
      validate the DWARF Version in the assembler feature detection script.
      
      Most issues with clang produced assembler were fixed in binutils 2.35.1,
      but 2.35.2 fixed issues related to requiring the flag -Wa,-gdwarf-5
      explicitly. The added shell script test checks for the latter, and is
      only required when using clang without its integrated assembler, though
      we use for clang regardless as we do not yet have a way to query the
      assembler from Kconfig.
      
      Disabled for now if CONFIG_DEBUG_INFO_BTF is set; pahole doesn't yet
      recognize the new additions to the DWARF debug info.
      
      This only modifies the DWARF version emitted by the compiler, not the
      assembler.
      
      The DWARF version of a binary can be validated with:
      $ llvm-dwarfdump <object file> | head -n 4 | grep version
      or
      $ readelf --debug-dump=info <object file> 2>/dev/null | grep Version
      
      Parts of the tree don't reuse DEBUG_CFLAGS as they should; such cleanup
      is left as a follow up.
      
      Link: http://www.dwarfstd.org/doc/DWARF5.pdf
      Link: https://bugzilla.redhat.com/show_bug.cgi?id=1922707Reported-by: NSedat Dilek <sedat.dilek@gmail.com>
      Suggested-by: NArvind Sankar <nivedita@alum.mit.edu>
      Suggested-by: NCaroline Tice <cmtice@google.com>
      Suggested-by: NFangrui Song <maskray@google.com>
      Suggested-by: NJakub Jelinek <jakub@redhat.com>
      Suggested-by: NMasahiro Yamada <masahiroy@kernel.org>
      Suggested-by: NNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: NNick Desaulniers <ndesaulniers@google.com>
      Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM/Clang v12.0.0-rc1 x86-64
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      98cd6f52
    • N
      Kbuild: make DWARF version a choice · a66049e2
      Nick Desaulniers 提交于
      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: NArvind Sankar <nivedita@alum.mit.edu>
      Suggested-by: NFangrui Song <maskray@google.com>
      Suggested-by: NJakub Jelinek <jakub@redhat.com>
      Suggested-by: NMark Wielaard <mark@klomp.org>
      Suggested-by: NMasahiro Yamada <masahiroy@kernel.org>
      Suggested-by: NNathan Chancellor <nathan@kernel.org>
      Tested-by: NSedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      a66049e2
    • M
      kbuild: stop removing stale <linux/version.h> file · 0dd77e95
      Masahiro Yamada 提交于
      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: NMasahiro Yamada <masahiroy@kernel.org>
      0dd77e95
  6. 15 2月, 2021 1 次提交
  7. 12 2月, 2021 2 次提交
  8. 09 2月, 2021 1 次提交
  9. 08 2月, 2021 1 次提交
  10. 05 2月, 2021 1 次提交
  11. 04 2月, 2021 1 次提交
  12. 01 2月, 2021 2 次提交
  13. 30 1月, 2021 1 次提交
  14. 28 1月, 2021 1 次提交
  15. 25 1月, 2021 1 次提交
  16. 18 1月, 2021 1 次提交
  17. 15 1月, 2021 3 次提交
  18. 11 1月, 2021 1 次提交
  19. 09 1月, 2021 1 次提交
  20. 04 1月, 2021 1 次提交
  21. 28 12月, 2020 1 次提交
  22. 21 12月, 2020 1 次提交
  23. 14 12月, 2020 1 次提交
  24. 07 12月, 2020 1 次提交
  25. 01 12月, 2020 1 次提交
  26. 30 11月, 2020 1 次提交
  27. 25 11月, 2020 1 次提交