Import libraries as created by llvm-dlltool always use the same archive
member name for every object file (namely, the DLL library name). Ensure
that long names are not repeatedly stored in the string table.
Details
Diff Detail
Event Timeline
I'm not intimately familiar with the structure of ar files, but the change looks like it makes sense to me at least. Does MSVC link.exe produce import libraries with deduplicated member names as well?
I think the change is possible to apply as such, but it'd be better if the diff was made with more context included (diff -U9999).
Yes it does deduplicate and use /0 for every archive member File ID.
Additional differences with MSVC which does not appear to have a noticable functional impact:
- LLVM produces string table entries terminated with /\n while MSVC uses \0. The PE Format documentation says: "The strings are null-terminated. Each string begins immediately after the null byte in the previous string."
- MSVC creates an additional Second Linker Member which is omitted by LLVM.
To view the contents you could look at a hexdump or use Wireshark with https://git.lekensteyn.nl/peter/wireshark-notes/tree/lua/file-ar.lua
wireshark -Xlua_script:path/to/file-ar.lua -r your.lib
I think the change is possible to apply as such, but it'd be better if the diff was made with more context included (diff -U9999).
I've used git diff -W to include function context, but if that's not sufficient I'll include the full diff next time :)
nit: if previous if is enclosed with {}, so should be else.