File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -113,11 +113,12 @@ def cc_toolchain_config(
113113 unfiltered_compile_flags = [
114114 # Do not resolve our symlinked resource prefixes to real paths.
115115 "-no-canonical-prefixes" ,
116- # Reproducibility
116+ # Reproducibility.
117117 "-Wno-builtin-macro-redefined" ,
118118 "-D__DATE__=\" redacted\" " ,
119119 "-D__TIMESTAMP__=\" redacted\" " ,
120120 "-D__TIME__=\" redacted\" " ,
121+ "-ffile-prefix-map=${{pwd}}=__bazel_toolchain_llvm_repo__" ,
121122 ]
122123
123124 is_xcompile = not (exec_os == target_os and exec_arch == target_arch )
@@ -150,6 +151,8 @@ def cc_toolchain_config(
150151 link_flags = [
151152 "--target=" + target_system_name ,
152153 "-no-canonical-prefixes" ,
154+ # Reproducibility.
155+ "-ffile-prefix-map=${{pwd}}=__bazel_toolchain_llvm_repo__" ,
153156 ]
154157
155158 stdlib = compiler_configuration ["stdlib" ]
Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ function sanitize_option() {
5353 # shellcheck disable=SC2206
5454 parts=(${opt/ =/ } ) # Split flag name and value into array.
5555 printf " %s" " ${parts[0]} =${execroot_path}${parts[1]} "
56+ elif [[ ${opt} == * ' ${{pwd}}' * ]]; then
57+ # Replace the literal string '${{pwd}}' with the execroot.
58+ printf " %s" " ${opt// ' ${{pwd}}' / ${execroot_abs_path%/ } } "
5659 else
5760 printf " %s" " ${opt} "
5861 fi
Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ function sanitize_option() {
7979 # shellcheck disable=SC2206
8080 parts=(${opt/ =/ } ) # Split flag name and value into array.
8181 printf " %s" " ${parts[0]} =${execroot_path}${parts[1]} "
82+ elif [[ ${opt} == * ' ${{pwd}}' * ]]; then
83+ # Replace the literal string '${{pwd}}' with the execroot.
84+ printf " %s" " ${opt// ' ${{pwd}}' / ${execroot_abs_path%/ } } "
8285 else
8386 printf " %s" " ${opt} "
8487 fi
@@ -128,6 +131,8 @@ if [[ ":${PATH}:" != *":/usr/bin:"* ]]; then
128131 PATH=" ${PATH} :/usr/bin"
129132fi
130133
134+ echo " ${cmd[@]} "
135+
131136# Call the C++ compiler.
132137" ${cmd[@]} "
133138
You can’t perform that action at this time.
0 commit comments