[PATCH] D117284: [ELF] Allow non-bitcode archive with an empty index

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 14 01:51:07 PST 2022


peter.smith added a comment.

I can see that something like this could be valuable for a program using archives for major subsystems, although less well for a set of loosely connected utility routines (C-library). Doing this transparently makes me a little bit nervous for the reasons you suggest in the description.

A couple of alternative suggestions:

Could introduce something like --start-lib --end-lib to treat archives in this way (regardless of whether they have an index or not. Something like --start-as-lazy archive1.a archive2.a --end-as-lazy. That would permit people to get the potential speed boost while being under control, their archives (with indexes) will still work on linkers that don't support the option.

Another option would be to enable the behaviour change via the command-line. At least people would then know that they would be doing something speciall 
`--archive-no-index-as-lazy=<archive type>` where <archive type> is one of:

- none. All archives without an index get an error message.
- bitcode. All bitcode archives without an index are treated as a lazy archive. This is the default.
- all. All archives without an index are treated as a lazy archive.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117284/new/

https://reviews.llvm.org/D117284



More information about the llvm-commits mailing list