Skip to content

Instantly share code, notes, and snippets.

@eonil
Last active August 29, 2015 14:10
Show Gist options
  • Save eonil/ac0c7e9310f15f610807 to your computer and use it in GitHub Desktop.
Save eonil/ac0c7e9310f15f610807 to your computer and use it in GitHub Desktop.
LLVM Note

LLVM Note

Address Sanitizer Support

You can compile program with address sanitizer support using command like this:

clang cc -lc++ -std=c++11 -fsanitize=address main.cpp

You are liely to see this error:

dyld: Library not loaded: @executable_path/libclang_rt.asan_osx_dynamic.dylib
  Referenced from: /Users/Eonil/Workshop/Sandbox3/cpp-sanitizer-test/cpp-sanitizer-test/./a.out
  Reason: image not found
Trace/BPT trap: 5

This happens due to lack of runtime support library for address sanitizer. Copy these files from the Chromium's binaries into the executables folder.

libclang_rt.asan*_dynamic.dylib

Using Custom Clang with Xcode

See: http://blog.timac.org/?p=847

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment