[llvm-bugs] [Bug 42717] New: Make -thinlto-index-only work well with thin static archives
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Jul 22 15:10:30 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=42717
Bug ID: 42717
Summary: Make -thinlto-index-only work well with thin static
archives
Product: lld
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: akhuang at google.com
Reporter: rnk at google.com
CC: llvm-bugs at lists.llvm.org, llvm at inglorion.net,
peter.smith at linaro.org
Many build systems (such as LLVM's) are organized as collections of static
archives. Currently, the recommended way to use -thinlto-index-only to
distribute LTO backend actions is to use --start-lib / --end-lib on the command
line:
http://lists.llvm.org/pipermail/llvm-dev/2019-June/133145.html
To ease adoption of thinlto in legacy build systems, LLD should at least handle
thin archives, if not true static archives. There is a discussion of some of
these issues and how to solve them here:
https://reviews.llvm.org/D64461#1586526
It boils down to coming up with a good path for the .thinlto.bc file calculated
here:
http://llvm-cs.pcc.me.uk/lib/LTO/LTO.cpp#1206
With a very Chromium / LLVM perspective on things, I think the ideal index file
name would be something like:
${pathtoobj}/${object_noext}.o # stage1 output
${pathtoobj}/${object_noext}.${binary_noext}.thinlto.bc # index file
${pathtoobj}/${object_noext}.${binary_noext}.imports # import list
${pathtoobj}/${object_noext}.${binary_noext}.o # native output
So, for chromium on Windows, we'd have:
obj/v8/v8_libbase/bits.obj
obj/v8/v8_libbase/bits.d8.thinlto.bc
obj/v8/v8_libbase/bits.d8.o
obj/v8/v8_libbase/bits.chrome_child.thinlto.bc
obj/v8/v8_libbase/bits.chrome_child.o
... one per thinlto binary
I (think?) today the current behavior is that every link will attempt to write
obj/v8/v8_libbase/bits.thinlto.bc, which won't work if the same object is
compiled into two binaries.
Amy expressed interest in working on this.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190722/7e1e7534/attachment.html>
More information about the llvm-bugs
mailing list