Skip to content

Commit ca423fe

Browse files
committed
Support deterministic builds by remapping the __FILE__ prefix if the compiler supports it.
1 parent 36da64f commit ca423fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

build.rs

+4
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ 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.
428+
cfg.flag_if_supported(&format!("-ffile-prefix-map={}=.", root.display()));
429+
426430
let src_dir = root.join("lib/builtins");
427431
for (sym, src) in sources.map.iter() {
428432
let src = src_dir.join(src);

0 commit comments

Comments
 (0)