-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_codegen_llvm/abi.rs rustc-1.37.0-src/src/librustc_codegen_llvm/abi.rs
old
|
new
|
trait ArgAttributeExt {
|
34 | 34 | impl ArgAttributeExt for ArgAttribute { |
35 | 35 | fn for_each_kind<F>(&self, mut f: F) where F: FnMut(llvm::Attribute) { |
36 | 36 | for_each_kind!(self, f, |
37 | | ByVal, NoAlias, NoCapture, NonNull, ReadOnly, SExt, StructRet, ZExt, InReg) |
| 37 | NoAlias, NoCapture, NonNull, ReadOnly, SExt, StructRet, ZExt, InReg) |
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | 41 | pub trait ArgAttributesExt { |
42 | | fn apply_llfn(&self, idx: AttributePlace, llfn: &Value); |
43 | | fn apply_callsite(&self, idx: AttributePlace, callsite: &Value); |
| 42 | fn apply_llfn(&self, idx: AttributePlace, llfn: &Value, ty: Option<&Type>); |
| 43 | fn apply_callsite(&self, idx: AttributePlace, callsite: &Value, ty: Option<&Type>); |
44 | 44 | } |
45 | 45 | |
46 | 46 | impl ArgAttributesExt for ArgAttributes { |
47 | | fn apply_llfn(&self, idx: AttributePlace, llfn: &Value) { |
| 47 | fn apply_llfn(&self, idx: AttributePlace, llfn: &Value, ty: Option<&Type>) { |
48 | 48 | let mut regular = self.regular; |
49 | 49 | unsafe { |
50 | 50 | let deref = self.pointee_size.bytes(); |
… |
… |
impl ArgAttributesExt for ArgAttributes
|
65 | 65 | idx.as_uint(), |
66 | 66 | align.bytes() as u32); |
67 | 67 | } |
| 68 | if regular.contains(ArgAttribute::ByVal) { |
| 69 | llvm::LLVMRustAddByValAttr(llfn, idx.as_uint(), ty.unwrap()); |
| 70 | } |
68 | 71 | regular.for_each_kind(|attr| attr.apply_llfn(idx, llfn)); |
69 | 72 | } |
70 | 73 | } |
71 | 74 | |
72 | | fn apply_callsite(&self, idx: AttributePlace, callsite: &Value) { |
| 75 | fn apply_callsite(&self, idx: AttributePlace, callsite: &Value, ty: Option<&Type>) { |
73 | 76 | let mut regular = self.regular; |
74 | 77 | unsafe { |
75 | 78 | let deref = self.pointee_size.bytes(); |
… |
… |
impl ArgAttributesExt for ArgAttributes
|
90 | 93 | idx.as_uint(), |
91 | 94 | align.bytes() as u32); |
92 | 95 | } |
| 96 | if regular.contains(ArgAttribute::ByVal) { |
| 97 | llvm::LLVMRustAddByValCallSiteAttr(callsite, idx.as_uint(), ty.unwrap()); |
| 98 | } |
93 | 99 | regular.for_each_kind(|attr| attr.apply_callsite(idx, callsite)); |
94 | 100 | } |
95 | 101 | } |
… |
… |
pub trait FnTypeLlvmExt<'tcx> {
|
298 | 304 | fn llvm_type(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type; |
299 | 305 | fn ptr_to_llvm_type(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type; |
300 | 306 | fn llvm_cconv(&self) -> llvm::CallConv; |
301 | | fn apply_attrs_llfn(&self, llfn: &'ll Value); |
| 307 | fn apply_attrs_llfn(&self, cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value); |
302 | 308 | fn apply_attrs_callsite(&self, bx: &mut Builder<'a, 'll, 'tcx>, callsite: &'ll Value); |
303 | 309 | } |
304 | 310 | |
… |
… |
impl<'tcx> FnTypeLlvmExt<'tcx> for FnTyp
|
384 | 390 | } |
385 | 391 | } |
386 | 392 | |
387 | | fn apply_attrs_llfn(&self, llfn: &'ll Value) { |
| 393 | fn apply_attrs_llfn(&self, cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value) { |
388 | 394 | let mut i = 0; |
389 | | let mut apply = |attrs: &ArgAttributes| { |
390 | | attrs.apply_llfn(llvm::AttributePlace::Argument(i), llfn); |
| 395 | let mut apply = |attrs: &ArgAttributes, ty: Option<&Type>| { |
| 396 | attrs.apply_llfn(llvm::AttributePlace::Argument(i), llfn, ty); |
391 | 397 | i += 1; |
392 | 398 | }; |
393 | 399 | match self.ret.mode { |
394 | 400 | PassMode::Direct(ref attrs) => { |
395 | | attrs.apply_llfn(llvm::AttributePlace::ReturnValue, llfn); |
| 401 | attrs.apply_llfn(llvm::AttributePlace::ReturnValue, llfn, None); |
396 | 402 | } |
397 | | PassMode::Indirect(ref attrs, _) => apply(attrs), |
| 403 | PassMode::Indirect(ref attrs, _) => apply(attrs, Some(self.ret.layout.llvm_type(cx))), |
398 | 404 | _ => {} |
399 | 405 | } |
400 | 406 | for arg in &self.args { |
401 | 407 | if arg.pad.is_some() { |
402 | | apply(&ArgAttributes::new()); |
| 408 | apply(&ArgAttributes::new(), None); |
403 | 409 | } |
404 | 410 | match arg.mode { |
405 | 411 | PassMode::Ignore(_) => {} |
406 | 412 | PassMode::Direct(ref attrs) | |
407 | | PassMode::Indirect(ref attrs, None) => apply(attrs), |
| 413 | PassMode::Indirect(ref attrs, None) => apply(attrs, Some(arg.layout.llvm_type(cx))), |
408 | 414 | PassMode::Indirect(ref attrs, Some(ref extra_attrs)) => { |
409 | | apply(attrs); |
410 | | apply(extra_attrs); |
| 415 | apply(attrs, None); |
| 416 | apply(extra_attrs, None); |
411 | 417 | } |
412 | 418 | PassMode::Pair(ref a, ref b) => { |
413 | | apply(a); |
414 | | apply(b); |
| 419 | apply(a, None); |
| 420 | apply(b, None); |
415 | 421 | } |
416 | | PassMode::Cast(_) => apply(&ArgAttributes::new()), |
| 422 | PassMode::Cast(_) => apply(&ArgAttributes::new(), None), |
417 | 423 | } |
418 | 424 | } |
419 | 425 | } |
420 | 426 | |
421 | 427 | fn apply_attrs_callsite(&self, bx: &mut Builder<'a, 'll, 'tcx>, callsite: &'ll Value) { |
422 | 428 | let mut i = 0; |
423 | | let mut apply = |attrs: &ArgAttributes| { |
424 | | attrs.apply_callsite(llvm::AttributePlace::Argument(i), callsite); |
| 429 | let mut apply = |attrs: &ArgAttributes, ty: Option<&Type>| { |
| 430 | attrs.apply_callsite(llvm::AttributePlace::Argument(i), callsite, ty); |
425 | 431 | i += 1; |
426 | 432 | }; |
427 | 433 | match self.ret.mode { |
428 | 434 | PassMode::Direct(ref attrs) => { |
429 | | attrs.apply_callsite(llvm::AttributePlace::ReturnValue, callsite); |
| 435 | attrs.apply_callsite(llvm::AttributePlace::ReturnValue, callsite, None); |
430 | 436 | } |
431 | | PassMode::Indirect(ref attrs, _) => apply(attrs), |
| 437 | PassMode::Indirect(ref attrs, _) => apply(attrs, Some(self.ret.layout.llvm_type(bx))), |
432 | 438 | _ => {} |
433 | 439 | } |
434 | 440 | if let layout::Abi::Scalar(ref scalar) = self.ret.layout.abi { |
… |
… |
impl<'tcx> FnTypeLlvmExt<'tcx> for FnTyp
|
446 | 452 | } |
447 | 453 | for arg in &self.args { |
448 | 454 | if arg.pad.is_some() { |
449 | | apply(&ArgAttributes::new()); |
| 455 | apply(&ArgAttributes::new(), None); |
450 | 456 | } |
451 | 457 | match arg.mode { |
452 | 458 | PassMode::Ignore(_) => {} |
453 | 459 | PassMode::Direct(ref attrs) | |
454 | | PassMode::Indirect(ref attrs, None) => apply(attrs), |
| 460 | PassMode::Indirect(ref attrs, None) => apply(attrs, Some(arg.layout.llvm_type(bx))), |
455 | 461 | PassMode::Indirect(ref attrs, Some(ref extra_attrs)) => { |
456 | | apply(attrs); |
457 | | apply(extra_attrs); |
| 462 | apply(attrs, None); |
| 463 | apply(extra_attrs, None); |
458 | 464 | } |
459 | 465 | PassMode::Pair(ref a, ref b) => { |
460 | | apply(a); |
461 | | apply(b); |
| 466 | apply(a, None); |
| 467 | apply(b, None); |
462 | 468 | } |
463 | | PassMode::Cast(_) => apply(&ArgAttributes::new()), |
| 469 | PassMode::Cast(_) => apply(&ArgAttributes::new(), None), |
464 | 470 | } |
465 | 471 | } |
466 | 472 | |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_codegen_llvm/attributes.rs rustc-1.37.0-src/src/librustc_codegen_llvm/attributes.rs
old
|
new
|
pub fn set_probestack(cx: &CodegenCx<'ll
|
119 | 119 | const_cstr!("probe-stack"), const_cstr!("__rust_probestack")); |
120 | 120 | } |
121 | 121 | |
| 122 | fn translate_obsolete_target_features(feature: &str) -> &str { |
| 123 | const LLVM9_FEATURE_CHANGES: &[(&str, &str)] = &[ |
| 124 | ("+fp-only-sp", "-fp64"), |
| 125 | ("-fp-only-sp", "+fp64"), |
| 126 | ("+d16", "-d32"), |
| 127 | ("-d16", "+d32"), |
| 128 | ]; |
| 129 | if llvm_util::get_major_version() >= 9 { |
| 130 | for &(old, new) in LLVM9_FEATURE_CHANGES { |
| 131 | if feature == old { |
| 132 | return new; |
| 133 | } |
| 134 | } |
| 135 | } else { |
| 136 | for &(old, new) in LLVM9_FEATURE_CHANGES { |
| 137 | if feature == new { |
| 138 | return old; |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | feature |
| 143 | } |
| 144 | |
122 | 145 | pub fn llvm_target_features(sess: &Session) -> impl Iterator<Item = &str> { |
123 | 146 | const RUSTC_SPECIFIC_FEATURES: &[&str] = &[ |
124 | 147 | "crt-static", |
… |
… |
pub fn llvm_target_features(sess: &Sessi
|
129 | 152 | sess.target.target.options.features.split(',') |
130 | 153 | .chain(cmdline) |
131 | 154 | .filter(|l| !l.is_empty()) |
| 155 | .map(translate_obsolete_target_features) |
132 | 156 | } |
133 | 157 | |
134 | 158 | pub fn apply_target_cpu_attr(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) { |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_codegen_llvm/common.rs rustc-1.37.0-src/src/librustc_codegen_llvm/common.rs
old
|
new
|
impl ConstMethods<'tcx> for CodegenCx<'l
|
249 | 249 | self.const_uint(self.type_i8(), i as u64) |
250 | 250 | } |
251 | 251 | |
| 252 | fn const_real(&self, t: &'ll Type, val: f64) -> &'ll Value { |
| 253 | unsafe { llvm::LLVMConstReal(t, val) } |
| 254 | } |
| 255 | |
252 | 256 | fn const_struct( |
253 | 257 | &self, |
254 | 258 | elts: &[&'ll Value], |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_codegen_llvm/context.rs rustc-1.37.0-src/src/librustc_codegen_llvm/context.rs
old
|
new
|
|
1 | 1 | use crate::attributes; |
2 | 2 | use crate::llvm; |
| 3 | use crate::llvm_util; |
3 | 4 | use crate::debuginfo; |
4 | 5 | use crate::value::Value; |
5 | 6 | use rustc::dep_graph::DepGraphSafe; |
… |
… |
pub fn is_pie_binary(sess: &Session) ->
|
140 | 141 | !is_any_library(sess) && get_reloc_model(sess) == llvm::RelocMode::PIC |
141 | 142 | } |
142 | 143 | |
| 144 | fn strip_function_ptr_alignment(data_layout: String) -> String { |
| 145 | // FIXME: Make this more general. |
| 146 | data_layout.replace("-Fi8-", "-") |
| 147 | } |
| 148 | |
143 | 149 | pub unsafe fn create_module( |
144 | 150 | tcx: TyCtxt<'_>, |
145 | 151 | llcx: &'ll llvm::Context, |
… |
… |
pub unsafe fn create_module(
|
149 | 155 | let mod_name = SmallCStr::new(mod_name); |
150 | 156 | let llmod = llvm::LLVMModuleCreateWithNameInContext(mod_name.as_ptr(), llcx); |
151 | 157 | |
| 158 | let mut target_data_layout = sess.target.target.data_layout.clone(); |
| 159 | if llvm_util::get_major_version() < 9 { |
| 160 | target_data_layout = strip_function_ptr_alignment(target_data_layout); |
| 161 | } |
| 162 | |
152 | 163 | // Ensure the data-layout values hardcoded remain the defaults. |
153 | 164 | if sess.target.target.options.is_builtin { |
154 | 165 | let tm = crate::back::write::create_informational_target_machine(&tcx.sess, false); |
155 | 166 | llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, tm); |
156 | 167 | llvm::LLVMRustDisposeTargetMachine(tm); |
157 | 168 | |
158 | | let data_layout = llvm::LLVMGetDataLayout(llmod); |
159 | | let data_layout = str::from_utf8(CStr::from_ptr(data_layout).to_bytes()) |
| 169 | let llvm_data_layout = llvm::LLVMGetDataLayout(llmod); |
| 170 | let llvm_data_layout = str::from_utf8(CStr::from_ptr(llvm_data_layout).to_bytes()) |
160 | 171 | .ok().expect("got a non-UTF8 data-layout from LLVM"); |
161 | 172 | |
162 | 173 | // Unfortunately LLVM target specs change over time, and right now we |
… |
… |
pub unsafe fn create_module(
|
177 | 188 | let cfg_llvm_root = option_env!("CFG_LLVM_ROOT").unwrap_or(""); |
178 | 189 | let custom_llvm_used = cfg_llvm_root.trim() != ""; |
179 | 190 | |
180 | | if !custom_llvm_used && sess.target.target.data_layout != data_layout { |
| 191 | if !custom_llvm_used && target_data_layout != llvm_data_layout { |
181 | 192 | bug!("data-layout for builtin `{}` target, `{}`, \ |
182 | 193 | differs from LLVM default, `{}`", |
183 | 194 | sess.target.target.llvm_target, |
184 | | sess.target.target.data_layout, |
185 | | data_layout); |
| 195 | target_data_layout, |
| 196 | llvm_data_layout); |
186 | 197 | } |
187 | 198 | } |
188 | 199 | |
189 | | let data_layout = SmallCStr::new(&sess.target.target.data_layout); |
| 200 | let data_layout = SmallCStr::new(&target_data_layout); |
190 | 201 | llvm::LLVMSetDataLayout(llmod, data_layout.as_ptr()); |
191 | 202 | |
192 | 203 | let llvm_target = SmallCStr::new(&sess.target.target.llvm_target); |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_codegen_llvm/declare.rs rustc-1.37.0-src/src/librustc_codegen_llvm/declare.rs
old
|
new
|
impl DeclareMethods<'tcx> for CodegenCx<
|
107 | 107 | llvm::Attribute::NoReturn.apply_llfn(Function, llfn); |
108 | 108 | } |
109 | 109 | |
110 | | fty.apply_attrs_llfn(llfn); |
| 110 | fty.apply_attrs_llfn(self, llfn); |
111 | 111 | |
112 | 112 | llfn |
113 | 113 | } |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_codegen_llvm/intrinsic.rs rustc-1.37.0-src/src/librustc_codegen_llvm/intrinsic.rs
old
|
new
|
fn generic_simd_intrinsic(
|
1663 | 1663 | acc |
1664 | 1664 | } else { |
1665 | 1665 | // unordered arithmetic reductions do not: |
| 1666 | let identity_acc = if $name.contains("mul") { 1.0 } else { 0.0 }; |
1666 | 1667 | match f.bit_width() { |
1667 | | 32 => bx.const_undef(bx.type_f32()), |
1668 | | 64 => bx.const_undef(bx.type_f64()), |
| 1668 | 32 => bx.const_real(bx.type_f32(), identity_acc), |
| 1669 | 64 => bx.const_real(bx.type_f64(), identity_acc), |
1669 | 1670 | v => { |
1670 | 1671 | return_error!(r#" |
1671 | 1672 | unsupported {} from `{}` with element `{}` of size `{}` to `{}`"#, |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_codegen_llvm/llvm/ffi.rs rustc-1.37.0-src/src/librustc_codegen_llvm/llvm/ffi.rs
old
|
new
|
extern "C" {
|
715 | 715 | // Operations on scalar constants |
716 | 716 | pub fn LLVMConstInt(IntTy: &Type, N: c_ulonglong, SignExtend: Bool) -> &Value; |
717 | 717 | pub fn LLVMConstIntOfArbitraryPrecision(IntTy: &Type, Wn: c_uint, Ws: *const u64) -> &Value; |
| 718 | pub fn LLVMConstReal(RealTy: &Type, N: f64) -> &Value; |
718 | 719 | pub fn LLVMConstIntGetZExtValue(ConstantVal: &Value) -> c_ulonglong; |
719 | 720 | pub fn LLVMRustConstInt128Get(ConstantVal: &Value, SExt: bool, |
720 | 721 | high: &mut u64, low: &mut u64) -> bool; |
… |
… |
extern "C" {
|
794 | 795 | pub fn LLVMRustAddAlignmentAttr(Fn: &Value, index: c_uint, bytes: u32); |
795 | 796 | pub fn LLVMRustAddDereferenceableAttr(Fn: &Value, index: c_uint, bytes: u64); |
796 | 797 | pub fn LLVMRustAddDereferenceableOrNullAttr(Fn: &Value, index: c_uint, bytes: u64); |
| 798 | pub fn LLVMRustAddByValAttr(Fn: &Value, index: c_uint, ty: &Type); |
797 | 799 | pub fn LLVMRustAddFunctionAttribute(Fn: &Value, index: c_uint, attr: Attribute); |
798 | 800 | pub fn LLVMRustAddFunctionAttrStringValue(Fn: &Value, |
799 | 801 | index: c_uint, |
… |
… |
extern "C" {
|
824 | 826 | pub fn LLVMRustAddDereferenceableOrNullCallSiteAttr(Instr: &Value, |
825 | 827 | index: c_uint, |
826 | 828 | bytes: u64); |
| 829 | pub fn LLVMRustAddByValCallSiteAttr(Instr: &Value, index: c_uint, ty: &Type); |
827 | 830 | |
828 | 831 | // Operations on load/store instructions (only) |
829 | 832 | pub fn LLVMSetVolatile(MemoryAccessInst: &Value, volatile: Bool); |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_codegen_ssa/traits/consts.rs rustc-1.37.0-src/src/librustc_codegen_ssa/traits/consts.rs
old
|
new
|
pub trait ConstMethods<'tcx>: BackendTyp
|
17 | 17 | fn const_u64(&self, i: u64) -> Self::Value; |
18 | 18 | fn const_usize(&self, i: u64) -> Self::Value; |
19 | 19 | fn const_u8(&self, i: u8) -> Self::Value; |
| 20 | fn const_real(&self, t: Self::Type, val: f64) -> Self::Value; |
20 | 21 | |
21 | 22 | fn const_struct(&self, elts: &[Self::Value], packed: bool) -> Self::Value; |
22 | 23 | |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armebv7r_none_eabihf.rs rustc-1.37.0-src/src/librustc_target/spec/armebv7r_none_eabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
9 | 9 | target_endian: "big".to_string(), |
10 | 10 | target_pointer_width: "32".to_string(), |
11 | 11 | target_c_int_width: "32".to_string(), |
12 | | data_layout: "E-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 12 | data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
13 | 13 | arch: "arm".to_string(), |
14 | 14 | target_os: "none".to_string(), |
15 | 15 | target_env: String::new(), |
… |
… |
pub fn target() -> TargetResult {
|
21 | 21 | linker: Some("rust-lld".to_owned()), |
22 | 22 | relocation_model: "static".to_string(), |
23 | 23 | panic_strategy: PanicStrategy::Abort, |
24 | | features: "+vfp3,+d16,+fp-only-sp".to_string(), |
| 24 | features: "+vfp3,-d32,-fp16".to_string(), |
25 | 25 | max_atomic_width: Some(32), |
26 | 26 | abi_blacklist: super::arm_base::abi_blacklist(), |
27 | 27 | emit_debug_gdb_scripts: false, |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armebv7r_none_eabi.rs rustc-1.37.0-src/src/librustc_target/spec/armebv7r_none_eabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
9 | 9 | target_endian: "big".to_string(), |
10 | 10 | target_pointer_width: "32".to_string(), |
11 | 11 | target_c_int_width: "32".to_string(), |
12 | | data_layout: "E-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 12 | data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
13 | 13 | arch: "arm".to_string(), |
14 | 14 | target_os: "none".to_string(), |
15 | 15 | target_env: "".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/arm_linux_androideabi.rs rustc-1.37.0-src/src/librustc_target/spec/arm_linux_androideabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
11 | 11 | target_endian: "little".to_string(), |
12 | 12 | target_pointer_width: "32".to_string(), |
13 | 13 | target_c_int_width: "32".to_string(), |
14 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 14 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
15 | 15 | arch: "arm".to_string(), |
16 | 16 | target_os: "android".to_string(), |
17 | 17 | target_env: String::new(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/arm_unknown_linux_gnueabihf.rs rustc-1.37.0-src/src/librustc_target/spec/arm_unknown_linux_gnueabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
8 | 8 | target_endian: "little".to_string(), |
9 | 9 | target_pointer_width: "32".to_string(), |
10 | 10 | target_c_int_width: "32".to_string(), |
11 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 11 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
12 | 12 | arch: "arm".to_string(), |
13 | 13 | target_os: "linux".to_string(), |
14 | 14 | target_env: "gnu".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/arm_unknown_linux_gnueabi.rs rustc-1.37.0-src/src/librustc_target/spec/arm_unknown_linux_gnueabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
8 | 8 | target_endian: "little".to_string(), |
9 | 9 | target_pointer_width: "32".to_string(), |
10 | 10 | target_c_int_width: "32".to_string(), |
11 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 11 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
12 | 12 | arch: "arm".to_string(), |
13 | 13 | target_os: "linux".to_string(), |
14 | 14 | target_env: "gnu".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/arm_unknown_linux_musleabihf.rs rustc-1.37.0-src/src/librustc_target/spec/arm_unknown_linux_musleabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
15 | 15 | target_endian: "little".to_string(), |
16 | 16 | target_pointer_width: "32".to_string(), |
17 | 17 | target_c_int_width: "32".to_string(), |
18 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 18 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
19 | 19 | arch: "arm".to_string(), |
20 | 20 | target_os: "linux".to_string(), |
21 | 21 | target_env: "musl".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/arm_unknown_linux_musleabi.rs rustc-1.37.0-src/src/librustc_target/spec/arm_unknown_linux_musleabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
15 | 15 | target_endian: "little".to_string(), |
16 | 16 | target_pointer_width: "32".to_string(), |
17 | 17 | target_c_int_width: "32".to_string(), |
18 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 18 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
19 | 19 | arch: "arm".to_string(), |
20 | 20 | target_os: "linux".to_string(), |
21 | 21 | target_env: "musl".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv4t_unknown_linux_gnueabi.rs rustc-1.37.0-src/src/librustc_target/spec/armv4t_unknown_linux_gnueabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
7 | 7 | target_endian: "little".to_string(), |
8 | 8 | target_pointer_width: "32".to_string(), |
9 | 9 | target_c_int_width: "32".to_string(), |
10 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 10 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
11 | 11 | arch: "arm".to_string(), |
12 | 12 | target_os: "linux".to_string(), |
13 | 13 | target_env: "gnu".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv5te_unknown_linux_gnueabi.rs rustc-1.37.0-src/src/librustc_target/spec/armv5te_unknown_linux_gnueabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
7 | 7 | target_endian: "little".to_string(), |
8 | 8 | target_pointer_width: "32".to_string(), |
9 | 9 | target_c_int_width: "32".to_string(), |
10 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 10 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32:S64".to_string(), |
11 | 11 | arch: "arm".to_string(), |
12 | 12 | target_os: "linux".to_string(), |
13 | 13 | target_env: "gnu".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv5te_unknown_linux_musleabi.rs rustc-1.37.0-src/src/librustc_target/spec/armv5te_unknown_linux_musleabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
10 | 10 | target_endian: "little".to_string(), |
11 | 11 | target_pointer_width: "32".to_string(), |
12 | 12 | target_c_int_width: "32".to_string(), |
13 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 13 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
14 | 14 | arch: "arm".to_string(), |
15 | 15 | target_os: "linux".to_string(), |
16 | 16 | target_env: "musl".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv6_unknown_freebsd.rs rustc-1.37.0-src/src/librustc_target/spec/armv6_unknown_freebsd.rs
old
|
new
|
pub fn target() -> TargetResult {
|
7 | 7 | target_endian: "little".to_string(), |
8 | 8 | target_pointer_width: "32".to_string(), |
9 | 9 | target_c_int_width: "32".to_string(), |
10 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 10 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
11 | 11 | arch: "arm".to_string(), |
12 | 12 | target_os: "freebsd".to_string(), |
13 | 13 | target_env: "gnueabihf".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv6_unknown_netbsd_eabihf.rs rustc-1.37.0-src/src/librustc_target/spec/armv6_unknown_netbsd_eabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
8 | 8 | target_endian: "little".to_string(), |
9 | 9 | target_pointer_width: "32".to_string(), |
10 | 10 | target_c_int_width: "32".to_string(), |
11 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 11 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
12 | 12 | arch: "arm".to_string(), |
13 | 13 | target_os: "netbsd".to_string(), |
14 | 14 | target_env: "eabihf".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv7_apple_ios.rs rustc-1.37.0-src/src/librustc_target/spec/armv7_apple_ios.rs
old
|
new
|
pub fn target() -> TargetResult {
|
8 | 8 | target_endian: "little".to_string(), |
9 | 9 | target_pointer_width: "32".to_string(), |
10 | 10 | target_c_int_width: "32".to_string(), |
11 | | data_layout: "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(), |
| 11 | data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(), |
12 | 12 | arch: "arm".to_string(), |
13 | 13 | target_os: "ios".to_string(), |
14 | 14 | target_env: String::new(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv7_linux_androideabi.rs rustc-1.37.0-src/src/librustc_target/spec/armv7_linux_androideabi.rs
old
|
new
|
use crate::spec::{LinkerFlavor, Target,
|
10 | 10 | |
11 | 11 | pub fn target() -> TargetResult { |
12 | 12 | let mut base = super::android_base::opts(); |
13 | | base.features = "+v7,+thumb-mode,+thumb2,+vfp3,+d16,-neon".to_string(); |
| 13 | base.features = "+v7,+thumb-mode,+thumb2,+vfp3,-d32,-neon".to_string(); |
14 | 14 | base.max_atomic_width = Some(64); |
15 | 15 | base.pre_link_args |
16 | 16 | .get_mut(&LinkerFlavor::Gcc).unwrap().push("-march=armv7-a".to_string()); |
… |
… |
pub fn target() -> TargetResult {
|
20 | 20 | target_endian: "little".to_string(), |
21 | 21 | target_pointer_width: "32".to_string(), |
22 | 22 | target_c_int_width: "32".to_string(), |
23 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 23 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
24 | 24 | arch: "arm".to_string(), |
25 | 25 | target_os: "android".to_string(), |
26 | 26 | target_env: String::new(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv7r_none_eabihf.rs rustc-1.37.0-src/src/librustc_target/spec/armv7r_none_eabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
9 | 9 | target_endian: "little".to_string(), |
10 | 10 | target_pointer_width: "32".to_string(), |
11 | 11 | target_c_int_width: "32".to_string(), |
12 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 12 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
13 | 13 | arch: "arm".to_string(), |
14 | 14 | target_os: "none".to_string(), |
15 | 15 | target_env: "".to_string(), |
… |
… |
pub fn target() -> TargetResult {
|
21 | 21 | linker: Some("rust-lld".to_owned()), |
22 | 22 | relocation_model: "static".to_string(), |
23 | 23 | panic_strategy: PanicStrategy::Abort, |
24 | | features: "+vfp3,+d16,+fp-only-sp".to_string(), |
| 24 | features: "+vfp3,-d32,-fp16".to_string(), |
25 | 25 | max_atomic_width: Some(32), |
26 | 26 | abi_blacklist: super::arm_base::abi_blacklist(), |
27 | 27 | emit_debug_gdb_scripts: false, |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv7r_none_eabi.rs rustc-1.37.0-src/src/librustc_target/spec/armv7r_none_eabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
9 | 9 | target_endian: "little".to_string(), |
10 | 10 | target_pointer_width: "32".to_string(), |
11 | 11 | target_c_int_width: "32".to_string(), |
12 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 12 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
13 | 13 | arch: "arm".to_string(), |
14 | 14 | target_os: "none".to_string(), |
15 | 15 | target_env: "".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv7s_apple_ios.rs rustc-1.37.0-src/src/librustc_target/spec/armv7s_apple_ios.rs
old
|
new
|
pub fn target() -> TargetResult {
|
8 | 8 | target_endian: "little".to_string(), |
9 | 9 | target_pointer_width: "32".to_string(), |
10 | 10 | target_c_int_width: "32".to_string(), |
11 | | data_layout: "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(), |
| 11 | data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".to_string(), |
12 | 12 | arch: "arm".to_string(), |
13 | 13 | target_os: "ios".to_string(), |
14 | 14 | target_env: String::new(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv7_unknown_cloudabi_eabihf.rs rustc-1.37.0-src/src/librustc_target/spec/armv7_unknown_cloudabi_eabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
13 | 13 | target_endian: "little".to_string(), |
14 | 14 | target_pointer_width: "32".to_string(), |
15 | 15 | target_c_int_width: "32".to_string(), |
16 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 16 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
17 | 17 | arch: "arm".to_string(), |
18 | 18 | target_os: "cloudabi".to_string(), |
19 | 19 | target_env: String::new(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv7_unknown_freebsd.rs rustc-1.37.0-src/src/librustc_target/spec/armv7_unknown_freebsd.rs
old
|
new
|
pub fn target() -> TargetResult {
|
7 | 7 | target_endian: "little".to_string(), |
8 | 8 | target_pointer_width: "32".to_string(), |
9 | 9 | target_c_int_width: "32".to_string(), |
10 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 10 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
11 | 11 | arch: "arm".to_string(), |
12 | 12 | target_os: "freebsd".to_string(), |
13 | 13 | target_env: "gnueabihf".to_string(), |
… |
… |
pub fn target() -> TargetResult {
|
15 | 15 | linker_flavor: LinkerFlavor::Gcc, |
16 | 16 | |
17 | 17 | options: TargetOptions { |
18 | | features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(), |
| 18 | features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(), |
19 | 19 | max_atomic_width: Some(64), |
20 | 20 | abi_blacklist: super::arm_base::abi_blacklist(), |
21 | 21 | target_mcount: "\u{1}__gnu_mcount_nc".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv7_unknown_linux_gnueabihf.rs rustc-1.37.0-src/src/librustc_target/spec/armv7_unknown_linux_gnueabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
10 | 10 | target_endian: "little".to_string(), |
11 | 11 | target_pointer_width: "32".to_string(), |
12 | 12 | target_c_int_width: "32".to_string(), |
13 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 13 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
14 | 14 | arch: "arm".to_string(), |
15 | 15 | target_os: "linux".to_string(), |
16 | 16 | target_env: "gnu".to_string(), |
… |
… |
pub fn target() -> TargetResult {
|
19 | 19 | |
20 | 20 | options: TargetOptions { |
21 | 21 | // Info about features at https://wiki.debian.org/ArmHardFloatPort |
22 | | features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(), |
| 22 | features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(), |
23 | 23 | cpu: "generic".to_string(), |
24 | 24 | max_atomic_width: Some(64), |
25 | 25 | abi_blacklist: super::arm_base::abi_blacklist(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv7_unknown_linux_musleabihf.rs rustc-1.37.0-src/src/librustc_target/spec/armv7_unknown_linux_musleabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
12 | 12 | target_endian: "little".to_string(), |
13 | 13 | target_pointer_width: "32".to_string(), |
14 | 14 | target_c_int_width: "32".to_string(), |
15 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 15 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
16 | 16 | arch: "arm".to_string(), |
17 | 17 | target_os: "linux".to_string(), |
18 | 18 | target_env: "musl".to_string(), |
… |
… |
pub fn target() -> TargetResult {
|
22 | 22 | // Most of these settings are copied from the armv7_unknown_linux_gnueabihf |
23 | 23 | // target. |
24 | 24 | options: TargetOptions { |
25 | | features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(), |
| 25 | features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(), |
26 | 26 | cpu: "generic".to_string(), |
27 | 27 | max_atomic_width: Some(64), |
28 | 28 | abi_blacklist: super::arm_base::abi_blacklist(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/armv7_unknown_netbsd_eabihf.rs rustc-1.37.0-src/src/librustc_target/spec/armv7_unknown_netbsd_eabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
7 | 7 | target_endian: "little".to_string(), |
8 | 8 | target_pointer_width: "32".to_string(), |
9 | 9 | target_c_int_width: "32".to_string(), |
10 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 10 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
11 | 11 | arch: "arm".to_string(), |
12 | 12 | target_os: "netbsd".to_string(), |
13 | 13 | target_env: "eabihf".to_string(), |
… |
… |
pub fn target() -> TargetResult {
|
15 | 15 | linker_flavor: LinkerFlavor::Gcc, |
16 | 16 | |
17 | 17 | options: TargetOptions { |
18 | | features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(), |
| 18 | features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(), |
19 | 19 | cpu: "generic".to_string(), |
20 | 20 | max_atomic_width: Some(64), |
21 | 21 | abi_blacklist: super::arm_base::abi_blacklist(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/thumbv6m_none_eabi.rs rustc-1.37.0-src/src/librustc_target/spec/thumbv6m_none_eabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
8 | 8 | target_endian: "little".to_string(), |
9 | 9 | target_pointer_width: "32".to_string(), |
10 | 10 | target_c_int_width: "32".to_string(), |
11 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 11 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
12 | 12 | arch: "arm".to_string(), |
13 | 13 | target_os: "none".to_string(), |
14 | 14 | target_env: String::new(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/thumbv7a_pc_windows_msvc.rs rustc-1.37.0-src/src/librustc_target/spec/thumbv7a_pc_windows_msvc.rs
old
|
new
|
pub fn target() -> TargetResult {
|
22 | 22 | target_endian: "little".to_string(), |
23 | 23 | target_pointer_width: "32".to_string(), |
24 | 24 | target_c_int_width: "32".to_string(), |
25 | | data_layout: "e-m:w-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 25 | data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
26 | 26 | arch: "arm".to_string(), |
27 | 27 | target_os: "windows".to_string(), |
28 | 28 | target_env: "msvc".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/thumbv7em_none_eabihf.rs rustc-1.37.0-src/src/librustc_target/spec/thumbv7em_none_eabihf.rs
old
|
new
|
|
6 | 6 | // Additionally, this target uses the "hard" floating convention (ABI) where floating point values |
7 | 7 | // are passed to/from subroutines via FPU registers (S0, S1, D0, D1, etc.). |
8 | 8 | // |
9 | | // To opt into double precision hardware support, use the `-C target-feature=-fp-only-sp` flag. |
| 9 | // To opt into double precision hardware support, use the `-C target-feature=+fp64` flag. |
10 | 10 | |
11 | 11 | use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult}; |
12 | 12 | |
… |
… |
pub fn target() -> TargetResult {
|
16 | 16 | target_endian: "little".to_string(), |
17 | 17 | target_pointer_width: "32".to_string(), |
18 | 18 | target_c_int_width: "32".to_string(), |
19 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 19 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
20 | 20 | arch: "arm".to_string(), |
21 | 21 | target_os: "none".to_string(), |
22 | 22 | target_env: String::new(), |
… |
… |
pub fn target() -> TargetResult {
|
26 | 26 | options: TargetOptions { |
27 | 27 | // `+vfp4` is the lowest common denominator between the Cortex-M4 (vfp4-16) and the |
28 | 28 | // Cortex-M7 (vfp5) |
29 | | // `+d16` both the Cortex-M4 and the Cortex-M7 only have 16 double-precision registers |
| 29 | // `-d32` both the Cortex-M4 and the Cortex-M7 only have 16 double-precision registers |
30 | 30 | // available |
31 | | // `+fp-only-sp` The Cortex-M4 only supports single precision floating point operations |
| 31 | // `-fp64` The Cortex-M4 only supports single precision floating point operations |
32 | 32 | // whereas in the Cortex-M7 double precision is optional |
33 | 33 | // |
34 | 34 | // Reference: |
35 | 35 | // ARMv7-M Architecture Reference Manual - A2.5 The optional floating-point extension |
36 | | features: "+vfp4,+d16,+fp-only-sp".to_string(), |
| 36 | features: "+vfp4,-d32,-fp64".to_string(), |
37 | 37 | max_atomic_width: Some(32), |
38 | 38 | .. super::thumb_base::opts() |
39 | 39 | } |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/thumbv7em_none_eabi.rs rustc-1.37.0-src/src/librustc_target/spec/thumbv7em_none_eabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
17 | 17 | target_endian: "little".to_string(), |
18 | 18 | target_pointer_width: "32".to_string(), |
19 | 19 | target_c_int_width: "32".to_string(), |
20 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 20 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
21 | 21 | arch: "arm".to_string(), |
22 | 22 | target_os: "none".to_string(), |
23 | 23 | target_env: String::new(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/thumbv7m_none_eabi.rs rustc-1.37.0-src/src/librustc_target/spec/thumbv7m_none_eabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
8 | 8 | target_endian: "little".to_string(), |
9 | 9 | target_pointer_width: "32".to_string(), |
10 | 10 | target_c_int_width: "32".to_string(), |
11 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 11 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
12 | 12 | arch: "arm".to_string(), |
13 | 13 | target_os: "none".to_string(), |
14 | 14 | target_env: String::new(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/thumbv7neon_linux_androideabi.rs rustc-1.37.0-src/src/librustc_target/spec/thumbv7neon_linux_androideabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
20 | 20 | target_endian: "little".to_string(), |
21 | 21 | target_pointer_width: "32".to_string(), |
22 | 22 | target_c_int_width: "32".to_string(), |
23 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 23 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
24 | 24 | arch: "arm".to_string(), |
25 | 25 | target_os: "android".to_string(), |
26 | 26 | target_env: "".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/thumbv7neon_unknown_linux_gnueabihf.rs rustc-1.37.0-src/src/librustc_target/spec/thumbv7neon_unknown_linux_gnueabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
13 | 13 | target_endian: "little".to_string(), |
14 | 14 | target_pointer_width: "32".to_string(), |
15 | 15 | target_c_int_width: "32".to_string(), |
16 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 16 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
17 | 17 | arch: "arm".to_string(), |
18 | 18 | target_os: "linux".to_string(), |
19 | 19 | target_env: "gnu".to_string(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/thumbv8m_base_none_eabi.rs rustc-1.37.0-src/src/librustc_target/spec/thumbv8m_base_none_eabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
8 | 8 | target_endian: "little".to_string(), |
9 | 9 | target_pointer_width: "32".to_string(), |
10 | 10 | target_c_int_width: "32".to_string(), |
11 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 11 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
12 | 12 | arch: "arm".to_string(), |
13 | 13 | target_os: "none".to_string(), |
14 | 14 | target_env: String::new(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/thumbv8m_main_none_eabihf.rs rustc-1.37.0-src/src/librustc_target/spec/thumbv8m_main_none_eabihf.rs
old
|
new
|
pub fn target() -> TargetResult {
|
9 | 9 | target_endian: "little".to_string(), |
10 | 10 | target_pointer_width: "32".to_string(), |
11 | 11 | target_c_int_width: "32".to_string(), |
12 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 12 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
13 | 13 | arch: "arm".to_string(), |
14 | 14 | target_os: "none".to_string(), |
15 | 15 | target_env: String::new(), |
… |
… |
pub fn target() -> TargetResult {
|
22 | 22 | // the FPU uses the FPv5 architecture, single-precision instructions |
23 | 23 | // and 16 D registers. |
24 | 24 | // These parameters map to the following LLVM features. |
25 | | features: "+fp-armv8,+fp-only-sp,+d16".to_string(), |
| 25 | features: "+fp-armv8,-fp64,-d32".to_string(), |
26 | 26 | max_atomic_width: Some(32), |
27 | 27 | .. super::thumb_base::opts() |
28 | 28 | }, |
-
diff -Naurp rustc-1.37.0-src.orig/src/librustc_target/spec/thumbv8m_main_none_eabi.rs rustc-1.37.0-src/src/librustc_target/spec/thumbv8m_main_none_eabi.rs
old
|
new
|
pub fn target() -> TargetResult {
|
9 | 9 | target_endian: "little".to_string(), |
10 | 10 | target_pointer_width: "32".to_string(), |
11 | 11 | target_c_int_width: "32".to_string(), |
12 | | data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 12 | data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
13 | 13 | arch: "arm".to_string(), |
14 | 14 | target_os: "none".to_string(), |
15 | 15 | target_env: String::new(), |
-
diff -Naurp rustc-1.37.0-src.orig/src/rustllvm/PassWrapper.cpp rustc-1.37.0-src/src/rustllvm/PassWrapper.cpp
old
|
new
|
LLVMRustCreateThinLTOData(LLVMRustThinLT
|
913 | 913 | GlobalValue::LinkageTypes NewLinkage) { |
914 | 914 | ResolvedODR[ModuleIdentifier][GUID] = NewLinkage; |
915 | 915 | }; |
916 | | #if LLVM_VERSION_GE(8, 0) |
| 916 | #if LLVM_VERSION_GE(9, 0) |
| 917 | thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage, |
| 918 | Ret->GUIDPreservedSymbols); |
| 919 | #elif LLVM_VERSION_GE(8, 0) |
917 | 920 | thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage); |
918 | 921 | #else |
919 | 922 | thinLTOResolveWeakForLinkerInIndex(Ret->Index, isPrevailing, recordNewLinkage); |
-
diff -Naurp rustc-1.37.0-src.orig/src/rustllvm/RustWrapper.cpp rustc-1.37.0-src/src/rustllvm/RustWrapper.cpp
old
|
new
|
extern "C" void LLVMRustAddDereferenceab
|
237 | 237 | Call->getContext(), Index, B)); |
238 | 238 | } |
239 | 239 | |
| 240 | extern "C" void LLVMRustAddByValCallSiteAttr(LLVMValueRef Instr, unsigned Index, |
| 241 | LLVMTypeRef Ty) { |
| 242 | CallSite Call = CallSite(unwrap<Instruction>(Instr)); |
| 243 | #if LLVM_VERSION_GE(9, 0) |
| 244 | Attribute Attr = Attribute::getWithByValType(Call->getContext(), unwrap(Ty)); |
| 245 | #else |
| 246 | Attribute Attr = Attribute::get(Call->getContext(), Attribute::ByVal); |
| 247 | #endif |
| 248 | Call.addAttribute(Index, Attr); |
| 249 | } |
| 250 | |
240 | 251 | extern "C" void LLVMRustAddFunctionAttribute(LLVMValueRef Fn, unsigned Index, |
241 | 252 | LLVMRustAttribute RustAttr) { |
242 | 253 | Function *A = unwrap<Function>(Fn); |
… |
… |
extern "C" void LLVMRustAddDereferenceab
|
271 | 282 | A->addAttributes(Index, B); |
272 | 283 | } |
273 | 284 | |
| 285 | extern "C" void LLVMRustAddByValAttr(LLVMValueRef Fn, unsigned Index, |
| 286 | LLVMTypeRef Ty) { |
| 287 | Function *F = unwrap<Function>(Fn); |
| 288 | #if LLVM_VERSION_GE(9, 0) |
| 289 | Attribute Attr = Attribute::getWithByValType(F->getContext(), unwrap(Ty)); |
| 290 | #else |
| 291 | Attribute Attr = Attribute::get(F->getContext(), Attribute::ByVal); |
| 292 | #endif |
| 293 | F->addAttribute(Index, Attr); |
| 294 | } |
| 295 | |
274 | 296 | extern "C" void LLVMRustAddFunctionAttrStringValue(LLVMValueRef Fn, |
275 | 297 | unsigned Index, |
276 | 298 | const char *Name, |
-
diff -Naurp rustc-1.37.0-src.orig/src/test/codegen/mainsubprogram.rs rustc-1.37.0-src/src/test/codegen/mainsubprogram.rs
old
|
new
|
|
7 | 7 | // compile-flags: -g -C no-prepopulate-passes |
8 | 8 | |
9 | 9 | // CHECK-LABEL: @main |
10 | | // CHECK: {{.*}}DISubprogram{{.*}}name: "main",{{.*}}DIFlagMainSubprogram{{.*}} |
| 10 | // CHECK: {{.*}}DISubprogram{{.*}}name: "main",{{.*}}DI{{(SP)?}}FlagMainSubprogram{{.*}} |
11 | 11 | |
12 | 12 | pub fn main() { |
13 | 13 | } |
-
diff -Naurp rustc-1.37.0-src.orig/src/test/codegen/mainsubprogramstart.rs rustc-1.37.0-src/src/test/codegen/mainsubprogramstart.rs
old
|
new
|
|
6 | 6 | #![feature(start)] |
7 | 7 | |
8 | 8 | // CHECK-LABEL: @main |
9 | | // CHECK: {{.*}}DISubprogram{{.*}}name: "start",{{.*}}DIFlagMainSubprogram{{.*}} |
| 9 | // CHECK: {{.*}}DISubprogram{{.*}}name: "start",{{.*}}DI{{(SP)?}}FlagMainSubprogram{{.*}} |
10 | 10 | |
11 | 11 | #[start] |
12 | 12 | fn start(_: isize, _: *const *const u8) -> isize { |