diff --git a/src/build_helper/lib.rs b/src/build_helper/lib.rs index 363bbd7954422..c14dd43aac967 100644 --- a/src/build_helper/lib.rs +++ b/src/build_helper/lib.rs @@ -214,6 +214,10 @@ pub fn sanitizer_lib_boilerplate(sanitizer_name: &str) -> Result ( + format!("clang_rt.{}-x86_64", sanitizer_name), + "build/lib/freebsd", + ), "x86_64-apple-darwin" => ( format!("dylib=clang_rt.{}_osx_dynamic", sanitizer_name), "build/lib/darwin", diff --git a/src/ci/docker/dist-x86_64-freebsd/Dockerfile b/src/ci/docker/dist-x86_64-freebsd/Dockerfile index 7483d395622c8..81c3fd6ef3867 100644 --- a/src/ci/docker/dist-x86_64-freebsd/Dockerfile +++ b/src/ci/docker/dist-x86_64-freebsd/Dockerfile @@ -29,5 +29,5 @@ ENV \ ENV HOSTS=x86_64-unknown-freebsd -ENV RUST_CONFIGURE_ARGS --host=$HOSTS --enable-extended +ENV RUST_CONFIGURE_ARGS --host=$HOSTS --enable-extended --enable-sanitizers ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index 946eecaa45f7d..9f1e9fd1acd07 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -707,9 +707,11 @@ impl<'a> CrateLoader<'a> { // Sanitizers can only be used on some tested platforms with // executables linked to `std` const ASAN_SUPPORTED_TARGETS: &[&str] = &["x86_64-unknown-linux-gnu", - "x86_64-apple-darwin"]; + "x86_64-apple-darwin", + "x86_64-unknown-freebsd"]; const TSAN_SUPPORTED_TARGETS: &[&str] = &["x86_64-unknown-linux-gnu", - "x86_64-apple-darwin"]; + "x86_64-apple-darwin", + "x86_64-unknown-freebsd"]; const LSAN_SUPPORTED_TARGETS: &[&str] = &["x86_64-unknown-linux-gnu"]; const MSAN_SUPPORTED_TARGETS: &[&str] = &["x86_64-unknown-linux-gnu"]; diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml index 3430ecabcbeae..d929eef669eec 100644 --- a/src/libstd/Cargo.toml +++ b/src/libstd/Cargo.toml @@ -38,6 +38,10 @@ rustc_lsan = { path = "../librustc_lsan" } rustc_msan = { path = "../librustc_msan" } rustc_tsan = { path = "../librustc_tsan" } +[target.x86_64-unknown-freebsd.dependencies] +rustc_asan = { path = "../librustc_asan" } +rustc_tsan = { path = "../librustc_tsan" } + [build-dependencies] build_helper = { path = "../build_helper" }