Skip to content

lld warning DWARF unit at offset 0x00000000 has unsupported version 0 #145851

Open
@zmodem

Description

@zmodem

This warning accompanies undefined symbol errors when certain flags are passed: (at 54953b9)

$ cat /tmp/a.c
void f();  // Intentionally left undefined.
int main() { f(); }

$ build/bin/clang -fuse-ld=lld -g2 -Wa,--crel,--allow-experimental-crel -Wl,--gdb-index /tmp/a.c
ld.lld: warning: /tmp/a-0657c0.o: DWARF unit at offset 0x00000000 has unsupported version 0, supported are 2-5
ld.lld: error: undefined symbol: f
>>> referenced by a.c
>>>               /tmp/a-0657c0.o:(main)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The real error is of course the undefined symbol. The message about unsupported DWARF unit version is confusing to users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions