<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 - build of clang with LLVM_TARGETS_TO_BUILD set to X86 breaks when building clang shared library"
   href="https://bugs.llvm.org/show_bug.cgi?id=43009">43009</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>build of clang with LLVM_TARGETS_TO_BUILD set to X86 breaks when building clang shared library
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>8.0
          </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>Tooling
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jscharf@purestorage.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I was building clang 8.0.1 from source and tried using
-DLLVM_TARGETS_TO_BUILD="X86" as part of the cmake input along with shared
libraries. LLVM builds fine, the clang executable builds fine but the clang .so
fails, saying all the other arch entry points are missing. As soon as I change
X86 to all for both llvm and clang, it works fine. I am bootstrapping with
gcc9/ld first in this case.

cmake command for llvm:
 LD_LIBRARY_PATH="/usr/local/compilers/gcc9/lib64" cmake -G "Unix Makefiles"
-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/local/compilers/gcc9/bin/gcc
-DCMAKE_CXX_COMPILER=/usr/local/compilers/gcc9/bin/g++
-DCMAKE_INSTALL_PREFIX=/usr/local/compilers/clang8
-DLLVM_TARGETS_TO_BUILD="all" -DLLVM_BUILD_LLVM_DYLIB=true
-DLLVM_LINK_LLVM_DYLIB=true ../../llvm-8.0.1.src

clang:

LD_LIBRARY_PATH="/usr/local/compilers/gcc9/lib64" cmake -G "Unix Makefiles"
-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/local/compilers/gcc9/bin/gcc
-DCMAKE_CXX_COMPILER=/usr/local/compilers/gcc9/bin/g++
-DCMAKE_INSTALL_PREFIX=/usr/local/compilers/clang8
-DLLVM_TARGETS_TO_BUILD="all" -DLLVM_BUILD_LLVM_DYLIB=true
-DLLVM_LINK_LLVM_DYLIB=true -DCMAKE_C_FLAGS="-L/usr/local/compilers/c
lang8/lib" -DCMAKE_CXX_FLAGS="-L/usr/local/compilers/clang8/lib"
../../cfe-8.0.1.src</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>