Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Improve handling of archives without symbol tables #41346

Open Quuxplusone opened 5 years ago

Quuxplusone commented 5 years ago
Bugzilla Link PR42376
Status NEW
Importance P enhancement
Reported by Sam Clegg (sbc@chromium.org)
Reported on 2019-06-24 14:00:15 -0700
Last modified on 2019-06-25 10:36:57 -0700
Version unspecified
Hardware PC Linux
CC llvm-bugs@lists.llvm.org, ruiu@google.com, sbc@chromium.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

With wasm its (as with LTO) its fairly common that the system ar tool fail to add a symbol table.

Currently we ignore such archives. We should try to do better in some way.

The ELF backend with process individual archive entries if the are all LTO objects.

GNU ld will bail out with "error adding symbols: Archive has no index; run ranlib to add one".

Quuxplusone commented 5 years ago

I wonder if there's any ar tool that can understand .wasm files and extract public symbol names from them. At least I don't think any existing ar can do that. Doesn't that mean almost all .a files containing .wasm files have no symbol table, no?

Quuxplusone commented 5 years ago

llvm-ar can do this. An normally we expect out users to use the same llvm-ar as the version of clang and lld they are using (at least in emscripten).

In the case that they don't do this I think its reasonable to report a warning or at least an error.