<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 - Building with LINK_LLVM_DYLIB and LTO cause tblgen link failure"
   href="https://bugs.llvm.org/show_bug.cgi?id=33669">33669</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Building with LINK_LLVM_DYLIB and LTO cause tblgen link failure
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </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>TableGen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>me@marandil.pl
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18742" name="attach_18742" title="Repro script and log">attachment 18742</a> <a href="attachment.cgi?id=18742&action=edit" title="Repro script and log">[details]</a></span>
Repro script and log

I tried building LLVM trunk with the following CMake config:

```
cmake $SOURCE -G Ninja \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_INSTALL_PREFIX=$TARGET \
      -DLLVM_LINK_LLVM_DYLIB=On \
      -DLLVM_ENABLE_LTO=On \
      -DLLVM_ENABLE_ASSERTIONS=On \
      -DLLVM_TARGETS_TO_BUILD=X86
```

However, the process crashed at linking tblgen with numerous errors, including
the following four:

/usr/bin/ld: error: lib/libLLVMSupport.a: no archive symbol table (run ranlib)
/usr/bin/ld: error: lib/libLLVMTableGen.a: no archive symbol table (run ranlib)
/usr/bin/ld: error: lib/libLLVMSupport.a: no archive symbol table (run ranlib)
/usr/bin/ld: error: lib/libLLVMDemangle.a: no archive symbol table (run ranlib)


... followed by an uncountable number of undefined references.

I'm using llvm-3.8's clang/clang++ and GNU gold 1.14 from binutils 2.28 in this
build.

I'm attaching my repro script and full log
(gathered as `bash repro.sh 2>&1 | tee repro.log`)</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>