Skip to content

Commit d4432b3

Browse files
committed
Auto merge of #27076 - alexcrichton:update-llvm, r=brson
LLVM has recently created their 3.7 release branch, and this PR updates us to that point. This should hopefully mean that we're basically compatible with the upcoming 3.7 release. Additionally, there are a number of goodies on this branch. * This contains a fix for https://llvm.org/bugs/show_bug.cgi?id=23957 which should help us bootstrap farther on 32-bit MSVC targets. * There is better support for writing multiple flavors of archives, allowing us to use the built-in LLVM support instead of the system `ar` on all current platforms of the compiler. * This LLVM has SafeStack support * An [optimization patch](rust-lang/llvm@7cf5e26) by @pcwalton is included. * A number of other minor test fixes here and there. Due to problems dealing with the data layout we pass to LLVM, this PR also takes the time to clean up how we specific this. We no longer specify a data layout to LLVM by default and instead take the default for the target from LLVM to pass to the module that we're building. This should be more robust going into the future, and I'm also not sure we know what any of these arcane strings are any more...
2 parents b5dad7d + 6d96edf commit d4432b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+291
-587
lines changed

Diff for: src/librustc/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,8 @@ pub mod diagnostics;
9999

100100
pub mod back {
101101
pub use rustc_back::abi;
102-
pub use rustc_back::arm;
103-
pub use rustc_back::mips;
104-
pub use rustc_back::mipsel;
105102
pub use rustc_back::rpath;
106103
pub use rustc_back::svh;
107-
pub use rustc_back::target_strs;
108-
pub use rustc_back::x86;
109-
pub use rustc_back::x86_64;
110104
}
111105

112106
pub mod ast_map;

Diff for: src/librustc_back/arm.rs

-77
This file was deleted.

Diff for: src/librustc_back/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,7 @@ extern crate rustc_llvm;
5252

5353
pub mod abi;
5454
pub mod tempdir;
55-
pub mod arm;
56-
pub mod mips;
57-
pub mod mipsel;
5855
pub mod rpath;
5956
pub mod sha2;
6057
pub mod svh;
61-
pub mod target_strs;
62-
pub mod x86;
63-
pub mod x86_64;
6458
pub mod target;

Diff for: src/librustc_back/mips.rs

-72
This file was deleted.

Diff for: src/librustc_back/mipsel.rs

-72
This file was deleted.

Diff for: src/librustc_back/target/aarch64_apple_ios.rs

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ use super::apple_ios_base::{opts, Arch};
1313

