Skip to content

fix(roctracer): suppress debug info in HIP test targets for dwz compat - #14818

Open
david-salinas wants to merge 2 commits into
developfrom
users/dsalinas/fix-roctracer-dwz-dwarf5
Open

david-salinas wants to merge 2 commits into
developfrom
users/dsalinas/fix-roctracer-dwz-dwarf5

Conversation

@david-salinas

@david-salinas david-salinas commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The migration from hip_add_executable() to enable_language(HIP) in #5708 caused HIP test targets to inherit build-type debug flags (-g). hipcc never passed -g, so these binaries previously had no debug info and dwz skipped them. With DWARF 5 debug sections now present, dwz fails with "Unknown debugging section .debug_str_offsets", breaking DEB packaging in ASAN nightly builds (TheRock #9676).

Restore the old behaviour by appending -g0 to CMAKE_HIP_FLAGS in the test directory. These test binaries do not need debug info.

Motivation

The migration from hip_add_executable() to enable_language(HIP) in #5708 changed how CMake applies compile flags to HIP test targets. With enable_language(HIP), CMake treats HIP as a first-class language and propagates build-type debug flags (e.g. -g in ASAN builds). hipcc never passed -g to these test binaries, so they
previously had no debug info and dwz skipped them with .debug_info section not present. Now that DWARF 5 debug sections are present, dwz fails with Unknown debugging section .debug_str_offsets, breaking DEB packaging in ASAN nightly builds.

Technical Details

Append -g0 to CMAKE_HIP_FLAGS in projects/roctracer/test/CMakeLists.txt, immediately after enable_language(HIP). This restores the pre-#5708 behaviour: clang's last-flag-wins means -g0 overrides any build-type -g, the binaries carry no debug sections, and dwz exits 0.

Only the test directory is affected — the roctracer library itself is not built with HIP and is unchanged.

Affected binaries: MatrixTranspose, MatrixTranspose_ctest, MatrixTranspose_hipaact_test, MatrixTranspose_mgpu, MatrixTranspose_test, activity_and_callback, multi_pool_activities, roctx_test.

Fixes ROCm/TheRock#9676.

Issue Tracking

GitHub issue: ROCm/TheRock#9676

Test Plan

Reproduced the failure locally with dwz 0.14 and amdclang++:

  • amdclang++ -g -o test test.cpp → readelf -S shows .debug_str_offsets, DWARF version 5 → dwz test exits 1 with Unknown debugging section .debug_str_offsets
  • amdclang++ -g -g0 -o test test.cpp → readelf -S shows no debug sections → dwz test exits 0 with .debug_info section not present (matches pre-regression behaviour)

Test Result

  • dwz exit code 0 with the fix, exit code 1 without — confirmed locally
  • No functional change to test binaries (they are runtime tests, not debug targets)

Submission Checklist

…tibility

The migration from hip_add_executable() to enable_language(HIP) in
#5708 caused HIP test targets to inherit build-type debug flags (-g).
hipcc never passed -g, so these binaries previously had no debug info
and dwz skipped them. With DWARF 5 debug sections now present, dwz
fails with "Unknown debugging section .debug_str_offsets", breaking
DEB packaging in ASAN nightly builds (TheRock #9676).

Restore the old behaviour by appending -g0 to CMAKE_HIP_FLAGS in the
test directory. These test binaries do not need debug info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@therock-pr-bot

therock-pr-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

Comment thread projects/roctracer/test/CMakeLists.txt Resolved
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nunnikri

nunnikri commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Isnt it already covered with ROCm/TheRock#9681.

@david-salinas

Copy link
Copy Markdown
Contributor Author

look like this PR already fixed this issue: ROCm/TheRock#9681

This branch has not been deployed

No deployments
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.

[Issue] Linux ASAN nightly: DEB packaging fails — dwz cannot parse DWARF 5 .debug_str_offsets in roctracer test binaries

3 participants