Skip to content

clang-cl 18 generates DWARF debug info section with -Z7 when compiling a .s file. #92229

Open
@glandium

Description

@glandium

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 f58330c.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions