소스 검색

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

Support deterministic builds by remapping the __FILE__ prefix if the …
Alex Crichton 5 년 전
부모
커밋
f0b43234dd
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      build.rs

+ 5 - 0
build.rs

@@ -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);