[llvm-bugs] [Bug 45289] New: LLD fails to link LTO builds with in-memory ELF objects larger than 4 GiB

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 23 16:51:57 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45289

            Bug ID: 45289
           Summary: LLD fails to link LTO builds with in-memory ELF
                    objects larger than 4 GiB
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: orivej at gmx.fr
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

Created attachment 23275
  --> https://bugs.llvm.org/attachment.cgi?id=23275&action=edit
Support large intermediate in-memory ELF object

LLD allocates memory for the intermediate native ELF objects in SmallVector
[1], and SmallVector aborts when it grows beyond 4 GiB [2].

The attached simple patch fixes this issue. If it looks reasonable I can send
it for review.

(For the record, the binary in question takes 1.5 hours and 80 GB of RAM to
link with full LTO and becomes 2.5 GB large including debug info.)

[1] https://github.com/llvm/llvm-project/blob/bfa9ce1cb/lld/ELF/LTO.cpp#L264
[2]
https://github.com/llvm/llvm-project/blob/bfa9ce1cb/llvm/lib/Support/SmallVector.cpp#L45

-- 
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/20200323/a6a3425d/attachment.html>


More information about the llvm-bugs mailing list