<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - cmake build of compiler-rt on Mac fails when LDFLAGS are set"
   href="http://llvm.org/bugs/show_bug.cgi?id=20668">20668</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>cmake build of compiler-rt on Mac fails when LDFLAGS are set
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>compiler-rt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hans@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We're trying to switch to using CMake for Chromium's Clang build. We do
bootstrap builds: first we build clang and libc++, then we use those to build
Clang again.

Steps to reproduce:

$ LDFLAGS="-L/work/llvm/build.release/lib" cmake -GNinja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=/work/llvm/build.release/bin/clang
-DCMAKE_CXX_COMPILER=/work/llvm/build.release/bin/clang++
-DCMAKE_CXX_FLAGS="-stdlib=libc++ -nostdinc++
-I/work/llvm/projects/libcxx/include" $LLVM_SRC_DIR
$ ninja

...

ld: building for iOS Simulator, but linking against dylib built for MacOSX file
'/work/llvm/build.release/lib/libc++.dylib' for architecture x86_64


The problem is that our LDFLAGS end up in the link lines also for the
cross-compiled runtimes, e.g. for iossim or i386.

We'll work around this by building compiler-rt in a separate tree and not
setting LDFLAGS, but it's not ideal.</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>