Skip to content

Commit

Permalink
Auto merge of #27076 - alexcrichton:update-llvm, r=brson
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
bors committed Jul 17, 2015
2 parents b5dad7d + 6d96edf commit d4432b3
Show file tree
Hide file tree
Showing 64 changed files with 291 additions and 587 deletions.
6 changes: 0 additions & 6 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,8 @@ pub mod diagnostics;

pub mod back {
pub use rustc_back::abi;
pub use rustc_back::arm;
pub use rustc_back::mips;
pub use rustc_back::mipsel;
pub use rustc_back::rpath;
pub use rustc_back::svh;
pub use rustc_back::target_strs;
pub use rustc_back::x86;
pub use rustc_back::x86_64;
}

pub mod ast_map;
Expand Down
77 changes: 0 additions & 77 deletions src/librustc_back/arm.rs

This file was deleted.

6 changes: 0 additions & 6 deletions src/librustc_back/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ extern crate rustc_llvm;

pub mod abi;
pub mod tempdir;
pub mod arm;
pub mod mips;
pub mod mipsel;
pub mod rpath;
pub mod sha2;
pub mod svh;
pub mod target_strs;
pub mod x86;
pub mod x86_64;
pub mod target;
72 changes: 0 additions & 72 deletions src/librustc_back/mips.rs

This file was deleted.

72 changes: 0 additions & 72 deletions src/librustc_back/mipsel.rs

This file was deleted.

4 changes: 0 additions & 4 deletions src/librustc_back/target/aarch64_apple_ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ use super::apple_ios_base::{opts, Arch};

pub fn target() -> Target {
Target {
// reference layout: e-m:o-i64:64-i128:128-n32:64-S128
data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
i128:128-f32:32:32-f64:64:64-v64:64:64-v128:128:128-\
a:0:64-n32:64-S128".to_string(),
llvm_target: "arm64-apple-ios".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
Expand Down
3 changes: 0 additions & 3 deletions src/librustc_back/target/aarch64_linux_android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ use target::Target;

pub fn target() -> Target {
Target {
data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
f32:32:32-f64:64:64-v64:64:64-v128:128:128-a:0:64-\
n32:64-S128".to_string(),
llvm_target: "aarch64-linux-android".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
Expand Down
3 changes: 0 additions & 3 deletions src/librustc_back/target/aarch64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ use target::Target;
pub fn target() -> Target {
let base = super::linux_base::opts();
Target {
data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
f32:32:32-f64:64:64-v64:64:64-v128:128:128-a:0:64-\
n32:64-S128".to_string(),
llvm_target: "aarch64-unknown-linux-gnu".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/apple_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub fn opts() -> TargetOptions {
has_rpath: true,
dll_prefix: "lib".to_string(),
dll_suffix: ".dylib".to_string(),
archive_format: "bsd".to_string(),
pre_link_args: Vec::new(),
.. Default::default()
}
Expand Down
3 changes: 0 additions & 3 deletions src/librustc_back/target/arm_linux_androideabi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ pub fn target() -> Target {
base.features = "+v7".to_string();

Target {
data_layout: "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
f32:32:32-f64:64:64-v64:64:64-v128:64:128-a:0:64-\
n32".to_string(),
llvm_target: "arm-linux-androideabi".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
Expand Down
5 changes: 0 additions & 5 deletions src/librustc_back/target/arm_unknown_linux_gnueabi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ use target::{Target, TargetOptions};
pub fn target() -> Target {
let base = super::linux_base::opts();
Target {
data_layout: "e-p:32:32:32\
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
-f32:32:32-f64:64:64\
-v64:64:64-v128:64:128\
-a:0:64-n32".to_string(),
llvm_target: "arm-unknown-linux-gnueabi".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
Expand Down
5 changes: 0 additions & 5 deletions src/librustc_back/target/arm_unknown_linux_gnueabihf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ use target::{Target, TargetOptions};
pub fn target() -> Target {
let base = super::linux_base::opts();
Target {
data_layout: "e-p:32:32:32\
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
-f32:32:32-f64:64:64\
-v64:64:64-v128:64:128\
-a:0:64-n32".to_string(),
llvm_target: "arm-unknown-linux-gnueabihf".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
Expand Down
1 change: 0 additions & 1 deletion src/librustc_back/target/armv7_apple_ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use super::apple_ios_base::{opts, Arch};

pub fn target() -> Target {
Target {
data_layout: "e-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(),
llvm_target: "armv7-apple-ios".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
Expand Down
1 change: 0 additions & 1 deletion src/librustc_back/target/armv7s_apple_ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use super::apple_ios_base::{opts, Arch};

pub fn target() -> Target {
Target {
data_layout: "e-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(),
llvm_target: "armv7s-apple-ios".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/bitrig_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub fn opts() -> TargetOptions {
position_independent_executables: true,
pre_link_args: vec!(
),
archive_format: "bsd".to_string(),

.. Default::default()
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc_back/target/dragonfly_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub fn opts() -> TargetOptions {
"-Wl,--as-needed".to_string(),
),
position_independent_executables: true,
archive_format: "bsd".to_string(),
.. Default::default()
}
}
1 change: 1 addition & 0 deletions src/librustc_back/target/freebsd_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub fn opts() -> TargetOptions {
executables: true,
morestack: true,
has_rpath: true,
archive_format: "bsd".to_string(),

.. Default::default()
}
Expand Down
5 changes: 0 additions & 5 deletions src/librustc_back/target/i386_apple_ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ use super::apple_ios_base::{opts, Arch};

pub fn target() -> Target {
Target {
data_layout: "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16\
-i32:32:32-i64:32:64\
-f32:32:32-f64:32:64-v64:64:64\
-v128:128:128-a:0:64-f80:128:128\
-n8:16:32".to_string(),
llvm_target: "i386-apple-ios".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
Expand Down
5 changes: 0 additions & 5 deletions src/librustc_back/target/i686_apple_darwin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ pub fn target() -> Target {
base.pre_link_args.push("-m32".to_string());

Target {
data_layout: "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16\
-i32:32:32-i64:32:64\
-f32:32:32-f64:32:64-v64:64:64\
-v128:128:128-a:0:64-f80:128:128\
-n8:16:32".to_string(),
llvm_target: "i686-apple-darwin".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
Expand Down
1 change: 0 additions & 1 deletion src/librustc_back/target/i686_pc_windows_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub fn target() -> Target {
options.pre_link_args.push("-shared-libgcc".to_string());

Target {
data_layout: "e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32".to_string(),
llvm_target: "i686-pc-windows-gnu".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
Expand Down
Loading

0 comments on commit d4432b3

Please sign in to comment.