Project

General

Profile

Bootstrapped Rust » rustc-1.29.0.dyson.patch

Igor Pashev, 2019-12-02 09:34 AM

View differences:

mrust/rustc-1.29.0-src/src/librustc_target/spec/mod.rs 2019-12-01 14:59:43.464760937 +0100
347 347
    ("armebv7r-none-eabihf", armebv7r_none_eabihf),
348
    ("x86_64-pc-solaris2.11", x86_64_pc_solaris),
348 349
    ("x86_64-sun-solaris", x86_64_sun_solaris),
349 350
    ("sparcv9-sun-solaris", sparcv9_sun_solaris),
mrust/rustc-1.29.0-src/src/librustc_target/spec/x86_64_pc_solaris.rs 2019-12-01 15:02:06.222678682 +0100
1
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
2
// file at the top-level directory of this distribution and at
3
// http://rust-lang.org/COPYRIGHT.
4
//
5
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
// option. This file may not be copied, modified, or distributed
9
// except according to those terms.
10

  
11
use spec::{LinkerFlavor, Target, TargetResult};
12

  
13
pub fn target() -> TargetResult {
14
    let mut base = super::solaris_base::opts();
15
    base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
16
    base.cpu = "x86-64".to_string();
17
    base.max_atomic_width = Some(64);
18
    base.stack_probes = true;
19

  
20
    Ok(Target {
21
        llvm_target: "x86_64-pc-solaris".to_string(),
22
        target_endian: "little".to_string(),
23
        target_pointer_width: "64".to_string(),
24
        target_c_int_width: "32".to_string(),
25
        data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
26
        arch: "x86_64".to_string(),
27
        target_os: "solaris".to_string(),
28
        target_env: "gnu".to_string(),
29
        target_vendor: "unknown".to_string(),
30
        linker_flavor: LinkerFlavor::Gcc,
31
        options: base,
32
    })
33
}
mrust/rustc-1.29.0-src/src/vendor/regex/build.rs 2019-11-29 13:52:13.710194395 +0100
3 3
use std::process::Command;
4 4
fn main() {
5
    let rustc = env::var_os("RUSTC").unwrap_or(OsString::from("rustc"));
6
    let output = Command::new(&rustc)
7
        .arg("--version")
8
        .output()
9
        .unwrap()
10
        .stdout;
11
    let version = String::from_utf8(output).unwrap();
12

  
13
    enable_simd_optimizations(&version);
5
    enable_simd_optimizations();
14 6
}
15
fn enable_simd_optimizations(version: &str) {
7
fn enable_simd_optimizations() {
16 8
    // If we're using nightly Rust, then we can enable vector optimizations.
17 9
    // Note that these aren't actually activated unless the `unstable` feature
18 10
    // is enabled.
......
25 17
    if env::var_os("CARGO_CFG_REGEX_DISABLE_AUTO_OPTIMIZATIONS").is_some() {
26 18
        return;
27 19
    }
28
    let parsed = match Version::parse(&version) {
29
        Ok(parsed) => parsed,
30
        Err(err) => {
31
            eprintln!("failed to parse `rustc --version`: {}", err);
32
            return;
33
        }
34
    };
35
    let minimum = Version { major: 1, minor: 27, patch: 0 };
36
    if version.contains("nightly") || parsed >= minimum {
37 20
        println!("cargo:rustc-cfg=regex_runtime_teddy_ssse3");
38 21
        println!("cargo:rustc-cfg=regex_runtime_teddy_avx2");
39
    }
40 22
}
41 23
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Ord)]
(2-2/2)