1414
pub fn target() -> Target {
1515
Target {
16-
// reference layout: e-m:o-i64:64-i128:128-n32:64-S128
17-
data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
18-
i128:128-f32:32:32-f64:64:64-v64:64:64-v128:128:128-\
19-
a:0:64-n32:64-S128".to_string(),
2016
llvm_target: "arm64-apple-ios".to_string(),
2117
target_endian: "little".to_string(),
2218
target_pointer_width: "64".to_string(),

Diff for: src/librustc_back/target/aarch64_linux_android.rs

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ use target::Target;
1212

1313
pub fn target() -> Target {
1414
Target {
15-
data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
16-
f32:32:32-f64:64:64-v64:64:64-v128:128:128-a:0:64-\
17-
n32:64-S128".to_string(),
1815
llvm_target: "aarch64-linux-android".to_string(),
1916
target_endian: "little".to_string(),
2017
target_pointer_width: "64".to_string(),

Diff for: src/librustc_back/target/aarch64_unknown_linux_gnu.rs

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ use target::Target;
1313
pub fn target() -> Target {
1414
let base = super::linux_base::opts();
1515
Target {
16-
data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
17-
f32:32:32-f64:64:64-v64:64:64-v128:128:128-a:0:64-\
18-
n32:64-S128".to_string(),
1916
llvm_target: "aarch64-unknown-linux-gnu".to_string(),
2017
target_endian: "little".to_string(),
2118
target_pointer_width: "64".to_string(),

Diff for: src/librustc_back/target/apple_base.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub fn opts() -> TargetOptions {
2323
has_rpath: true,
2424
dll_prefix: "lib".to_string(),
2525
dll_suffix: ".dylib".to_string(),
26+
archive_format: "bsd".to_string(),
2627
pre_link_args: Vec::new(),
2728
.. Default::default()
2829
}

Diff for: src/librustc_back/target/arm_linux_androideabi.rs

-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ pub fn target() -> Target {
1515
base.features = "+v7".to_string();
1616

1717
Target {
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(),
2118
llvm_target: "arm-linux-androideabi".to_string(),
2219
target_endian: "little".to_string(),
2320
target_pointer_width: "32".to_string(),

Diff for: src/librustc_back/target/arm_unknown_linux_gnueabi.rs

-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ use target::{Target, TargetOptions};
1313
pub fn target() -> Target {
1414
let base = super::linux_base::opts();
1515
Target {
16-
data_layout: "e-p:32:32:32\
17-
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
18-
-f32:32:32-f64:64:64\
19-
-v64:64:64-v128:64:128\
20-
-a:0:64-n32".to_string(),
2116
llvm_target: "arm-unknown-linux-gnueabi".to_string(),
2217
target_endian: "little".to_string(),
2318
target_pointer_width: "32".to_string(),

Diff for: src/librustc_back/target/arm_unknown_linux_gnueabihf.rs

-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ use target::{Target, TargetOptions};
1313
pub fn target() -> Target {
1414
let base = super::linux_base::opts();
1515
Target {
16-
data_layout: "e-p:32:32:32\
17-
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
18-
-f32:32:32-f64:64:64\
19-
-v64:64:64-v128:64:128\
20-
-a:0:64-n32".to_string(),
2116
llvm_target: "arm-unknown-linux-gnueabihf".to_string(),
2217
target_endian: "little".to_string(),
2318
target_pointer_width: "32".to_string(),

Diff for: src/librustc_back/target/armv7_apple_ios.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use super::apple_ios_base::{opts, Arch};
1313

1414
pub fn target() -> Target {
1515
Target {
16-
data_layout: "e-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(),
1716
llvm_target: "armv7-apple-ios".to_string(),
1817
target_endian: "little".to_string(),
1918
target_pointer_width: "32".to_string(),

Diff for: src/librustc_back/target/armv7s_apple_ios.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use super::apple_ios_base::{opts, Arch};
1313

1414
pub fn target() -> Target {
1515
Target {
16-
data_layout: "e-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(),
1716
llvm_target: "armv7s-apple-ios".to_string(),
1817
target_endian: "little".to_string(),
1918
target_pointer_width: "32".to_string(),

Diff for: src/librustc_back/target/bitrig_base.rs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub fn opts() -> TargetOptions {
2222
position_independent_executables: true,
2323
pre_link_args: vec!(
2424
),
25+
archive_format: "bsd".to_string(),
2526

2627
.. Default::default()
2728
}

Diff for: src/librustc_back/target/dragonfly_base.rs

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pub fn opts() -> TargetOptions {
2929
"-Wl,--as-needed".to_string(),
3030
),
3131
position_independent_executables: true,
32+
archive_format: "bsd".to_string(),
3233
.. Default::default()
3334
}
3435
}

Diff for: src/librustc_back/target/freebsd_base.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub fn opts() -> TargetOptions {
1818
executables: true,
1919
morestack: true,
2020
has_rpath: true,
21+
archive_format: "bsd".to_string(),
2122

2223
.. Default::default()
2324
}

Diff for: src/librustc_back/target/i386_apple_ios.rs

-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ use super::apple_ios_base::{opts, Arch};
1313

1414
pub fn target() -> Target {
1515
Target {
16-
data_layout: "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16\
17-
-i32:32:32-i64:32:64\
18-
-f32:32:32-f64:32:64-v64:64:64\
19-
-v128:128:128-a:0:64-f80:128:128\
20-
-n8:16:32".to_string(),
2116
llvm_target: "i386-apple-ios".to_string(),
2217
target_endian: "little".to_string(),
2318
target_pointer_width: "32".to_string(),

Diff for: src/librustc_back/target/i686_apple_darwin.rs

-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ pub fn target() -> Target {
1616
base.pre_link_args.push("-m32".to_string());
1717

1818
Target {
19-
data_layout: "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16\
20-
-i32:32:32-i64:32:64\
21-
-f32:32:32-f64:32:64-v64:64:64\
22-
-v128:128:128-a:0:64-f80:128:128\
23-
-n8:16:32".to_string(),
2419
llvm_target: "i686-apple-darwin".to_string(),
2520
target_endian: "little".to_string(),
2621
target_pointer_width: "32".to_string(),

Diff for: src/librustc_back/target/i686_pc_windows_gnu.rs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pub fn target() -> Target {
2424
options.pre_link_args.push("-shared-libgcc".to_string());
2525

2626
Target {
27-
data_layout: "e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32".to_string(),
2827
llvm_target: "i686-pc-windows-gnu".to_string(),
2928
target_endian: "little".to_string(),
3029
target_pointer_width: "32".to_string(),

0 commit comments

Comments
 (0)