u-reproducible-compiler-builtins
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Sun, 5 Jan 2020 13:35:46 +0000 (13:35 +0000)
committerXimin Luo <infinity0@debian.org>
Sun, 5 Jan 2020 13:35:46 +0000 (13:35 +0000)
Gbp-Pq: Name u-reproducible-compiler-builtins.patch

vendor/compiler_builtins/build.rs

index c714bc15de30836a117446e91172fc15e55c2be4..490b6391d08e45637c0b015bab4b31803eaed147 100644 (file)
@@ -423,6 +423,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);