Merge pull request #309 from jgalenson/file-prefix-map

Support deterministic builds by remapping the __FILE__ prefix if the …
This commit is contained in:
Alex Crichton 2019-08-19 17:20:33 -05:00 committed by GitHub
commit f0b43234dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -423,6 +423,11 @@ mod c {
panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display()); 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"); let src_dir = root.join("lib/builtins");
for (sym, src) in sources.map.iter() { for (sym, src) in sources.map.iter() {
let src = src_dir.join(src); let src = src_dir.join(src);