Issue |
138438
|
Summary |
[Hexagon] Small data constants cause duplicate symbols
|
Labels |
backend:Hexagon,
mc
|
Assignees |
|
Reporter |
alexrp
|
When building the Zig test suite for Hexagon, we see lots of errors like this:
```
error: ld.lld: duplicate symbol: .CONST_0000000000000100
note: defined at test
note: /home/alexrp/Source/ziglang/zig/.zig-cache/o/8c04f039e5f8745b4f33232b0a957843/test.o:(.gnu.linkonce.l8.CONST_0000000000000100+0x0)
note: defined at compiler_rt
note: /home/alexrp/.cache/zig/o/9c7be22a9275891985506bbdb2ae4ceb/libcompiler_rt.a.o:(.gnu.linkonce.l8.CONST_0000000000000100+0x0) in archive /home/alexrp/.cache/zig/o/9c7be22a9275891985506bbdb2ae4ceb/libcompiler_rt.a
error: ld.lld: duplicate symbol: .CONST_3FF0000000000000
note: defined at test
note: /home/alexrp/Source/ziglang/zig/.zig-cache/o/8c04f039e5f8745b4f33232b0a957843/test.o:(.gnu.linkonce.l8.CONST_3FF0000000000000+0x0)
note: defined at compiler_rt
note: /home/alexrp/.cache/zig/o/9c7be22a9275891985506bbdb2ae4ceb/libcompiler_rt.a.o:(.gnu.linkonce.l8.CONST_3FF0000000000000+0x0) in archive /home/alexrp/.cache/zig/o/9c7be22a9275891985506bbdb2ae4ceb/libcompiler_rt.a
```
I find the `MCSA_Global` in these places pretty suspicious:
https://github.com/llvm/llvm-project/blob/55fa7e1ef4851c3c773ea9c11a0ae01798d028c3/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp#L1567
https://github.com/llvm/llvm-project/blob/55fa7e1ef4851c3c773ea9c11a0ae01798d028c3/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp#L208
Shouldn't these be `MCSA_Local`?
We've worked around this in Zig for now by always disabling the `small-data` feature.
cc @androm3da
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs