rustc_target/spec/base/
android.rs

1use crate::spec::{SanitizerSet, TargetOptions, TlsModel, base};
2
3pub(crate) fn opts() -> TargetOptions {
4    let mut base = base::linux::opts();
5    base.os = "android".into();
6    base.is_like_android = true;
7    base.default_dwarf_version = 2;
8    base.tls_model = TlsModel::Emulated;
9    base.has_thread_local = false;
10    base.supported_sanitizers = SanitizerSet::ADDRESS;
11    // This is for backward compatibility, see https://github.com/rust-lang/rust/issues/49867
12    // for context. (At that time, there was no `-C force-unwind-tables`, so the only solution
13    // was to always emit `uwtable`).
14    base.default_uwtable = true;
15    base.crt_static_respected = true;
16    base
17}