]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/android_base.rs
Rollup merge of #82497 - jyn514:json, r=CraftSpider
[rust.git] / compiler / rustc_target / src / spec / android_base.rs
1 use crate::spec::{LinkerFlavor, TargetOptions};
2
3 pub fn opts() -> TargetOptions {
4     let mut base = super::linux_gnu_base::opts();
5     base.os = "android".to_string();
6     // Many of the symbols defined in compiler-rt are also defined in libgcc.
7     // Android's linker doesn't like that by default.
8     base.pre_link_args
9         .entry(LinkerFlavor::Gcc)
10         .or_default()
11         .push("-Wl,--allow-multiple-definition".to_string());
12     base.dwarf_version = Some(2);
13     base.position_independent_executables = true;
14     base.has_elf_tls = false;
15     // This is for backward compatibility, see https://github.com/rust-lang/rust/issues/49867
16     // for context. (At that time, there was no `-C force-unwind-tables`, so the only solution
17     // was to always emit `uwtable`).
18     base.default_uwtable = true;
19     base.crt_static_respected = false;
20     base
21 }