Blame SOURCES/0010-PATCH-clang-Produce-DWARF4-by-default.patch

5b82a2
From 1f68d73910ddee1beaf3582480b8a9738c941a43 Mon Sep 17 00:00:00 2001
d4a856
From: Konrad Kleine <kkleine@redhat.com>
d4a856
Date: Thu, 24 Mar 2022 09:44:21 +0100
5b82a2
Subject: [PATCH] Produce DWARF4 by default
d4a856
d4a856
Have a look at the following commit to see when the move from DWARF 4 to 5 first happened upstream:
d4a856
d4a856
https://github.com/llvm/llvm-project/commit/d3b26dea16108c427b19b5480c9edc76edf8f5b4?diff=unified
d4a856
---
d4a856
 clang/include/clang/Driver/ToolChain.h | 2 +-
d4a856
 clang/test/CodeGen/dwarf-version.c     | 4 ++--
d4a856
 clang/test/Driver/cl-options.c         | 2 +-
5b82a2
 clang/test/Driver/clang-g-opts.c       | 2 +-
d4a856
 clang/test/Driver/ve-toolchain.c       | 2 +-
d4a856
 clang/test/Driver/ve-toolchain.cpp     | 2 +-
5b82a2
 6 files changed, 7 insertions(+), 7 deletions(-)
d4a856
d4a856
diff --git a/clang/include/clang/Driver/ToolChain.h b/clang/include/clang/Driver/ToolChain.h
5b82a2
index f20ab164531b..53c86ee82936 100644
d4a856
--- a/clang/include/clang/Driver/ToolChain.h
d4a856
+++ b/clang/include/clang/Driver/ToolChain.h
5b82a2
@@ -535,7 +535,7 @@ public:
5b82a2
   
d4a856
   // Return the DWARF version to emit, in the absence of arguments
d4a856
   // to the contrary.
d4a856
-  virtual unsigned GetDefaultDwarfVersion() const { return 5; }
d4a856
+  virtual unsigned GetDefaultDwarfVersion() const { return 4; }
d4a856
 
d4a856
   // Some toolchains may have different restrictions on the DWARF version and
d4a856
   // may need to adjust it. E.g. NVPTX may need to enforce DWARF2 even when host
d4a856
diff --git a/clang/test/CodeGen/dwarf-version.c b/clang/test/CodeGen/dwarf-version.c
d4a856
index 0a6fa4768026..96f01749d0d8 100644
d4a856
--- a/clang/test/CodeGen/dwarf-version.c
d4a856
+++ b/clang/test/CodeGen/dwarf-version.c
d4a856
@@ -2,8 +2,8 @@
d4a856
 // RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3
d4a856
 // RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
d4a856
 // RUN: %clang -target x86_64-linux-gnu -gdwarf-5 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
d4a856
-// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
d4a856
-// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
d4a856
+// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
d4a856
+// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
d4a856
 
d4a856
 // The -isysroot is used as a hack to avoid LIT messing with the SDKROOT
d4a856
 // environment variable which indirecty overrides the version in the target
d4a856
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
5b82a2
index a2e350a0a835..01889ba0bf9b 100644
d4a856
--- a/clang/test/Driver/cl-options.c
d4a856
+++ b/clang/test/Driver/cl-options.c
5b82a2
@@ -570,7 +570,7 @@
d4a856
 // RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s
d4a856
 // Z7_gdwarf: "-gcodeview"
d4a856
 // Z7_gdwarf: "-debug-info-kind=constructor"
d4a856
-// Z7_gdwarf: "-dwarf-version=
d4a856
+// Z7_gdwarf: "-dwarf-version=4
d4a856
 
d4a856
 // RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s
d4a856
 // CXX11: -std=c++11
5b82a2
diff --git a/clang/test/Driver/clang-g-opts.c b/clang/test/Driver/clang-g-opts.c
5b82a2
index d982b1070cae..bb129e75769c 100644
5b82a2
--- a/clang/test/Driver/clang-g-opts.c
5b82a2
+++ b/clang/test/Driver/clang-g-opts.c
5b82a2
@@ -32,7 +32,7 @@
5b82a2
 
5b82a2
 // CHECK-WITHOUT-G-NOT: -debug-info-kind
5b82a2
 // CHECK-WITH-G: "-debug-info-kind=constructor"
5b82a2
-// CHECK-WITH-G: "-dwarf-version=5"
5b82a2
+// CHECK-WITH-G: "-dwarf-version=4"
5b82a2
 // CHECK-WITH-G-DWARF2: "-dwarf-version=2"
5b82a2
 
5b82a2
 // CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone"
d4a856
diff --git a/clang/test/Driver/ve-toolchain.c b/clang/test/Driver/ve-toolchain.c
5b82a2
index 32e25769b6da..b8a2852daba8 100644
d4a856
--- a/clang/test/Driver/ve-toolchain.c
d4a856
+++ b/clang/test/Driver/ve-toolchain.c
d4a856
@@ -6,7 +6,7 @@
d4a856
 /// Checking dwarf-version
d4a856
 
5b82a2
 // RUN: %clang -### -g --target=ve %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
d4a856
-// DWARF_VER: "-dwarf-version=5"
d4a856
+// DWARF_VER: "-dwarf-version=4"
d4a856
 
d4a856
 ///-----------------------------------------------------------------------------
d4a856
 /// Checking include-path
d4a856
diff --git a/clang/test/Driver/ve-toolchain.cpp b/clang/test/Driver/ve-toolchain.cpp
5b82a2
index 5a33d5eceb61..cedf895b36dc 100644
d4a856
--- a/clang/test/Driver/ve-toolchain.cpp
d4a856
+++ b/clang/test/Driver/ve-toolchain.cpp
d4a856
@@ -7,7 +7,7 @@
d4a856
 
5b82a2
 // RUN: %clangxx -### -g --target=ve-unknown-linux-gnu \
d4a856
 // RUN:     %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
d4a856
-// DWARF_VER: "-dwarf-version=5"
d4a856
+// DWARF_VER: "-dwarf-version=4"
d4a856
 
d4a856
 ///-----------------------------------------------------------------------------
d4a856
 /// Checking include-path
d4a856
-- 
5b82a2
2.37.1
d4a856