0025-clang-Switch-defaults-to-dwarf-5-debug-info-on-Linux.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. From 03f372d251a382df4d063d2f21b49b40ee42c7ff Mon Sep 17 00:00:00 2001
  2. From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  3. Date: Tue, 9 Nov 2021 10:50:47 +0800
  4. Subject: [PATCH 25/34] clang: Switch defaults to dwarf-5 debug info on Linux
  5. GCC 11 has defaulted to DWARF-5 as well, this matches
  6. debug info formats, so mix and match of components with GCC 11
  7. works.
  8. Rebased to LLVM 14.0.0 by Jun Yuan Tan
  9. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  10. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  11. ---
  12. clang/lib/Driver/ToolChains/Linux.h | 2 ++
  13. 1 file changed, 2 insertions(+)
  14. diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h
  15. index 169a37c44072..f432d36c0d17 100644
  16. --- a/clang/lib/Driver/ToolChains/Linux.h
  17. +++ b/clang/lib/Driver/ToolChains/Linux.h
  18. @@ -61,6 +61,8 @@ public:
  19. const llvm::opt::ArgList &DriverArgs, const JobAction &JA,
  20. const llvm::fltSemantics *FPType = nullptr) const override;
  21. + unsigned GetDefaultDwarfVersion() const override { return 5; }
  22. +
  23. protected:
  24. Tool *buildAssembler() const override;
  25. Tool *buildLinker() const override;
  26. --
  27. 2.33.1