<p dir="ltr">To some extent. I'm able to compile and link small Chrome tests with this patch, and they work fine under the simulator.<br>
I'm still not sure whether we need to build a separate version of the runtime targeting the simulator.</p>
<div class="gmail_quote">On Mar 15, 2013 8:49 PM, "Anna Zaks" <<a href="mailto:ganna@apple.com">ganna@apple.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Alex,<div><br></div><div>Does this mean that ASan is now supported on the iOS simulator? </div><div><br></div><div>Thanks,</div><div>Anna.</div><div><br><div><div>On Mar 15, 2013, at 9:13 AM, Alexander Potapenko <<a href="mailto:glider@google.com" target="_blank">glider@google.com</a>> wrote:</div>
<br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">+Ted, Anna<br><br>On Fri, Mar 15, 2013 at 8:13 PM, Alexander Potapenko <<a href="mailto:glider@google.com" target="_blank">glider@google.com</a>> wrote:<br>
<blockquote type="cite">This patch lets the users invoke `clang -fsanitize=address` to link binaries targeting the iOS simulator.<br><br><a href="http://llvm-reviews.chandlerc.com/D545" target="_blank">http://llvm-reviews.chandlerc.com/D545</a><br>
<br>Files:<br> lib/Driver/ToolChains.cpp<br><br>Index: lib/Driver/ToolChains.cpp<br>===================================================================<br>--- lib/Driver/ToolChains.cpp<br>+++ lib/Driver/ToolChains.cpp<br>
@@ -335,17 +335,19 @@<br>  // Add ASAN runtime library, if required. Dynamic libraries and bundles<br>  // should not be linked with the runtime library.<br>  if (Sanitize.needsAsanRt()) {<br>-    if (Args.hasArg(options::OPT_dynamiclib) ||<br>
-        Args.hasArg(options::OPT_bundle)) {<br>-      // Assume the binary will provide the ASan runtime.<br>-    } else if (isTargetIPhoneOS()) {<br>+    if (isTargetIPhoneOS() && !isTargetIOSSimulator()) {<br>      getDriver().Diag(diag::err_drv_clang_unsupported_per_platform)<br>
        << "-fsanitize=address";<br>    } else {<br>-      AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.asan_osx_dynamic.dylib", true);<br>-<br>-      // The ASAN runtime library requires C++.<br>
-      AddCXXStdlibLibArgs(Args, CmdArgs);<br>+      if (Args.hasArg(options::OPT_dynamiclib) ||<br>+          Args.hasArg(options::OPT_bundle)) {<br>+        // Assume the binary will provide the ASan runtime.<br>+      } else {<br>
+        AddLinkRuntimeLib(Args, CmdArgs,<br>+                          "libclang_rt.asan_osx_dynamic.dylib", true);<br>+        // The ASAN runtime library requires C++.<br>+        AddCXXStdlibLibArgs(Args, CmdArgs);<br>
+      }<br>    }<br>  }<br></blockquote><br><br><br>--<span> </span><br>Alexander Potapenko<br>Software Engineer<br>Google Moscow</div></blockquote></div><br></div></div></blockquote></div>