Update lang/rust to version 1.37.0
[dports.git] / lang / rust / files / patch-src_bootstrap_native.rs
1 Avoid unnecessarily restarting the LLVM build and installing it
2 into STAGEDIR during the install phase.
3
4 https://github.com/rust-lang/rust/issues/61206
5
6 --- src/bootstrap/native.rs.orig        2019-05-22 05:39:52 UTC
7 +++ src/bootstrap/native.rs
8 @@ -92,17 +92,9 @@ impl Step for Llvm {
9              .join(exe("llvm-config", &*builder.config.build));
10          let done_stamp = out_dir.join("llvm-finished-building");
11  
12 -        if let Some(llvm_commit) = llvm_info.sha() {
13              if done_stamp.exists() {
14 -                let done_contents = t!(fs::read(&done_stamp));
15 -
16 -                // If LLVM was already built previously and the submodule's commit didn't change
17 -                // from the previous build, then no action is required.
18 -                if done_contents == llvm_commit.as_bytes() {
19 -                    return build_llvm_config
20 -                }
21 +                return build_llvm_config
22              }
23 -        }
24  
25          let _folder = builder.fold_output(|| "llvm");
26          let descriptor = if emscripten { "Emscripten " } else { "" };
27 @@ -218,6 +210,10 @@ impl Step for Llvm {
28              }
29          }
30  
31 +        if target == "powerpc64-unknown-freebsd" {
32 +            cfg.define("CMAKE_EXE_LINKER_FLAGS", "-Wl,-rpath=/usr/local/lib/%CC% -L/usr/local/lib/%CC%");
33 +        }
34 +
35          // http://llvm.org/docs/HowToCrossCompileLLVM.html
36          if target != builder.config.build && !emscripten {
37              builder.ensure(Llvm {
38 @@ -283,9 +279,7 @@ impl Step for Llvm {
39  
40          cfg.build();
41  
42 -        if let Some(llvm_commit) = llvm_info.sha() {
43 -            t!(fs::write(&done_stamp, llvm_commit));
44 -        }
45 +        t!(fs::write(&done_stamp, "done building LLVM"));
46  
47          build_llvm_config
48      }