[PATCH] D30544: [lld] - Ignore non-elf files in archives with --whole-archive

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 06:25:52 PST 2017


I agree that we should keep producing errors upstream. A patch producing
a better error message would be a good thing.

Cheers,
Rafael

Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:

> ruiu added a comment.
>
> I'd think we should continue handling it as an error. There are a few reasons:
>
> 1. The GNU linkers don't allow that (thank you George for investigating!). That means almost all Unix projects don't add non-object files to .a files, so in practice the current behavior is desirable for most people.
> 2. Assume that foo.a contains x.o, y.o and z.o. The current semantics of `--whole-archive foo.a --no-whole-archive` is the same as `x.o y.o z.o`, which is a pretty simple rule. This patch changes that semantics. I think that's not a good thing to do.
> 3. It is easy to relax this error check, but tightening it later is hard. I don't want to relax this unless a strong reason to do is presented.
>
>
> https://reviews.llvm.org/D30544


More information about the llvm-commits mailing list