about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-17 17:02:18 +0000
committerbors <bors@rust-lang.org>2017-07-17 17:02:18 +0000
commit2652ce6771b114189cdc1f9bd026a10af0a714e0 (patch)
tree88279d8bbad4f84310d3421b2a1a9aa2e4e7533d /src/rustllvm/RustWrapper.cpp
parent028569ab1b339bcc00814e1c7fb71a5cea5ccb0f (diff)
parent0af5c002a25688e826f5821b495e415f6f941bb4 (diff)
downloadrust-2652ce6771b114189cdc1f9bd026a10af0a714e0.tar.gz
rust-2652ce6771b114189cdc1f9bd026a10af0a714e0.zip
Auto merge of #42711 - Firstyear:san-on-dylib, r=alexcrichton
Add support for dylibs with Address Sanitizer

Many applications use address sanitizer to assert correct behaviour of their programs. When using Rust with C, it's much more important to assert correct programs with tools like asan/lsan due to the unsafe nature of the access across an ffi boundary. However, previously only rust bin types could use asan. This posed a challenge for existing C applications that link or dlopen .so when the C application is compiled with asan.

This PR enables asan to be linked to the dylib and cdylib crate type. We alter the test to check the proc-macro crate does not work with -Z sanitizer=address. Finally, we add a test that compiles a shared object in rust, then another rust program links it and demonstrates a crash through the call to the library.

This PR is nearly complete, but I do require advice on the change to fix the -lasan that currently exists in the dylib test. This is required because the link statement is not being added correctly to the rustc build when -Z sanitizer=address is added (and I'm not 100% sure why)

Thanks,
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions