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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 3 15:58:49 PST 2017


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