[Lldb-commits] [lldb] [lldb] Disable shell tests affected by ld_new bug (PR #84246)

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 7 12:24:03 PST 2024


https://github.com/kastiglione updated https://github.com/llvm/llvm-project/pull/84246

>From 1fb13a2d034dbea1d1ba2ef87354199a815f3788 Mon Sep 17 00:00:00 2001
From: Dave Lee <davelee.com at gmail.com>
Date: Wed, 6 Mar 2024 14:23:05 -0800
Subject: [PATCH 1/3] [lldb] Disable shell tests affected by ld64 bug

---
 lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test    |  2 +-
 .../Shell/Unwind/thread-step-out-ret-addr-check.test |  2 +-
 lldb/test/Shell/lit.cfg.py                           | 12 ++++++++++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test b/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test
index 3df9906394f432..783bfd45c4669a 100644
--- a/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test
+++ b/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test
@@ -1,7 +1,7 @@
 # Test handing of dwarf expressions specifying the location of registers, if
 # those expressions refer to the frame's CFA value.
 
-# UNSUPPORTED: system-windows
+# UNSUPPORTED: system-windows, ld64-tls-bug
 # REQUIRES: target-x86_64, native
 
 # RUN: %clang_host %p/Inputs/call-asm.c %p/Inputs/eh-frame-dwarf-unwind.s -o %t
diff --git a/lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test b/lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test
index 682b0e5332b1c5..a2b5ae8a9e3e5f 100644
--- a/lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test
+++ b/lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test
@@ -2,7 +2,7 @@
 # points to non-executable memory.
 
 # REQUIRES: target-x86_64
-# UNSUPPORTED: system-windows
+# UNSUPPORTED: system-windows, ld64-tls-bug
 
 # RUN: %clang_host %p/Inputs/call-asm.c -x assembler-with-cpp %p/Inputs/thread-step-out-ret-addr-check.s -o %t
 # RUN: not %lldb %t -s %s -b 2>&1 | FileCheck %s
diff --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py
index d75c1f532e147f..6d41dc7d8d7325 100644
--- a/lldb/test/Shell/lit.cfg.py
+++ b/lldb/test/Shell/lit.cfg.py
@@ -1,5 +1,6 @@
 # -*- Python -*-
 
+import json
 import os
 import platform
 import re
@@ -179,3 +180,14 @@ def calculate_arch_features(arch_string):
 
 if "LD_PRELOAD" in os.environ:
     config.available_features.add("ld_preload-present")
+
+# Determine if a specific version of Xcode's linker contains a TLS bug. We want
+# to skip TLS tests if they contain this bug.
+try:
+    raw_version_details = subprocess.check_output(("xcrun", "ld", "-version_details"))
+    version_details = json.loads(raw_version_details)
+    version = version_details.get("version", "0")
+    if 1000 <= float(version) <= 1109:
+        config.available_features.add("ld64-tls-bug")
+except:
+    pass

>From 92f29840ba8df95b0fb8fa7fd2bf9a679e749849 Mon Sep 17 00:00:00 2001
From: Dave Lee <davelee.com at gmail.com>
Date: Thu, 7 Mar 2024 10:10:22 -0800
Subject: [PATCH 2/3] The bug is not TLS specific

---
 lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test          | 2 +-
 lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test | 2 +-
 lldb/test/Shell/lit.cfg.py                                 | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test b/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test
index 783bfd45c4669a..7b5d6650fe2f75 100644
--- a/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test
+++ b/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test
@@ -1,7 +1,7 @@
 # Test handing of dwarf expressions specifying the location of registers, if
 # those expressions refer to the frame's CFA value.
 
-# UNSUPPORTED: system-windows, ld64-tls-bug
+# UNSUPPORTED: system-windows, ld_new-bug
 # REQUIRES: target-x86_64, native
 
 # RUN: %clang_host %p/Inputs/call-asm.c %p/Inputs/eh-frame-dwarf-unwind.s -o %t
diff --git a/lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test b/lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test
index a2b5ae8a9e3e5f..9bc7c78f79b26b 100644
--- a/lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test
+++ b/lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test
@@ -2,7 +2,7 @@
 # points to non-executable memory.
 
 # REQUIRES: target-x86_64
-# UNSUPPORTED: system-windows, ld64-tls-bug
+# UNSUPPORTED: system-windows, ld_new-bug
 
 # RUN: %clang_host %p/Inputs/call-asm.c -x assembler-with-cpp %p/Inputs/thread-step-out-ret-addr-check.s -o %t
 # RUN: not %lldb %t -s %s -b 2>&1 | FileCheck %s
diff --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py
index 6d41dc7d8d7325..1362dfcf7c4354 100644
--- a/lldb/test/Shell/lit.cfg.py
+++ b/lldb/test/Shell/lit.cfg.py
@@ -181,13 +181,13 @@ def calculate_arch_features(arch_string):
 if "LD_PRELOAD" in os.environ:
     config.available_features.add("ld_preload-present")
 
-# Determine if a specific version of Xcode's linker contains a TLS bug. We want
-# to skip TLS tests if they contain this bug.
+# Determine if a specific version of Xcode's linker contains a bug. We want to
+# skip affected tests if they contain this bug.
 try:
     raw_version_details = subprocess.check_output(("xcrun", "ld", "-version_details"))
     version_details = json.loads(raw_version_details)
     version = version_details.get("version", "0")
     if 1000 <= float(version) <= 1109:
-        config.available_features.add("ld64-tls-bug")
+        config.available_features.add("ld_new-bug")
 except:
     pass

>From 1a3ef3e014e035aecc5ba2790205cfa0d5489e0b Mon Sep 17 00:00:00 2001
From: Dave Lee <davelee.com at gmail.com>
Date: Thu, 7 Mar 2024 12:18:38 -0800
Subject: [PATCH 3/3] Check darwin; Use tuple for version

---
 lldb/test/Shell/lit.cfg.py | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py
index 1362dfcf7c4354..31afe5151c0661 100644
--- a/lldb/test/Shell/lit.cfg.py
+++ b/lldb/test/Shell/lit.cfg.py
@@ -183,11 +183,15 @@ def calculate_arch_features(arch_string):
 
 # Determine if a specific version of Xcode's linker contains a bug. We want to
 # skip affected tests if they contain this bug.
-try:
-    raw_version_details = subprocess.check_output(("xcrun", "ld", "-version_details"))
-    version_details = json.loads(raw_version_details)
-    version = version_details.get("version", "0")
-    if 1000 <= float(version) <= 1109:
-        config.available_features.add("ld_new-bug")
-except:
-    pass
+if platform.system() == "Darwin":
+    try:
+        raw_version_details = subprocess.check_output(
+            ("xcrun", "ld", "-version_details")
+        )
+        version_details = json.loads(raw_version_details)
+        version = version_details.get("version", "0")
+        version_tuple = tuple(int(x) for x in version.split("."))
+        if (1000,) <= version_tuple <= (1109,):
+            config.available_features.add("ld_new-bug")
+    except:
+        pass



More information about the lldb-commits mailing list