Skip to content

Commit f0b4323

Browse files
authored
Merge pull request #309 from jgalenson/file-prefix-map
Support deterministic builds by remapping the __FILE__ prefix if the …
2 parents 36da64f + c8f7928 commit f0b4323

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

build.rs

+5
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,11 @@ mod c {
423423
panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display());
424424
}
425425

426+
// Support deterministic builds by remapping the __FILE__ prefix if the
427+
// compiler supports it. This fixes the nondeterminism caused by the
428+
// use of that macro in lib/builtins/int_util.h in compiler-rt.
429+
cfg.flag_if_supported(&format!("-ffile-prefix-map={}=.", root.display()));
430+
426431
let src_dir = root.join("lib/builtins");
427432
for (sym, src) in sources.map.iter() {
428433
let src = src_dir.join(src);

0 commit comments

Comments
 (0)