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

1234567891011121314151617181920212223242526272829303132333435
  1. From 4cb0d0c154acebb80112a811ed9850d27c4963a9 Mon Sep 17 00:00:00 2001
  2. From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  3. Date: Fri, 22 Oct 2021 12:03:20 +0800
  4. Subject: [PATCH] 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. Upstream-Status: Pending
  9. Rebased to LLVM 14.0.0 by Jun Yuan Tan
  10. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  11. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  12. ---
  13. clang/lib/Driver/ToolChains/Linux.h | 2 ++
  14. 1 file changed, 2 insertions(+)
  15. diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h
  16. index 169a37c44072..f432d36c0d17 100644
  17. --- a/clang/lib/Driver/ToolChains/Linux.h
  18. +++ b/clang/lib/Driver/ToolChains/Linux.h
  19. @@ -61,6 +61,8 @@ public:
  20. const llvm::opt::ArgList &DriverArgs, const JobAction &JA,
  21. const llvm::fltSemantics *FPType = nullptr) const override;
  22. + unsigned GetDefaultDwarfVersion() const override { return 5; }
  23. +
  24. protected:
  25. Tool *buildAssembler() const override;
  26. Tool *buildLinker() const override;
  27. --
  28. 2.33.0