Skip to content

Conversation

@Sockke
Copy link
Contributor

@Sockke Sockke commented Sep 28, 2025

Using the DWP's cu_index/tu_index only loads the DWO units from the .debug_info.dwo section for hash, which works fine in DWARF5. However, tu_index points to .debug_types.dwo section in DWARF4, which can cause the type unit to be lost due to the incorrect loading target. (Related discussion in 811b60f)

This patch supports to get the type unit for hash from .debug_types.dwo section in DWARF4.

@llvmbot
Copy link
Member

llvmbot commented Sep 28, 2025

@llvm/pr-subscribers-bolt

@llvm/pr-subscribers-debuginfo

Author: Liu Ke (Sockke)

Changes

Using the DWP's cu_index/tu_index only loads the DWO units from the .debug_info.dwo section for hash, which works fine in DWARF5. However, tu_index points to .debug_types.dwo section in DWARF4, which can cause the type unit to be lost due to the incorrect loading target. (Related discussion in 811b60f)

This patch supports to get the type unit for hash from .debug_types.dwo section in DWARF4.


Full diff: https://github.com/llvm/llvm-project/pull/161067.diff

3 Files Affected:

  • (modified) llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h (+3-1)
  • (modified) llvm/lib/DebugInfo/DWARF/DWARFContext.cpp (+15-4)
  • (modified) llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp (+15-7)
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
index 964ff8e396660..3e8d7e8b32fc8 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
@@ -143,7 +143,9 @@ class DWARFUnitVector final : public SmallVector<std::unique_ptr<DWARFUnit>, 1>
       decltype(make_filter_range(std::declval<iterator_range>(), isCompileUnit));
 
   LLVM_ABI DWARFUnit *getUnitForOffset(uint64_t Offset) const;
