diff options
| author | kennytm <kennytm@gmail.com> | 2017-04-18 04:22:16 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2017-04-25 10:31:01 +0800 |
| commit | 00dff0aa59ce2d71957ca16a4444c303910686a3 (patch) | |
| tree | 852ffe5c231746516dfd968e7e5272840d09a92d /src/test/run-pass/thinlto | |
| parent | 93d57d64b86d574efa35e2fb354d8dc92153b8a7 (diff) | |
| download | rust-00dff0aa59ce2d71957ca16a4444c303910686a3.tar.gz rust-00dff0aa59ce2d71957ca16a4444c303910686a3.zip | |
Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin.
ASan and TSan are supported on macOS, and this commit enables their
support.
The sanitizers are always built as *.dylib on Apple platforms, so they
cannot be statically linked into the corresponding `rustc_?san.rlib`. The
dylibs are directly copied to `lib/rustlib/x86_64-apple-darwin/lib/`
instead.
Note, although Xcode also ships with their own copies of ASan/TSan dylibs,
we cannot use them due to version mismatch.
There is a caveat: the sanitizer libraries are linked as @rpath, so the
user needs to additionally pass `-C rpath`:
rustc -Z sanitizer=address -C rpath file.rs
^~~~~~~~
Otherwise there will be a runtime error:
dyld: Library not loaded: @rpath/libclang_rt.asan_osx_dynamic.dylib
Referenced from: /path/to/executable
Reason: image not found
Abort trap: 6
The next commit includes a temporary change in compiler to force the linker
to emit a usable @rpath.
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions
