@@ -6,16 +6,30 @@ erase_non_stage_variables synth
66# If using a cached, gate level netlist, then copy over to the results dir with
77# preserve timestamps flag set. If you don't, subsequent runs will cause the
88# floorplan step to be re-executed.
9+ #
10+ # Plain cp + touch -r rather than cp -p: -p also preserves mode, which makes
11+ # cp copy ACLs. That fails with EOPNOTSUPP when the source is on an NFSv4
12+ # mount (every file there carries a system.nfs4_acl xattr) and the
13+ # destination filesystem, e.g. ext4 or tmpfs, cannot store it. Only the
14+ # timestamps matter for make's up-to-date checks; touch -r preserves them
15+ # with nanosecond precision and, unlike cp --preserve=timestamps, is
16+ # portable to macOS/BSD.
917if { [env_var_exists_and_non_empty SYNTH_NETLIST_FILES] } {
1018 if { [llength $::env(SYNTH_NETLIST_FILES) ] == 1 } {
11- log_cmd exec cp -p $::env(SYNTH_NETLIST_FILES) $::env(RESULTS_DIR) /1_2_yosys.v
19+ log_cmd exec cp $::env(SYNTH_NETLIST_FILES) $::env(RESULTS_DIR) /1_2_yosys.v
20+ log_cmd exec touch -r $::env(SYNTH_NETLIST_FILES) \
21+ $::env(RESULTS_DIR) /1_2_yosys.v
1222 } else {
1323 # The date should be the most recent date of the files, but to
1424 # keep things simple we just use the creation date
1525 log_cmd exec cat {*}$::env(SYNTH_NETLIST_FILES) > $::env(RESULTS_DIR) /1_2_yosys.v
1626 }
1727 if { [env_var_exists_and_non_empty CACHED_REPORTS] } {
18- log_cmd exec cp -p {*}$::env(CACHED_REPORTS) $::env(REPORTS_DIR) /.
28+ foreach report $::env(CACHED_REPORTS) {
29+ set dst $::env(REPORTS_DIR) /[file tail $report ]
30+ log_cmd exec cp $report $dst
31+ log_cmd exec touch -r $report $dst
32+ }
1933 }
2034 exit
2135}
0 commit comments