[all-commits] [llvm/llvm-project] ad78ce: [clang][Toolchains][Gnu] pass -gdwarf-* through to...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Wed Oct 26 10:45:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ad78ce44bb4771139d2a18d6e1052268a7507a52
      https://github.com/llvm/llvm-project/commit/ad78ce44bb4771139d2a18d6e1052268a7507a52
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2022-10-26 (Wed, 26 Oct 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.h
    M clang/lib/Driver/ToolChains/Gnu.cpp
    M clang/test/Driver/as-options.s

  Log Message:
  -----------
  [clang][Toolchains][Gnu] pass -gdwarf-* through to assembler

We've been working around this for a long time in the Linux kernel; we
bend over backwards to continue to support CC=clang (w/
-fno-integrated-as) for architectures where clang can't yet be used to
assemble the kernel's assembler sources. Supporting debug info for the
combination of CC=clang w/ GNU binutils as "GAS" has been painful.

Fix this in clang so that we can work towards dropping complexity in the
Linux kernel's build system, Kbuild, for supporting this combination of
tools.

GAS added support for -gdwarf-{3|4|5} in 2020 2.35 release via
commit 31bf18645d98 ("Add support for --dwarf-[3|4|5] to assembler command line.")

Refactor code to share logic between integrated-as and non-integrated-as
for determining the implicit default.  This change will now always
explicitly pass a -gdwarf-* flag to the GNU assembler when -g is
specified.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D136707




More information about the All-commits mailing list