Skip to content

Commit 329ae91

Browse files
authored
Update DWARF tests to Ubuntu 24.04 (#11077)
The gdb version in Ubuntu 24.04 fails on our synthetic DWARF because: 1. the synthetic DWARF unit has no DW_AT_language 2. synthetic types are referenced from a unit that does have DW_AT_language 3. this triggers https://sourceware.org/bugzilla/show_bug.cgi?id=32431 Workaround this issue by specifying DW_LANG_C11. This may not be exactly the right meaning, but it should be safe.
1 parent 57dab9d commit 329ae91

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ jobs:
835835
needs: determine
836836
if: needs.determine.outputs.run-dwarf
837837
name: Test DWARF debugging
838-
runs-on: ubuntu-22.04 # FIXME: fails on `ubuntu-24.04` right now
838+
runs-on: ubuntu-24.04
839839
steps:
840840
- uses: actions/checkout@v4
841841
with:
@@ -848,14 +848,14 @@ jobs:
848848
tar -xzf wasi-sdk-25.0-x86_64-linux.tar.gz
849849
mv wasi-sdk-25.0-x86_64-linux wasi-sdk
850850
- run: |
851-
sudo apt-get update && sudo apt-get install -y gdb lldb-15 llvm
851+
sudo apt-get update && sudo apt-get install -y gdb lldb-18 llvm
852852
# workaround for https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1972855
853853
sudo mkdir -p /usr/lib/local/lib/python3.10/dist-packages/lldb
854854
sudo ln -s /usr/lib/llvm-15/lib/python3.10/dist-packages/lldb/* /usr/lib/python3/dist-packages/lldb/
855855
# Only testing release since it is more likely to expose issues with our low-level symbol handling.
856856
cargo test --release --test all -- --ignored --test-threads 1 debug::
857857
env:
858-
LLDB: lldb-15 # override default version, 14
858+
LLDB: lldb-18
859859
WASI_SDK_PATH: /tmp/wasi-sdk
860860
861861
build-preview1-component-adapter:

crates/cranelift/src/debug/transform/simulate.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ pub fn generate_simulated_dwarf(
337337

338338
let id = out_strings.add(PRODUCER_NAME);
339339
root.set(gimli::DW_AT_producer, write::AttributeValue::StringRef(id));
340+
root.set(
341+
gimli::DW_AT_language,
342+
write::AttributeValue::Language(gimli::DW_LANG_C11),
343+
);
340344
root.set(gimli::DW_AT_name, write::AttributeValue::StringRef(name_id));
341345
root.set(
342346
gimli::DW_AT_stmt_list,

crates/cranelift/src/debug/transform/synthetic.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ impl ModuleSyntheticUnit {
6969
gimli::DW_AT_name,
7070
AttributeValue::StringRef(out_strings.add("WasmtimeModuleSyntheticUnit")),
7171
);
72+
unit_die.set(
73+
gimli::DW_AT_producer,
74+
AttributeValue::StringRef(out_strings.add("wasmtime")),
75+
);
76+
unit_die.set(
77+
gimli::DW_AT_language,
78+
AttributeValue::Language(gimli::DW_LANG_C11),
79+
);
7280
unit_id
7381
}
7482

0 commit comments

Comments
 (0)