This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Error out on archives without and index
ClosedPublic

Authored by sbc100 on Jun 24 2019, 2:35 PM.

Details

Summary

This is fairly common with wasm since GNU ar (most likely the system
ar) doesn't support the wasm object format so user who don't override
AR will end up with archives without an index. We don't want to
silently ignore this issue.

An alternative would be to behave like the ELF version lld and read the
symbols from each object file in the archive if they are all of the
same type. However, error'ing out seem like a conservative appoach for
now.

Fixes: PR42376

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.Jun 24 2019, 2:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2019, 2:35 PM
sbc100 added a reviewer: ruiu.Jun 24 2019, 2:35 PM
ruiu accepted this revision.Jun 25 2019, 12:28 AM

LGTM

This patch looks good by itself, but I believe that lld/wasm should handle each archive member as a lazy object file if there's no symbol table in an archive, just like lld/ELF does.

This revision is now accepted and ready to land.Jun 25 2019, 12:28 AM
This revision was automatically updated to reflect the committed changes.