Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ASan and TSan on FreeBSD (WIP) #47337

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/build_helper/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ pub fn sanitizer_lib_boilerplate(sanitizer_name: &str) -> Result<NativeLibBoiler
format!("clang_rt.{}-x86_64", sanitizer_name),
"build/lib/linux",
),
"x86_64-unknown-freebsd" => (
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",
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-x86_64-freebsd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"];

Expand Down
4 changes: 4 additions & 0 deletions src/libstd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand Down