Open Quuxplusone opened 5 years ago
W.r.t. the naming of the outputs:
We already have one mechanism for creating index files and native object files with unique paths: -thinlto-prefix-replace: can be used to replace the start of the path where these would be created. For example, without the flag, obj/foo.obj would get index file obj/foo.obj.thinlto.bc. With -thinlto-prefix-replace:obj;lto.d8, this would become lto.d8/foo.obj.thinlto.bc, instead.
The existing mechanism works to get unique names, and I would say we can get -thinlto-inxdex-only to work with thin archives without implementing a new naming scheme. Then, if we still want the new naming scheme, we can do that after.
Attached test.sh
(3188 bytes, text/plain): test script that uses distributed ThinLTO with static archives
I attached a small script that exercises the functionality we are looking for. It generates two executables that both use a static library, but require different functions from the library (so if they were to use the same paths for writing the indices, they would be wrong). The script is annotated with "BUG" in places where there is work to be done. In particular:
(1) Not needing to copy files that are included in the thin archive.
(2) Needing a way to write build files that accounts for not all members in a static archive being used in every link.
test.sh
(3188 bytes, text/plain)