title: LLVM 6 Trunk Build on Ubuntu 16.04 not building lld
body: <p>I am building LLVM 6 on Ubuntu 16.04. I want <code>lld</code> too. But no matter what I do, <code>lld</code> doesn't build/install.</p>
  
  <p>Followed the following instruction from <a href="https://llvm.org/docs/GettingStarted.html#overview" rel="nofollow noreferrer">here</a>. <em>Still sifting through first and second :)</em></p>
  
  <ol>
  <li><p>Read the documentation.</p></li>
  <li><p>Read the documentation.</p></li>
  <li><p>Remember that you were warned twice about reading the documentation.</p>
  
  <p>In particular, the relative paths specified are important.</p></li>
  <li><p>Checkout LLVM:</p>
  
  <pre><code>cd where-you-want-llvm-to-live
  svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
  </code></pre></li>
  <li><p>Checkout Clang:</p>
  
  <pre><code>cd where-you-want-llvm-to-live
  cd llvm/tools
  svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
  </code></pre></li>
  <li><p>Checkout Extra Clang Tools [Optional]:</p>
  
  <pre><code>cd where-you-want-llvm-to-live
  cd llvm/tools/clang/tools
  svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
  </code></pre></li>
  <li><p>Checkout LLD linker [Optional]:</p>
  
  <pre><code>cd where-you-want-llvm-to-live
  cd llvm/tools
  svn co http://llvm.org/svn/llvm-project/lld/trunk lld
  </code></pre></li>
  </ol>
  
  <p>Didn't download the other optional packages. Since <code>svn</code> download was not working properly (<code>svn: E000104: Error running context: Connection reset by peer</code>), I downloaded respective <code>zip</code> for <a href="https://github.com/llvm-mirror/llvm" rel="nofollow noreferrer">LLVM</a>, <a href="https://github.com/llvm-mirror/clang" rel="nofollow noreferrer">Clang</a>, <a href="https://github.com/llvm-mirror/clang-tools-extra" rel="nofollow noreferrer">clang-extra</a> and <a href="https://github.com/llvm-mirror/lld" rel="nofollow noreferrer">lld</a> from their github mirrors. Since, I didn't use <code>svn</code> some renaming of the folders had to be done (for e.g. <code>clang-tools-extra-master</code> to just <code>extra</code>).</p>
  
  <p>Then execute the following, after <code>cd</code>ing into the parent folder of the <code>llvm</code> source folder,</p>
  
  <pre><code>$ mkdir build; cd build
  $ cmake ../llvm
  $ make
  </code></pre>
  
  <p>After waiting for +8 hours, I get all the programs (<code>clang</code>, <code>lli</code>, <code>llc</code> etc.) except <code>lld</code>. I am expecting it to appear in the folder <code>build/bin</code>.</p>
  
  <p>I have also tried the option <code>cmake -DLLVM_ENABLE_PROJECTS=llvm/tools/lld ../llvm</code>. (The form <code>-DLLVM_ENABLE_PROJECTS=lld</code> doesn't work and I found <a href="http://lists.llvm.org/pipermail/llvm-dev/2017-June/114021.html" rel="nofollow noreferrer">this</a> place discussing about the same ENABLE issue.)</p>
  
  <p>I have already tried things with some tweaking three times. Since it takes so much time to compile, I decided to take your help.</p>
  
  <p>A separate issue: While building, linking phase takes 12 GB RAM + 8.8 GB swap space on my laptop!! Does LLVM building really require >20 GB of ram ? (I had closed all other foreground apps, especially <code>firefox</code>)</p>
  
  <p>Please let me know if any more information is needed.</p>