Skip to content

Commit 2c28348

Browse files
committed
rollup merge of rust-lang#24953: tamird/android-pie
This is OK to do given: - PIE is supported on Android starting with API 16. - The bots are running API 18. - API < 16 now has a 12.5% market share[0] as of 2015-04-29. Closes rust-lang#17437. [0] https://developer.android.com/about/dashboards/index.html r? @alexcrichton
2 parents 50b3dce + 9f36ec0 commit 2c28348

File tree

5 files changed

+33
-22
lines changed

5 files changed

+33
-22
lines changed

src/librustc_back/target/aarch64_linux_android.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
use target::Target;
1212

1313
pub fn target() -> Target {
14-
let mut base = super::linux_base::opts();
15-
base.pre_link_args.push("-Wl,--allow-multiple-definition".to_string());
16-
base.is_like_android = true;
17-
base.position_independent_executables = true;
1814
Target {
1915
data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
2016
f32:32:32-f64:64:64-v64:64:64-v128:128:128-a:0:64-\
@@ -25,6 +21,6 @@ pub fn target() -> Target {
2521
arch: "aarch64".to_string(),
2622
target_os: "android".to_string(),
2723
target_env: "".to_string(),
28-
options: base,
24+
options: super::android_base::opts(),
2925
}
3026
}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use target::TargetOptions;
12+
13+
pub fn opts() -> TargetOptions {
14+
let mut base = super::linux_base::opts();
15+
// Many of the symbols defined in compiler-rt are also defined in libgcc.
16+
// Android's linker doesn't like that by default.
17+
base.pre_link_args.push("-Wl,--allow-multiple-definition".to_string());
18+
base.is_like_android = true;
19+
base.position_independent_executables = true;
20+
base
21+
}

src/librustc_back/target/arm_linux_androideabi.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,13 @@
1111
use target::Target;
1212

1313
pub fn target() -> Target {
14-
let mut base = super::linux_base::opts();
14+
let mut base = super::android_base::opts();
1515
base.features = "+v7".to_string();
16-
// Many of the symbols defined in compiler-rt are also defined in libgcc. Android
17-
// linker doesn't like that by default.
18-
base.pre_link_args.push("-Wl,--allow-multiple-definition".to_string());
19-
base.is_like_android = true;
20-
// FIXME #17437 (and #17448): Android doesn't support position dependent executables anymore.
21-
base.position_independent_executables = false;
2216

2317
Target {
24-
data_layout: "e-p:32:32:32\
25-
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
26-
-f32:32:32-f64:64:64\
27-
-v64:64:64-v128:64:128\
28-
-a:0:64-n32".to_string(),
18+
data_layout: "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
19+
f32:32:32-f64:64:64-v64:64:64-v128:64:128-a:0:64-\
20+
n32".to_string(),
2921
llvm_target: "arm-linux-androideabi".to_string(),
3022
target_endian: "little".to_string(),
3123
target_pointer_width: "32".to_string(),

src/librustc_back/target/mod.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@
4646
//! specified by the target, rather than replace.
4747
4848
use serialize::json::Json;
49-
use syntax::{diagnostic, abi};
5049
use std::default::Default;
5150
use std::io::prelude::*;
51+
use syntax::{diagnostic, abi};
5252

53-
mod windows_base;
54-
mod linux_base;
53+
mod android_base;
5554
mod apple_base;
5655
mod apple_ios_base;
57-
mod freebsd_base;
58-
mod dragonfly_base;
5956
mod bitrig_base;
57+
mod dragonfly_base;
58+
mod freebsd_base;
59+
mod linux_base;
6060
mod openbsd_base;
61+
mod windows_base;
6162

6263
/// Everything `rustc` knows about how to compile for a specific target.
6364
///

src/test/run-pass/backtrace.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// no-pretty-expanded FIXME #15189
1212
// ignore-windows FIXME #13259
13+
// ignore-android FIXME #17520
1314

1415
use std::env;
1516
use std::process::{Command, Stdio};

0 commit comments

Comments
 (0)