]> git.proxmox.com Git - rustc.git/blobdiff - vendor/compiler_builtins/build.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / vendor / compiler_builtins / build.rs
index c714bc15de30836a117446e91172fc15e55c2be4..b520b62477ed7402aebe1733b81783c73e7f6459 100644 (file)
@@ -8,6 +8,9 @@ fn main() {
 
     println!("cargo:compiler-rt={}", cwd.join("compiler-rt").display());
 
+    // Activate libm's unstable features to make full use of Nightly.
+    println!("cargo:rustc-cfg=feature=\"unstable\"");
+
     // Emscripten's runtime includes all the builtins
     if target.contains("emscripten") {
         return;
@@ -423,6 +426,11 @@ mod c {
             panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display());
         }
 
+        // Support deterministic builds by remapping the __FILE__ prefix if the
+        // compiler supports it.  This fixes the nondeterminism caused by the
+        // use of that macro in lib/builtins/int_util.h in compiler-rt.
+        cfg.flag_if_supported(&format!("-ffile-prefix-map={}=.", root.display()));
+
         let src_dir = root.join("lib/builtins");
         for (sym, src) in sources.map.iter() {
             let src = src_dir.join(src);