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