<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - memory usage almost doubled while O3+LTOing clang?"
   href="https://bugs.llvm.org/show_bug.cgi?id=36123">36123</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>memory usage almost doubled while O3+LTOing clang?
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>matthias.krueger@famsik.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>While doing my multistage clang selfhost, it seems peak memory usage while
linking the clang binary went from 3-5 gigs compared to a week ago to at least
7 which causes OOM crash in my machine in most cases, if there is a another
linking job happening at the same time. I don't remember this ever being an
issue before at this stage.

cmake config of this stage (stage nr 2):

cmake ../llvm -G "Ninja" \
        -DCMAKE_BUILD_TYPE=Release \
        -DLLVM_BINUTILS_INCDIR=/usr/include \
        -DCMAKE_C_FLAGS="-march=native -O3  -g0 -DNDEBUG" \
        -DCMAKE_CXX_FLAGS="-march=native -O3  -g0 -DNDEBUG" \
        -DLLVM_PARALLEL_LINK_JOBS=2 \
        -DLLVM_OPTIMIZED_TABLEGEN=1 \
        -DLLVM_TARGETS_TO_BUILD="X86" \
        -DLLVM_ENABLE_LTO="Full" \
        -DCMAKE_AR="${rootDir}/stage_1/build/bin/llvm-ar" \
        -DCMAKE_RANLIB="${rootDir}/stage_1/build/bin/llvm-ranlib" \
        -DLLVM_USE_LINKER="${rootDir}/stage_1/build/bin/ld.lld"  \
    -DCMAKE_INSTALL_PREFIX="${stageBase}/build/" \
-DLLVM_LIBDIR_SUFFIX=64 \

full build script can be found here:
<a href="https://github.com/matthiaskrgr/llvm_bootstrap/blob/master/build_git.sh">https://github.com/matthiaskrgr/llvm_bootstrap/blob/master/build_git.sh</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>