<html>
    <head>
      <base href="https://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 --- - compiler-rt config-ix.cmake missing link flag for iOS simulator"
   href="https://llvm.org/bugs/show_bug.cgi?id=24864">24864</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>compiler-rt config-ix.cmake missing link flag for iOS simulator
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Build scripts
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>cmake
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>aw1621107@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On OS X 10.11, Xcode/CLT 7.1, trunk build through homebrew using "brew install
llvm --with-clang --with-lldb --HEAD --debug --verbose" and this formula:
<a href="https://gist.github.com/aw1621107/dccde531d91349d3eaee">https://gist.github.com/aw1621107/dccde531d91349d3eaee</a>

During this build, ld refuses to link libclang_rt.asan_iossim_dynamic.dylib
when compiling the address sanitizer. Instead of looking in the iOS simulator
SDK, it goes straight to /usr/lib, resulting in the build failing with the
message "building for iOS simulator, but linking against dylib built for OS X
(architecture x86_64)"

Turns out that setting -sysroot during the link step did not seem to set the
sysroot for the ld call. I fixed this issue by adding a ld-specific sysroot
flag to projects/compiler-rt/cmake/config-ix.cmake under line 343:

-Wl,-syslibroot ${IOSSIM_SDK_DIR}

While this works on my machine, I'm not 100% sure that this will work for
everyone, as the build fails at a later point with a different error message.
In addition, it appears that this problem does not affect every OS X machine,
as some users on IRC were able to build trunk just fine.

If more information is required, I'll be happy to provide it.</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>