Ticket #12958: rustc-1.37.0-llvm9_fixes-1.patch

File rustc-1.37.0-llvm9_fixes-1.patch, 52.0 KB (added by Douglas R. Reno, 4 years ago)
  • src/librustc_codegen_llvm/abi.rs

    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 {  
    3434impl ArgAttributeExt for ArgAttribute {
    3535    fn for_each_kind<F>(&self, mut f: F) where F: FnMut(llvm::Attribute) {
    3636        for_each_kind!(self, f,
    37                        ByVal, NoAlias, NoCapture, NonNull, ReadOnly, SExt, StructRet, ZExt, InReg)
     37                       NoAlias, NoCapture, NonNull, ReadOnly, SExt, StructRet, ZExt, InReg)
    3838    }
    3939}
    4040
    4141pub 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>);
    4444}
    4545
    4646impl ArgAttributesExt for ArgAttributes {
    47     fn apply_llfn(&self, idx: AttributePlace, llfn: &Value) {
     47    fn apply_llfn(&self, idx: AttributePlace, llfn: &Value, ty: Option<&Type>) {
    4848        let mut regular = self.regular;
    4949        unsafe {
    5050            let deref = self.pointee_size.bytes();
    impl ArgAttributesExt for ArgAttributes  
    6565                                               idx.as_uint(),
    6666                                               align.bytes() as u32);
    6767            }
     68            if regular.contains(ArgAttribute::ByVal) {
     69                llvm::LLVMRustAddByValAttr(llfn, idx.as_uint(), ty.unwrap());
     70            }
    6871            regular.for_each_kind(|attr| attr.apply_llfn(idx, llfn));
    6972        }
    7073    }
    7174
    72     fn apply_callsite(&self, idx: AttributePlace, callsite: &Value) {
     75    fn apply_callsite(&self, idx: AttributePlace, callsite: &Value, ty: Option<&Type>) {
    7376        let mut regular = self.regular;
    7477        unsafe {
    7578            let deref = self.pointee_size.bytes();
    impl ArgAttributesExt for ArgAttributes  
    9093                                                       idx.as_uint(),
    9194                                                       align.bytes() as u32);
    9295            }
     96            if regular.contains(ArgAttribute::ByVal) {
     97                llvm::LLVMRustAddByValCallSiteAttr(callsite, idx.as_uint(), ty.unwrap());
     98            }
    9399            regular.for_each_kind(|attr| attr.apply_callsite(idx, callsite));
    94100        }
    95101    }
    pub trait FnTypeLlvmExt<'tcx> {  
    298304    fn llvm_type(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type;
    299305    fn ptr_to_llvm_type(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type;
    300306    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);
    302308    fn apply_attrs_callsite(&self, bx: &mut Builder<'a, 'll, 'tcx>, callsite: &'ll Value);
    303309}
    304310
    impl<'tcx> FnTypeLlvmExt<'tcx> for FnTyp  
    384390        }
    385391    }
    386392
    387     fn apply_attrs_llfn(&self, llfn: &'ll Value) {
     393    fn apply_attrs_llfn(&self, cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value) {
    388394        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);
    391397            i += 1;
    392398        };
    393399        match self.ret.mode {
    394400            PassMode::Direct(ref attrs) => {
    395                 attrs.apply_llfn(llvm::AttributePlace::ReturnValue, llfn);
     401                attrs.apply_llfn(llvm::AttributePlace::ReturnValue, llfn, None);
    396402            }
    397             PassMode::Indirect(ref attrs, _) => apply(attrs),
     403            PassMode::Indirect(ref attrs, _) => apply(attrs, Some(self.ret.layout.llvm_type(cx))),
    398404            _ => {}
    399405        }
    400406        for arg in &self.args {
    401407            if arg.pad.is_some() {
    402                 apply(&ArgAttributes::new());
     408                apply(&ArgAttributes::new(), None);
    403409            }
    404410            match arg.mode {
    405411                PassMode::Ignore(_) => {}
    406412                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))),
    408414                PassMode::Indirect(ref attrs, Some(ref extra_attrs)) => {
    409                     apply(attrs);
    410                     apply(extra_attrs);
     415                    apply(attrs, None);
     416                    apply(extra_attrs, None);
    411417                }
    412418                PassMode::Pair(ref a, ref b) => {
    413                     apply(a);
    414                     apply(b);
     419                    apply(a, None);
     420                    apply(b, None);
    415421                }
    416                 PassMode::Cast(_) => apply(&ArgAttributes::new()),
     422                PassMode::Cast(_) => apply(&ArgAttributes::new(), None),
    417423            }
    418424        }
    419425    }
    420426
    421427    fn apply_attrs_callsite(&self, bx: &mut Builder<'a, 'll, 'tcx>, callsite: &'ll Value) {
    422428        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);
    425431            i += 1;
    426432        };
    427433        match self.ret.mode {
    428434            PassMode::Direct(ref attrs) => {
    429                 attrs.apply_callsite(llvm::AttributePlace::ReturnValue, callsite);
     435                attrs.apply_callsite(llvm::AttributePlace::ReturnValue, callsite, None);
    430436            }
    431             PassMode::Indirect(ref attrs, _) => apply(attrs),
     437            PassMode::Indirect(ref attrs, _) => apply(attrs, Some(self.ret.layout.llvm_type(bx))),
    432438            _ => {}
    433439        }
    434440        if let layout::Abi::Scalar(ref scalar) = self.ret.layout.abi {
    impl<'tcx> FnTypeLlvmExt<'tcx> for FnTyp  
    446452        }
    447453        for arg in &self.args {
    448454            if arg.pad.is_some() {
    449                 apply(&ArgAttributes::new());
     455                apply(&ArgAttributes::new(), None);
    450456            }
    451457            match arg.mode {
    452458                PassMode::Ignore(_) => {}
    453459                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))),
    455461                PassMode::Indirect(ref attrs, Some(ref extra_attrs)) => {
    456                     apply(attrs);
    457                     apply(extra_attrs);
     462                    apply(attrs, None);
     463                    apply(extra_attrs, None);
    458464                }
    459465                PassMode::Pair(ref a, ref b) => {
    460                     apply(a);
    461                     apply(b);
     466                    apply(a, None);
     467                    apply(b, None);
    462468                }
    463                 PassMode::Cast(_) => apply(&ArgAttributes::new()),
     469                PassMode::Cast(_) => apply(&ArgAttributes::new(), None),
    464470            }
    465471        }
    466472
  • src/librustc_codegen_llvm/attributes.rs

    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  
    119119        const_cstr!("probe-stack"), const_cstr!("__rust_probestack"));
    120120}
    121121
     122fn 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
    122145pub fn llvm_target_features(sess: &Session) -> impl Iterator<Item = &str> {
    123146    const RUSTC_SPECIFIC_FEATURES: &[&str] = &[
    124147        "crt-static",
    pub fn llvm_target_features(sess: &Sessi  
    129152    sess.target.target.options.features.split(',')
    130153        .chain(cmdline)
    131154        .filter(|l| !l.is_empty())
     155        .map(translate_obsolete_target_features)
    132156}
    133157
    134158pub fn apply_target_cpu_attr(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
  • src/librustc_codegen_llvm/common.rs

    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  
    249249        self.const_uint(self.type_i8(), i as u64)
    250250    }
    251251
     252    fn const_real(&self, t: &'ll Type, val: f64) -> &'ll Value {
     253        unsafe { llvm::LLVMConstReal(t, val) }
     254    }
     255
    252256    fn const_struct(
    253257        &self,
    254258        elts: &[&'ll Value],
  • src/librustc_codegen_llvm/context.rs

    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  
    11use crate::attributes;
    22use crate::llvm;
     3use crate::llvm_util;
    34use crate::debuginfo;
    45use crate::value::Value;
    56use rustc::dep_graph::DepGraphSafe;
    pub fn is_pie_binary(sess: &Session) ->  
    140141    !is_any_library(sess) && get_reloc_model(sess) == llvm::RelocMode::PIC
    141142}
    142143
     144fn strip_function_ptr_alignment(data_layout: String) -> String {
     145    // FIXME: Make this more general.
     146    data_layout.replace("-Fi8-", "-")
     147}
     148
    143149pub unsafe fn create_module(
    144150    tcx: TyCtxt<'_>,
    145151    llcx: &'ll llvm::Context,
    pub unsafe fn create_module(  
    149155    let mod_name = SmallCStr::new(mod_name);
    150156    let llmod = llvm::LLVMModuleCreateWithNameInContext(mod_name.as_ptr(), llcx);
    151157
     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
    152163    // Ensure the data-layout values hardcoded remain the defaults.
    153164    if sess.target.target.options.is_builtin {
    154165        let tm = crate::back::write::create_informational_target_machine(&tcx.sess, false);
    155166        llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, tm);
    156167        llvm::LLVMRustDisposeTargetMachine(tm);
    157168
    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())
    160171            .ok().expect("got a non-UTF8 data-layout from LLVM");
    161172
    162173        // Unfortunately LLVM target specs change over time, and right now we
    pub unsafe fn create_module(  
    177188        let cfg_llvm_root = option_env!("CFG_LLVM_ROOT").unwrap_or("");
    178189        let custom_llvm_used = cfg_llvm_root.trim() != "";
    179190
    180         if !custom_llvm_used && sess.target.target.data_layout != data_layout {
     191        if !custom_llvm_used && target_data_layout != llvm_data_layout {
    181192            bug!("data-layout for builtin `{}` target, `{}`, \
    182193                  differs from LLVM default, `{}`",
    183194                 sess.target.target.llvm_target,
    184                  sess.target.target.data_layout,
    185                  data_layout);
     195                 target_data_layout,
     196                 llvm_data_layout);
    186197        }
    187198    }
    188199
    189     let data_layout = SmallCStr::new(&sess.target.target.data_layout);
     200    let data_layout = SmallCStr::new(&target_data_layout);
    190201    llvm::LLVMSetDataLayout(llmod, data_layout.as_ptr());
    191202
    192203    let llvm_target = SmallCStr::new(&sess.target.target.llvm_target);
  • src/librustc_codegen_llvm/declare.rs

    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<  
    107107            llvm::Attribute::NoReturn.apply_llfn(Function, llfn);
    108108        }
    109109
    110         fty.apply_attrs_llfn(llfn);
     110        fty.apply_attrs_llfn(self, llfn);
    111111
    112112        llfn
    113113    }
  • src/librustc_codegen_llvm/intrinsic.rs

    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(  
    16631663                            acc
    16641664                        } else {
    16651665                            // unordered arithmetic reductions do not:
     1666                            let identity_acc = if $name.contains("mul") { 1.0 } else { 0.0 };
    16661667                            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),
    16691670                                v => {
    16701671                                    return_error!(r#"
    16711672unsupported {} from `{}` with element `{}` of size `{}` to `{}`"#,
  • src/librustc_codegen_llvm/llvm/ffi.rs

    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" {  
    715715    // Operations on scalar constants
    716716    pub fn LLVMConstInt(IntTy: &Type, N: c_ulonglong, SignExtend: Bool) -> &Value;
    717717    pub fn LLVMConstIntOfArbitraryPrecision(IntTy: &Type, Wn: c_uint, Ws: *const u64) -> &Value;
     718    pub fn LLVMConstReal(RealTy: &Type, N: f64) -> &Value;
    718719    pub fn LLVMConstIntGetZExtValue(ConstantVal: &Value) -> c_ulonglong;
    719720    pub fn LLVMRustConstInt128Get(ConstantVal: &Value, SExt: bool,
    720721                                  high: &mut u64, low: &mut u64) -> bool;
    extern "C" {  
    794795    pub fn LLVMRustAddAlignmentAttr(Fn: &Value, index: c_uint, bytes: u32);
    795796    pub fn LLVMRustAddDereferenceableAttr(Fn: &Value, index: c_uint, bytes: u64);
    796797    pub fn LLVMRustAddDereferenceableOrNullAttr(Fn: &Value, index: c_uint, bytes: u64);
     798    pub fn LLVMRustAddByValAttr(Fn: &Value, index: c_uint, ty: &Type);
    797799    pub fn LLVMRustAddFunctionAttribute(Fn: &Value, index: c_uint, attr: Attribute);
    798800    pub fn LLVMRustAddFunctionAttrStringValue(Fn: &Value,
    799801                                              index: c_uint,
    extern "C" {  
    824826    pub fn LLVMRustAddDereferenceableOrNullCallSiteAttr(Instr: &Value,
    825827                                                        index: c_uint,
    826828                                                        bytes: u64);
     829    pub fn LLVMRustAddByValCallSiteAttr(Instr: &Value, index: c_uint, ty: &Type);
    827830
    828831    // Operations on load/store instructions (only)
    829832    pub fn LLVMSetVolatile(MemoryAccessInst: &Value, volatile: Bool);
  • src/librustc_codegen_ssa/traits/consts.rs

    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  
    1717    fn const_u64(&self, i: u64) -> Self::Value;
    1818    fn const_usize(&self, i: u64) -> Self::Value;
    1919    fn const_u8(&self, i: u8) -> Self::Value;
     20    fn const_real(&self, t: Self::Type, val: f64) -> Self::Value;
    2021
    2122    fn const_struct(&self, elts: &[Self::Value], packed: bool) -> Self::Value;
    2223
  • src/librustc_target/spec/armebv7r_none_eabihf.rs

    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 {  
    99        target_endian: "big".to_string(),
    1010        target_pointer_width: "32".to_string(),
    1111        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(),
    1313        arch: "arm".to_string(),
    1414        target_os: "none".to_string(),
    1515        target_env: String::new(),
    pub fn target() -> TargetResult {  
    2121            linker: Some("rust-lld".to_owned()),
    2222            relocation_model: "static".to_string(),
    2323            panic_strategy: PanicStrategy::Abort,
    24             features: "+vfp3,+d16,+fp-only-sp".to_string(),
     24            features: "+vfp3,-d32,-fp16".to_string(),
    2525            max_atomic_width: Some(32),
    2626            abi_blacklist: super::arm_base::abi_blacklist(),
    2727            emit_debug_gdb_scripts: false,
  • src/librustc_target/spec/armebv7r_none_eabi.rs

    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 {  
    99        target_endian: "big".to_string(),
    1010        target_pointer_width: "32".to_string(),
    1111        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(),
    1313        arch: "arm".to_string(),
    1414        target_os: "none".to_string(),
    1515        target_env: "".to_string(),
  • src/librustc_target/spec/arm_linux_androideabi.rs

    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 {  
    1111        target_endian: "little".to_string(),
    1212        target_pointer_width: "32".to_string(),
    1313        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(),
    1515        arch: "arm".to_string(),
    1616        target_os: "android".to_string(),
    1717        target_env: String::new(),
  • src/librustc_target/spec/arm_unknown_linux_gnueabihf.rs

    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 {  
    88        target_endian: "little".to_string(),
    99        target_pointer_width: "32".to_string(),
    1010        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(),
    1212        arch: "arm".to_string(),
    1313        target_os: "linux".to_string(),
    1414        target_env: "gnu".to_string(),
  • src/librustc_target/spec/arm_unknown_linux_gnueabi.rs

    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 {  
    88        target_endian: "little".to_string(),
    99        target_pointer_width: "32".to_string(),
    1010        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(),
    1212        arch: "arm".to_string(),
    1313        target_os: "linux".to_string(),
    1414        target_env: "gnu".to_string(),
  • src/librustc_target/spec/arm_unknown_linux_musleabihf.rs

    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 {  
    1515        target_endian: "little".to_string(),
    1616        target_pointer_width: "32".to_string(),
    1717        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(),
    1919        arch: "arm".to_string(),
    2020        target_os: "linux".to_string(),
    2121        target_env: "musl".to_string(),
  • src/librustc_target/spec/arm_unknown_linux_musleabi.rs

    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 {  
    1515        target_endian: "little".to_string(),
    1616        target_pointer_width: "32".to_string(),
    1717        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(),
    1919        arch: "arm".to_string(),
    2020        target_os: "linux".to_string(),
    2121        target_env: "musl".to_string(),
  • src/librustc_target/spec/armv4t_unknown_linux_gnueabi.rs

    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 {  
    77        target_endian: "little".to_string(),
    88        target_pointer_width: "32".to_string(),
    99        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(),
    1111        arch: "arm".to_string(),
    1212        target_os: "linux".to_string(),
    1313        target_env: "gnu".to_string(),
  • src/librustc_target/spec/armv5te_unknown_linux_gnueabi.rs

    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 {  
    77        target_endian: "little".to_string(),
    88        target_pointer_width: "32".to_string(),
    99        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(),
    1111        arch: "arm".to_string(),
    1212        target_os: "linux".to_string(),
    1313        target_env: "gnu".to_string(),
  • src/librustc_target/spec/armv5te_unknown_linux_musleabi.rs

    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 {  
    1010        target_endian: "little".to_string(),
    1111        target_pointer_width: "32".to_string(),
    1212        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(),
    1414        arch: "arm".to_string(),
    1515        target_os: "linux".to_string(),
    1616        target_env: "musl".to_string(),
  • src/librustc_target/spec/armv6_unknown_freebsd.rs

    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 {  
    77        target_endian: "little".to_string(),
    88        target_pointer_width: "32".to_string(),
    99        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(),
    1111        arch: "arm".to_string(),
    1212        target_os: "freebsd".to_string(),
    1313        target_env: "gnueabihf".to_string(),
  • src/librustc_target/spec/armv6_unknown_netbsd_eabihf.rs

    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 {  
    88        target_endian: "little".to_string(),
    99        target_pointer_width: "32".to_string(),
    1010        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(),
    1212        arch: "arm".to_string(),
    1313        target_os: "netbsd".to_string(),
    1414        target_env: "eabihf".to_string(),
  • src/librustc_target/spec/armv7_apple_ios.rs

    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 {  
    88        target_endian: "little".to_string(),
    99        target_pointer_width: "32".to_string(),
    1010        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(),
    1212        arch: "arm".to_string(),
    1313        target_os: "ios".to_string(),
    1414        target_env: String::new(),
  • src/librustc_target/spec/armv7_linux_androideabi.rs

    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,  
    1010
    1111pub fn target() -> TargetResult {
    1212    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();
    1414    base.max_atomic_width = Some(64);
    1515    base.pre_link_args
    1616        .get_mut(&LinkerFlavor::Gcc).unwrap().push("-march=armv7-a".to_string());
    pub fn target() -> TargetResult {  
    2020        target_endian: "little".to_string(),
    2121        target_pointer_width: "32".to_string(),
    2222        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(),
    2424        arch: "arm".to_string(),
    2525        target_os: "android".to_string(),
    2626        target_env: String::new(),
  • src/librustc_target/spec/armv7r_none_eabihf.rs

    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 {  
    99        target_endian: "little".to_string(),
    1010        target_pointer_width: "32".to_string(),
    1111        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(),
    1313        arch: "arm".to_string(),
    1414        target_os: "none".to_string(),
    1515        target_env: "".to_string(),
    pub fn target() -> TargetResult {  
    2121            linker: Some("rust-lld".to_owned()),
    2222            relocation_model: "static".to_string(),
    2323            panic_strategy: PanicStrategy::Abort,
    24             features: "+vfp3,+d16,+fp-only-sp".to_string(),
     24            features: "+vfp3,-d32,-fp16".to_string(),
    2525            max_atomic_width: Some(32),
    2626            abi_blacklist: super::arm_base::abi_blacklist(),
    2727            emit_debug_gdb_scripts: false,
  • src/librustc_target/spec/armv7r_none_eabi.rs

    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 {  
    99        target_endian: "little".to_string(),
    1010        target_pointer_width: "32".to_string(),
    1111        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(),
    1313        arch: "arm".to_string(),
    1414        target_os: "none".to_string(),
    1515        target_env: "".to_string(),
  • src/librustc_target/spec/armv7s_apple_ios.rs

    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 {  
    88        target_endian: "little".to_string(),
    99        target_pointer_width: "32".to_string(),
    1010        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(),
    1212        arch: "arm".to_string(),
    1313        target_os: "ios".to_string(),
    1414        target_env: String::new(),
  • src/librustc_target/spec/armv7_unknown_cloudabi_eabihf.rs

    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 {  
    1313        target_endian: "little".to_string(),
    1414        target_pointer_width: "32".to_string(),
    1515        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(),
    1717        arch: "arm".to_string(),
    1818        target_os: "cloudabi".to_string(),
    1919        target_env: String::new(),
  • src/librustc_target/spec/armv7_unknown_freebsd.rs

    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 {  
    77        target_endian: "little".to_string(),
    88        target_pointer_width: "32".to_string(),
    99        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(),
    1111        arch: "arm".to_string(),
    1212        target_os: "freebsd".to_string(),
    1313        target_env: "gnueabihf".to_string(),
    pub fn target() -> TargetResult {  
    1515        linker_flavor: LinkerFlavor::Gcc,
    1616
    1717        options: TargetOptions {
    18             features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(),
     18            features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
    1919            max_atomic_width: Some(64),
    2020            abi_blacklist: super::arm_base::abi_blacklist(),
    2121            target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
  • src/librustc_target/spec/armv7_unknown_linux_gnueabihf.rs

    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 {  
    1010        target_endian: "little".to_string(),
    1111        target_pointer_width: "32".to_string(),
    1212        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(),
    1414        arch: "arm".to_string(),
    1515        target_os: "linux".to_string(),
    1616        target_env: "gnu".to_string(),
    pub fn target() -> TargetResult {  
    1919
    2020        options: TargetOptions {
    2121            // 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(),
    2323            cpu: "generic".to_string(),
    2424            max_atomic_width: Some(64),
    2525            abi_blacklist: super::arm_base::abi_blacklist(),
  • src/librustc_target/spec/armv7_unknown_linux_musleabihf.rs

    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 {  
    1212        target_endian: "little".to_string(),
    1313        target_pointer_width: "32".to_string(),
    1414        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(),
    1616        arch: "arm".to_string(),
    1717        target_os: "linux".to_string(),
    1818        target_env: "musl".to_string(),
    pub fn target() -> TargetResult {  
    2222        // Most of these settings are copied from the armv7_unknown_linux_gnueabihf
    2323        // target.
    2424        options: TargetOptions {
    25             features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(),
     25            features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
    2626            cpu: "generic".to_string(),
    2727            max_atomic_width: Some(64),
    2828            abi_blacklist: super::arm_base::abi_blacklist(),
  • src/librustc_target/spec/armv7_unknown_netbsd_eabihf.rs

    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 {  
    77        target_endian: "little".to_string(),
    88        target_pointer_width: "32".to_string(),
    99        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(),
    1111        arch: "arm".to_string(),
    1212        target_os: "netbsd".to_string(),
    1313        target_env: "eabihf".to_string(),
    pub fn target() -> TargetResult {  
    1515        linker_flavor: LinkerFlavor::Gcc,
    1616
    1717        options: TargetOptions {
    18             features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(),
     18            features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
    1919            cpu: "generic".to_string(),
    2020            max_atomic_width: Some(64),
    2121            abi_blacklist: super::arm_base::abi_blacklist(),
  • src/librustc_target/spec/thumbv6m_none_eabi.rs

    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 {  
    88        target_endian: "little".to_string(),
    99        target_pointer_width: "32".to_string(),
    1010        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(),
    1212        arch: "arm".to_string(),
    1313        target_os: "none".to_string(),
    1414        target_env: String::new(),
  • src/librustc_target/spec/thumbv7a_pc_windows_msvc.rs

    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 {  
    2222        target_endian: "little".to_string(),
    2323        target_pointer_width: "32".to_string(),
    2424        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(),
    2626        arch: "arm".to_string(),
    2727        target_os: "windows".to_string(),
    2828        target_env: "msvc".to_string(),
  • src/librustc_target/spec/thumbv7em_none_eabihf.rs

    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  
    66// Additionally, this target uses the "hard" floating convention (ABI) where floating point values
    77// are passed to/from subroutines via FPU registers (S0, S1, D0, D1, etc.).
    88//
    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.
    1010
    1111use crate::spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult};
    1212
    pub fn target() -> TargetResult {  
    1616        target_endian: "little".to_string(),
    1717        target_pointer_width: "32".to_string(),
    1818        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(),
    2020        arch: "arm".to_string(),
    2121        target_os: "none".to_string(),
    2222        target_env: String::new(),
    pub fn target() -> TargetResult {  
    2626        options: TargetOptions {
    2727            // `+vfp4` is the lowest common denominator between the Cortex-M4 (vfp4-16) and the
    2828            // 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
    3030            // 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
    3232            // whereas in the Cortex-M7 double precision is optional
    3333            //
    3434            // Reference:
    3535            // 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(),
    3737            max_atomic_width: Some(32),
    3838            .. super::thumb_base::opts()
    3939        }
  • src/librustc_target/spec/thumbv7em_none_eabi.rs

    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 {  
    1717        target_endian: "little".to_string(),
    1818        target_pointer_width: "32".to_string(),
    1919        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(),
    2121        arch: "arm".to_string(),
    2222        target_os: "none".to_string(),
    2323        target_env: String::new(),
  • src/librustc_target/spec/thumbv7m_none_eabi.rs

    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 {  
    88        target_endian: "little".to_string(),
    99        target_pointer_width: "32".to_string(),
    1010        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(),
    1212        arch: "arm".to_string(),
    1313        target_os: "none".to_string(),
    1414        target_env: String::new(),
  • src/librustc_target/spec/thumbv7neon_linux_androideabi.rs

    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 {  
    2020        target_endian: "little".to_string(),
    2121        target_pointer_width: "32".to_string(),
    2222        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(),
    2424        arch: "arm".to_string(),
    2525        target_os: "android".to_string(),
    2626        target_env: "".to_string(),
  • src/librustc_target/spec/thumbv7neon_unknown_linux_gnueabihf.rs

    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 {  
    1313        target_endian: "little".to_string(),
    1414        target_pointer_width: "32".to_string(),
    1515        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(),
    1717        arch: "arm".to_string(),
    1818        target_os: "linux".to_string(),
    1919        target_env: "gnu".to_string(),
  • src/librustc_target/spec/thumbv8m_base_none_eabi.rs

    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 {  
    88        target_endian: "little".to_string(),
    99        target_pointer_width: "32".to_string(),
    1010        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(),
    1212        arch: "arm".to_string(),
    1313        target_os: "none".to_string(),
    1414        target_env: String::new(),
  • src/librustc_target/spec/thumbv8m_main_none_eabihf.rs

    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 {  
    99        target_endian: "little".to_string(),
    1010        target_pointer_width: "32".to_string(),
    1111        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(),
    1313        arch: "arm".to_string(),
    1414        target_os: "none".to_string(),
    1515        target_env: String::new(),
    pub fn target() -> TargetResult {  
    2222            // the FPU uses the FPv5 architecture, single-precision instructions
    2323            // and 16 D registers.
    2424            // 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(),
    2626            max_atomic_width: Some(32),
    2727            .. super::thumb_base::opts()
    2828        },
  • src/librustc_target/spec/thumbv8m_main_none_eabi.rs

    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 {  
    99        target_endian: "little".to_string(),
    1010        target_pointer_width: "32".to_string(),
    1111        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(),
    1313        arch: "arm".to_string(),
    1414        target_os: "none".to_string(),
    1515        target_env: String::new(),
  • src/rustllvm/PassWrapper.cpp

    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  
    913913                              GlobalValue::LinkageTypes NewLinkage) {
    914914    ResolvedODR[ModuleIdentifier][GUID] = NewLinkage;
    915915  };
    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)
    917920  thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage);
    918921#else
    919922  thinLTOResolveWeakForLinkerInIndex(Ret->Index, isPrevailing, recordNewLinkage);
  • src/rustllvm/RustWrapper.cpp

    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  
    237237      Call->getContext(), Index, B));
    238238}
    239239
     240extern "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
    240251extern "C" void LLVMRustAddFunctionAttribute(LLVMValueRef Fn, unsigned Index,
    241252                                             LLVMRustAttribute RustAttr) {
    242253  Function *A = unwrap<Function>(Fn);
    extern "C" void LLVMRustAddDereferenceab  
    271282  A->addAttributes(Index, B);
    272283}
    273284
     285extern "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
    274296extern "C" void LLVMRustAddFunctionAttrStringValue(LLVMValueRef Fn,
    275297                                                   unsigned Index,
    276298                                                   const char *Name,
  • src/test/codegen/mainsubprogram.rs

    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  
    77// compile-flags: -g -C no-prepopulate-passes
    88
    99// CHECK-LABEL: @main
    10 // CHECK: {{.*}}DISubprogram{{.*}}name: "main",{{.*}}DIFlagMainSubprogram{{.*}}
     10// CHECK: {{.*}}DISubprogram{{.*}}name: "main",{{.*}}DI{{(SP)?}}FlagMainSubprogram{{.*}}
    1111
    1212pub fn main() {
    1313}
  • src/test/codegen/mainsubprogramstart.rs

    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  
    66#![feature(start)]
    77
    88// CHECK-LABEL: @main
    9 // CHECK: {{.*}}DISubprogram{{.*}}name: "start",{{.*}}DIFlagMainSubprogram{{.*}}
     9// CHECK: {{.*}}DISubprogram{{.*}}name: "start",{{.*}}DI{{(SP)?}}FlagMainSubprogram{{.*}}
    1010
    1111#[start]
    1212fn start(_: isize, _: *const *const u8) -> isize {