<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/92229>92229</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-cl 18 generates DWARF debug info section with -Z7 when compiling a .s file.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
glandium
</td>
</tr>
</table>
<pre>
STR:
- Create `foo.s` with the following content:
```
.global foo
.section .rodata
.balign 16
foo:
```
- Compile with `clang-cl -o foo.obj -Z7 -c foo.s`.
- `llvm-readobj --sections foo.obj` will show a `.debug_line` section:
```
Section {
Number: 5
Name: .debug_line (2F 34 00 00 00 00 00 00)
VirtualSize: 0x0
VirtualAddress: 0x0
RawDataSize: 39
PointerToRawData: 0xDC
PointerToRelocations: 0x0
PointerToLineNumbers: 0x0
RelocationCount: 0
LineNumberCount: 0
Characteristics [ (0x42100040)
IMAGE_SCN_ALIGN_1BYTES (0x100000)
IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
IMAGE_SCN_MEM_DISCARDABLE (0x2000000)
IMAGE_SCN_MEM_READ (0x40000000)
]
}
```
Such a section wasn't created with clang-cl 17.
This is a regression from f58330cbe44598eb2de0cca3b812f67fea0a71ca.
It is worth noting that the compilation command line emitted the following warning before that change:
```
clang-cl: warning: argument unused during compilation: '-Z7' [-Wunused-command-line-argument]
```
which doesn't happen anymore. However, when renaming `foo.s` to `foo.S`, the warning is not shown anymore (and the behavior is the same as with `foo.s`: no `.debug_line` section before, and one now)
Cc: @bogner
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VV1vozgU_TXOyxXIcSAkD3mgoZmN1KlWTbSjnZfImAt4BHZlm2Fmf_3KfCRpO5WigO1zzv3wvRdurawU4o7EDyTOFrxztTa7quGqkF27yHXxe3c6v5BVSmhGaBrA3iB3CGRNS61DS9YUeulqcDVCqZtG91JVILR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