Skip to content
Open
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
2 changes: 2 additions & 0 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,8 @@ supported_targets! {
("x86_64-lynx-lynxos178", x86_64_lynx_lynxos178),

("x86_64-pc-cygwin", x86_64_pc_cygwin),

("x86_64-asan-linux-gnu", x86_64_asan_linux_gnu),
}

/// Cow-Vec-Str: Cow<'static, [Cow<'static, str>]>
Expand Down
31 changes: 31 additions & 0 deletions compiler/rustc_target/src/spec/targets/x86_64_asan_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
use crate::spec::{
Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetOptions, TargetMetadata, base,
};

pub(crate) fn target() -> Target {
let mut base = base::linux_gnu::opts();
base.cpu = "x86-64".into();
base.plt_by_default = false;
base.max_atomic_width = Some(64);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
base.stack_probes = StackProbeType::Inline;
base.static_position_independent_executables = true;
base.supported_sanitizers = SanitizerSet::ADDRESS;
base.default_sanitizers = SanitizerSet::ADDRESS;
base.supports_xray = true;

Target {
llvm_target: "x86_64-unknown-linux-gnu".into(),
metadata: TargetMetadata {
description: Some("64-bit Linux (kernel 3.2+, glibc 2.17+)".into()),
tier: Some(1),
host_tools: Some(true),
std: Some(true),
},
pointer_width: 64,
data_layout:
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
arch: Arch::X86_64,
options: base,
}
}
6 changes: 6 additions & 0 deletions src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ pub(crate) fn is_ci_llvm_available_for_target(
("i686-pc-windows-msvc", false),
("i686-unknown-linux-gnu", false),
("x86_64-unknown-linux-gnu", true),
("x86_64-asan-linux-gnu", false),
("x86_64-apple-darwin", true),
("x86_64-pc-windows-gnu", true),
("x86_64-pc-windows-msvc", true),
Expand Down Expand Up @@ -1293,6 +1294,11 @@ fn supported_sanitizers(
"x86_64",
&["asan", "dfsan", "lsan", "msan", "safestack", "tsan", "rtsan"],
),
"x86_64-asan-linux-gnu" => common_libs(
"linux",
"x86_64",
&["asan"],
),
"x86_64-unknown-linux-musl" => {
common_libs("linux", "x86_64", &["asan", "lsan", "msan", "tsan"])
}
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const STAGE0_MISSING_TARGETS: &[&str] = &[
// just a dummy comment so the list doesn't get onelined
"riscv64gc-unknown-redox",
"hexagon-unknown-qurt",
"x86_64-asan-linux-gnu",
];

/// Minimum version threshold for libstdc++ required when using prebuilt LLVM
Expand Down
Loading