title: Is anyone able to get the Address-Sanitizer (known as asan or -fsanitize=address) working on iOS?
body: <p>Address-Sanitizer <a href="https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer" rel="nofollow">https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer</a></p>
  
  <p>I have compile my own llvm (pretty straight forward compiling) because apple's llvm not support this function.</p>
  
  <p>I have tested the clang for mac command line program, it works (but without showing the line the sourcecode).</p>
  
  <p>for iOS, there is still some problems:</p>
  
  <ul>
  <li>compile simulator version : report error for pre-compiled header:</li>
  </ul>
  
  <blockquote>
    <p>In file included from     /Users/fluke/Documents/projects/tmp/testAsanNoARC/testAsanNoARC/testAsanNoARC-Prefix.pch:12:
    In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:53:24: error: 'UIAccelerometer' is unavailable: not available on OS X
    - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration NS_DEPRECATED_IOS(2_0, 5_0);
                           ^
        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:33:12: note: declaration has been explicitly marked unavailable here
    @interface UIAccelerometer : NSObject {
               ^
        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h:53:71: error: 'UIAcceleration' is unavailable: not available on OS X
    - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration NS_DEPRECATED_IOS(2_0, 5_0);
      ...</p>
  </blockquote>
  
  <ul>
  <li>compile for device version, it reports lack of libarc (but actually I don't enable ARC)</li>
  </ul>
  
  <blockquote>
    <p>ld: file not found: /Users/fluke/Documents/tools/asan/Debug+Asserts/lib/arc/libarclite_iphoneos.a
    clang: error: linker command failed with exit code 1 (use -v to see invocation) </p>
  </blockquote>
  
  <ul>
  <li>so I try use it for a separate lib - just new a lib target and use my own clang while the main target still use apple's llvm. the program compiles ( may need to link to the asan dylib in the built llvm), but not work because I asan need to be loaded before our program entry.</li>
  </ul>
  
  <p>who have experience with doing this?</p>