-  LLVM_ABI DWARFUnit *getUnitForIndexEntry(const DWARFUnitIndex::Entry &E);
+  LLVM_ABI DWARFUnit *
+  getUnitForIndexEntry(const DWARFUnitIndex::Entry &E, DWARFSectionKind Sec,
+                       const DWARFSection *Section = nullptr);
 
   /// Read units from a .debug_info or .debug_types section.  Calls made
   /// before finishedInfoUnits() are assumed to be for .debug_info sections,
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index 73df62abaf023..c40042c2958e4 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -1344,9 +1344,20 @@ void DWARFContext::dump(
 DWARFTypeUnit *DWARFContext::getTypeUnitForHash(uint64_t Hash, bool IsDWO) {
   DWARFUnitVector &DWOUnits = State->getDWOUnits();
   if (const auto &TUI = getTUIndex()) {
-    if (const auto *R = TUI.getFromHash(Hash))
-      return dyn_cast_or_null<DWARFTypeUnit>(
-          DWOUnits.getUnitForIndexEntry(*R));
+    if (const auto *R = TUI.getFromHash(Hash)) {
+      if (TUI.getVersion() >= 5)
+        return dyn_cast_or_null<DWARFTypeUnit>(
+            DWOUnits.getUnitForIndexEntry(*R, DW_SECT_INFO));
+      else {
+        DWARFUnit *TypesUnit = nullptr;
+        getDWARFObj().forEachTypesDWOSections([&](const DWARFSection &S) {
+          if (!TypesUnit)
+            TypesUnit =
+                DWOUnits.getUnitForIndexEntry(*R, DW_SECT_EXT_TYPES, &S);
+        });
+        return dyn_cast_or_null<DWARFTypeUnit>(TypesUnit);
+      }
+    }
     return nullptr;
   }
   return State->getTypeUnitMap(IsDWO).lookup(Hash);
@@ -1358,7 +1369,7 @@ DWARFCompileUnit *DWARFContext::getDWOCompileUnitForHash(uint64_t Hash) {
   if (const auto &CUI = getCUIndex()) {
     if (const auto *R = CUI.getFromHash(Hash))
       return dyn_cast_or_null<DWARFCompileUnit>(
-          DWOUnits.getUnitForIndexEntry(*R));
+          DWOUnits.getUnitForIndexEntry(*R, DW_SECT_INFO));
     return nullptr;
   }
 
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
index ef59c82fc6a01..da0bf03e1ac57 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
@@ -161,17 +161,24 @@ DWARFUnit *DWARFUnitVector::getUnitForOffset(uint64_t Offset) const {
   return nullptr;
 }
 
-DWARFUnit *
-DWARFUnitVector::getUnitForIndexEntry(const DWARFUnitIndex::Entry &E) {
-  const auto *CUOff = E.getContribution(DW_SECT_INFO);
+DWARFUnit *DWARFUnitVector::getUnitForIndexEntry(const DWARFUnitIndex::Entry &E,
+                                                 DWARFSectionKind Sec,
+                                                 const DWARFSection *Section) {
+  const auto *CUOff = E.getContribution(Sec);
   if (!CUOff)
     return nullptr;
 
   uint64_t Offset = CUOff->getOffset();
-  auto end = begin() + getNumInfoUnits();
+  auto begin = this->begin();
+  auto end = begin + getNumInfoUnits();
+
+  if (Sec == DW_SECT_EXT_TYPES) {
+    begin = end;
+    end = this->end();
+  }
 
   auto *CU =
-      std::upper_bound(begin(), end, CUOff->getOffset(),
+      std::upper_bound(begin, end, CUOff->getOffset(),
                        [](uint64_t LHS, const std::unique_ptr<DWARFUnit> &RHS) {
                          return LHS < RHS->getNextUnitOffset();
                        });
@@ -181,13 +188,14 @@ DWARFUnitVector::getUnitForIndexEntry(const DWARFUnitIndex::Entry &E) {
   if (!Parser)
     return nullptr;
 
-  auto U = Parser(Offset, DW_SECT_INFO, nullptr, &E);
+  auto U = Parser(Offset, Sec, Section, &E);
   if (!U)
     return nullptr;
 
   auto *NewCU = U.get();
   this->insert(CU, std::move(U));
-  ++NumInfoUnits;
+  if (Sec == DW_SECT_INFO)
+    ++NumInfoUnits;
   return NewCU;
 }
 

@Sockke Sockke requested a review from dwblaikie September 28, 2025 10:15
@dwblaikie
Copy link
Collaborator

Can you add a test case?

My rudimentary testing seems to show this working correctly already - but perhaps by accident or something?

struct t1 { };
void f1(t1) {
}
clang++-tot -fdebug-types-section -c test.cpp -gdwarf-4 -gsplit-dwarf  && llvm-dwarfdump-tot test.dwo -debug-info -debug-types
test.dwo:       file format elf64-x86-64

.debug_info.dwo contents:
0x00000000: Compile Unit: length = 0x00000036, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x0000003a)

0x0000000b: DW_TAG_compile_unit
              DW_AT_producer    ("clang version 21.1.1 ([email protected]:llvm/llvm-project.git f4907049285ca0875cc91770e3ceb3f162ec7c48)")
              DW_AT_language    (DW_LANG_C_plus_plus_14)
              DW_AT_name        ("test.cpp")
              DW_AT_GNU_dwo_name        ("test.dwo")
              DW_AT_GNU_dwo_id  (0x9a627b6109b8affc)

0x00000019:   DW_TAG_subprogram
                DW_AT_low_pc    (indexed (00000000) address = <unresolved>)
                DW_AT_high_pc   (0x00000006)
                DW_AT_frame_base        (DW_OP_reg6 RBP)
                DW_AT_linkage_name      ("_Z2f12t1")
                DW_AT_name      ("f1")
                DW_AT_decl_file (0x01)
                DW_AT_decl_line (2)
                DW_AT_external  (true)

0x00000025:     DW_TAG_formal_parameter
                  DW_AT_location        (DW_OP_fbreg -1)
                  DW_AT_decl_file       (0x01)
                  DW_AT_decl_line       (2)
                  DW_AT_type    (0x00000030 "t1")

0x0000002f:     NULL

0x00000030:   DW_TAG_structure_type
                DW_AT_declaration       (true)
                DW_AT_signature (0xc6694e51369161f2)

0x00000039:   NULL

.debug_types.dwo contents:
0x00000000: Type Unit: length = 0x00000021, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08, name = 't1', type_signature = 0xc6694e51369161f2, type_offset = 0x001e (next unit at 0x00000025)

0x00000017: DW_TAG_type_unit
              DW_AT_language    (DW_LANG_C_plus_plus_14)
              DW_AT_stmt_list   (0x00000000)

0x0000001e:   DW_TAG_structure_type
                DW_AT_calling_convention        (DW_CC_pass_by_value)
                DW_AT_name      ("t1")
                DW_AT_byte_size (0x01)
                DW_AT_decl_file ("test.cpp")
                DW_AT_decl_line (1)

0x00000024:   NULL

Specifically, when dumping the CU it shows the name of the type at offset 0x30, which indicates that it's successfully looking through the DW_TAG_structure_type and using the DW_AT_signature to find the DWARFv4 type unit in .debug_types.dwo to retrieve the name...

@Sockke
Copy link
Contributor Author

Sockke commented Oct 14, 2025

Can you add a test case?

Thanks for your review, I have added a test.

My rudimentary testing seems to show this working correctly already - but perhaps by accident or something?

Using the TU index for type parsing in dwp may cause problems, like:

0x00000025:     DW_TAG_formal_parameter
                  DW_AT_location        (DW_OP_fbreg -1)
                  DW_AT_decl_file       (0x01)
                  DW_AT_decl_line       (2)
                  DW_AT_type    (0x00000030 "structure ")

After applying this patch:

0x00000025:     DW_TAG_formal_parameter
                  DW_AT_location        (DW_OP_fbreg -1)
                  DW_AT_decl_file       (0x01)
                  DW_AT_decl_line       (2)
                  DW_AT_type    (0x00000030 "t1 ")

Btw, this bug also cause llvm-bolt to lose the .debug_types.dwo information in its output when parsing a dwp file.

auto end = begin + getNumInfoUnits();

if (Sec == DW_SECT_EXT_TYPES) {
begin = end;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite follow this logic.
For DWARF4 .debug_types only has TUs.
For DWARF5 TUs can be anywhere in the .debug_info.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For DWARF4 TUs are stored after CUs in DWOUnits vector:

  /// Get units from .debug_types.dwo in the DWO context.
  unit_iterator_range dwo_types_section_units() {
    DWARFUnitVector &DWOUnits = State->getDWOUnits();
    return unit_iterator_range(DWOUnits.begin() + DWOUnits.getNumInfoUnits(),
                               DWOUnits.end());
  }

DW_SECT_EXT_TYPES indicates that DWARF4 .debug_types is being processed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get that part.
I was wondering about this:
begin = end;
I guess getNumInfoUnits() will return 0 since types are in a separate section for DWARF4. Right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it will return the number of CUs from the DWGUnits vector. For DWARF4, since TUs are stored after the CUs in the DWGUnits vector, we need to traverse the TUs starting from the end of the CUs.

@github-actions
Copy link

github-actions bot commented Oct 21, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@Sockke Sockke force-pushed the support-get-tu-for-hash-in-dwarf4 branch from f835b03 to ba88da1 Compare October 21, 2025 07:29
@Sockke Sockke force-pushed the support-get-tu-for-hash-in-dwarf4 branch from ba88da1 to 3d5ec57 Compare October 21, 2025 07:43
@ayermolo
Copy link
Contributor

Ah OK. Looks reasonable to me.

@Sockke Sockke merged commit 8ee5c40 into llvm:main Oct 28, 2025
10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 28, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-quick running on linaro-clang-aarch64-quick while building bolt,llvm at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/65/builds/24607

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'lit :: max-time.py' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 5
env -u FILECHECK_OPTS "/usr/bin/python3.10" /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/utils/lit/lit.py -j1 --order=lexical Inputs/max-time --max-time=5 2>&1  |  FileCheck /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/utils/lit/tests/max-time.py
# executed command: env -u FILECHECK_OPTS /usr/bin/python3.10 /home/tcwg-buildbot/worker/clang-aarch64-quick/llvm/llvm/utils/lit/lit.py -j1 --order=lexical Inputs/max-time --max-time=5
# executed command: FileCheck /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/utils/lit/tests/max-time.py
# .---command stderr------------
# | /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/utils/lit/tests/max-time.py:8:10: error: CHECK: expected string not found in input
# | # CHECK: Skipped: 1
# |          ^
# | <stdin>:3:51: note: scanning from here
# | warning: reached timeout, skipping remaining tests
# |                                                   ^
# | <stdin>:8:2: note: possible intended match here
# |  Skipped: 2 (100.00%)
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/tcwg-buildbot/worker/clang-aarch64-quick/stage1/utils/lit/tests/max-time.py
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            1: -- Testing: 2 tests, 1 workers -- 
# |            2: PASS: max-time :: fast.txt (1 of 2) 
# |            3: warning: reached timeout, skipping remaining tests 
# | check:8'0                                                       X error: no match found
# |            4:  
# | check:8'0     ~
# |            5: Testing Time: 5.21s 
# | check:8'0     ~~~~~~~~~~~~~~~~~~~~
# |            6:  
# | check:8'0     ~
# |            7: Total Discovered Tests: 2 
# | check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            8:  Skipped: 2 (100.00%) 
# | check:8'0     ~~~~~~~~~~~~~~~~~~~~~~
# | check:8'1      ?                     possible intended match
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 28, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-aarch64-linux-bootstrap-msan running on sanitizer-buildbot10 while building bolt,llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/94/builds/12140

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 91958 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: lld :: ELF/ppc64-split-stack-adjust-fail.s (91211 of 91958)
******************** TEST 'lld :: ELF/ppc64-split-stack-adjust-fail.s' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 3
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o
# note: command had no output on stdout or stderr
# RUN: at line 4
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/Inputs/ppc64-no-split-stack.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/Inputs/ppc64-no-split-stack.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o
# note: command had no output on stdout or stderr
# RUN: at line 6
not /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld --defsym __morestack=0x10010000 /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o -o /dev/null 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s
# executed command: not /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld --defsym __morestack=0x10010000 /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o -o /dev/null
# note: command had no output on stdout or stderr
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s
# note: command had no output on stdout or stderr
# RUN: at line 8
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o
# note: command had no output on stdout or stderr
# RUN: at line 9
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/Inputs/ppc64-no-split-stack.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/Inputs/ppc64-no-split-stack.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o
# note: command had no output on stdout or stderr
# RUN: at line 11
not /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld --defsym __morestack=0x10010000 /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o -o /dev/null 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s
# executed command: not /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld --defsym __morestack=0x10010000 /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o -o /dev/null
# note: command had no output on stdout or stderr
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s
# .---command stderr------------
# | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s:13:10: error: CHECK: expected string not found in input
# | # CHECK: error: {{.*}}.o:(.text): wrong_regs (with -fsplit-stack) calls nss_callee (without -fsplit-stack), but couldn't adjust its prologue
# |          ^
# | <stdin>:1:1: note: scanning from here
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Step 11 (stage2/msan check) failure: stage2/msan check (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:531: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 91958 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: lld :: ELF/ppc64-split-stack-adjust-fail.s (91211 of 91958)
******************** TEST 'lld :: ELF/ppc64-split-stack-adjust-fail.s' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 3
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o
# note: command had no output on stdout or stderr
# RUN: at line 4
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/Inputs/ppc64-no-split-stack.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/Inputs/ppc64-no-split-stack.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o
# note: command had no output on stdout or stderr
# RUN: at line 6
not /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld --defsym __morestack=0x10010000 /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o -o /dev/null 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s
# executed command: not /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld --defsym __morestack=0x10010000 /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o -o /dev/null
# note: command had no output on stdout or stderr
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s
# note: command had no output on stdout or stderr
# RUN: at line 8
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o
# note: command had no output on stdout or stderr
# RUN: at line 9
/home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/Inputs/ppc64-no-split-stack.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-mc -filetype=obj -triple=powerpc64-unknown-linux /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/Inputs/ppc64-no-split-stack.s -o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o
# note: command had no output on stdout or stderr
# RUN: at line 11
not /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld --defsym __morestack=0x10010000 /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o -o /dev/null 2>&1 | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s
# executed command: not /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld --defsym __morestack=0x10010000 /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp1.o /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/tools/lld/test/ELF/Output/ppc64-split-stack-adjust-fail.s.tmp2.o -o /dev/null
# note: command had no output on stdout or stderr
# executed command: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s
# .---command stderr------------
# | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/lld/test/ELF/ppc64-split-stack-adjust-fail.s:13:10: error: CHECK: expected string not found in input
# | # CHECK: error: {{.*}}.o:(.text): wrong_regs (with -fsplit-stack) calls nss_callee (without -fsplit-stack), but couldn't adjust its prologue
# |          ^
# | <stdin>:1:1: note: scanning from here
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 28, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-win-x-armv7l running on as-builder-1 while building bolt,llvm at step 15 "test-check-cxx-armv7-unknown-linux-gnueabihf".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/38/builds/6073

Here is the relevant piece of the build log for the reference
Step 15 (test-check-cxx-armv7-unknown-linux-gnueabihf) failure: Test just built components: check-cxx-armv7-unknown-linux-gnueabihf completed (failure)
******************** TEST 'llvm-libc++-static.cfg.in :: std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/bracket.pass.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# COMPILED WITH
C:/buildbot/as-builder-1/x-armv7l/build/./bin/clang++.exe C:\buildbot\as-builder-1\x-armv7l\llvm-project\libcxx\test\std\iterators\predef.iterators\reverse.iterators\reverse.iter.elem\bracket.pass.cpp -pthread --target=armv7-unknown-linux-gnueabihf -nostdinc++ -I C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/include/c++/v1 -I C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/include/armv7-unknown-linux-gnueabihf/c++/v1 -I C:/buildbot/as-builder-1/x-armv7l/llvm-project/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -flax-vector-conversions=none -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Wuser-defined-warnings  -lc++experimental -nostdlib++ -L C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/lib/armv7-unknown-linux-gnueabihf -lc++ -lc++abi -latomic -o C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\iterators\predef.iterators\reverse.iterators\reverse.iter.elem\Output\bracket.pass.cpp.dir\t.tmp.exe
# executed command: C:/buildbot/as-builder-1/x-armv7l/build/./bin/clang++.exe 'C:\buildbot\as-builder-1\x-armv7l\llvm-project\libcxx\test\std\iterators\predef.iterators\reverse.iterators\reverse.iter.elem\bracket.pass.cpp' -pthread --target=armv7-unknown-linux-gnueabihf -nostdinc++ -I C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/include/c++/v1 -I C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/include/armv7-unknown-linux-gnueabihf/c++/v1 -I C:/buildbot/as-builder-1/x-armv7l/llvm-project/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -flax-vector-conversions=none -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Wuser-defined-warnings -lc++experimental -nostdlib++ -L C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/lib/armv7-unknown-linux-gnueabihf -lc++ -lc++abi -latomic -o 'C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\iterators\predef.iterators\reverse.iterators\reverse.iter.elem\Output\bracket.pass.cpp.dir\t.tmp.exe'
# EXECUTED AS
"C:/Python313/python.exe" "C:/buildbot/as-builder-1/x-armv7l/llvm-project/libcxx/utils/ssh.py" [email protected] --execdir C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\iterators\predef.iterators\reverse.iterators\reverse.iter.elem\Output\bracket.pass.cpp.dir --  C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\iterators\predef.iterators\reverse.iterators\reverse.iter.elem\Output\bracket.pass.cpp.dir\t.tmp.exe
# executed command: C:/Python313/python.exe C:/buildbot/as-builder-1/x-armv7l/llvm-project/libcxx/utils/ssh.py [email protected] --execdir 'C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\iterators\predef.iterators\reverse.iterators\reverse.iter.elem\Output\bracket.pass.cpp.dir' -- 'C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\iterators\predef.iterators\reverse.iterators\reverse.iter.elem\Output\bracket.pass.cpp.dir\t.tmp.exe'
# .---command stderr------------
# | scp: Connection closed
# | Traceback (most recent call last):
# |   File "C:\buildbot\as-builder-1\x-armv7l\llvm-project\libcxx\utils\ssh.py", line 145, in <module>
# |     exit(main())
# |          ~~~~^^
# |   File "C:\buildbot\as-builder-1\x-armv7l\llvm-project\libcxx\utils\ssh.py", line 97, in main
# |     runCommand(scp(tmpTar.name, remoteTarball), check=True, stdin=subprocess.DEVNULL)
# |     ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# |   File "C:\buildbot\as-builder-1\x-armv7l\llvm-project\libcxx\utils\ssh.py", line 57, in runCommand
# |     return subprocess.run(command, *args_, **kwargs)
# |            ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
# |   File "c:\python313\Lib\subprocess.py", line 577, in run
# |     raise CalledProcessError(retcode, process.args,
# |                              output=stdout, stderr=stderr)
# | subprocess.CalledProcessError: Command '['scp', '-q', '-oBatchMode=yes', 'C:\\buildbot\\as-builder-1\\x-armv7l\\build\\lit-tmp-_rgsg3dv\\tmpfndyizrt.tar', '[email protected]:/tmp/libcxx.XVF1hsGx7v/tmpfndyizrt.tar']' returned non-zero exit status 255.
# `-----------------------------
# error: command failed with exit status: 1

--

********************


rupprecht added a commit that referenced this pull request Oct 28, 2025
The test added in #161067 writes artifacts to the current dir, i.e.
`test.o` / `test.dwo` / `test.dwp`, which might not be writeable. Tests
should use `%t` for test artifact location, i.e. `%t.o` / `%t.dwo` /
`%t.dwp` However, since `"test.dwo"` is part of the assembly source file
used as a test input, and that's not something lit will substitute, that
typical approach doesn't work. We can instead ensure the output is in a
good location by running `cd %t` (after setting it up).
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
…in DWARF4. (llvm#161067)

Using the DWP's cu_index/tu_index only loads the DWO units from the
.debug_info.dwo section for hash, which works fine in DWARF5. However,
tu_index points to .debug_types.dwo section in DWARF4, which can cause
the type unit to be lost due to the incorrect loading target. (Related
discussion in
[811b60f](llvm@811b60f))

This patch supports to get the type unit for hash from .debug_types.dwo
section in DWARF4.
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
The test added in llvm#161067 writes artifacts to the current dir, i.e.
`test.o` / `test.dwo` / `test.dwp`, which might not be writeable. Tests
should use `%t` for test artifact location, i.e. `%t.o` / `%t.dwo` /
`%t.dwp` However, since `"test.dwo"` is part of the assembly source file
used as a test input, and that's not something lit will substitute, that
typical approach doesn't work. We can instead ensure the output is in a
good location by running `cd %t` (after setting it up).
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
…in DWARF4. (llvm#161067)

Using the DWP's cu_index/tu_index only loads the DWO units from the
.debug_info.dwo section for hash, which works fine in DWARF5. However,
tu_index points to .debug_types.dwo section in DWARF4, which can cause
the type unit to be lost due to the incorrect loading target. (Related
discussion in
[811b60f](llvm@811b60f))

This patch supports to get the type unit for hash from .debug_types.dwo
section in DWARF4.
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
The test added in llvm#161067 writes artifacts to the current dir, i.e.
`test.o` / `test.dwo` / `test.dwp`, which might not be writeable. Tests
should use `%t` for test artifact location, i.e. `%t.o` / `%t.dwo` /
`%t.dwp` However, since `"test.dwo"` is part of the assembly source file
used as a test input, and that's not something lit will substitute, that
typical approach doesn't work. We can instead ensure the output is in a
good location by running `cd %t` (after setting it up).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants