diff mbox series

[committed] arm: Use move-if-change for updating regenerated files [PR93548]

Message ID e128707d-cabb-c763-6b05-4c88d1b11222@arm.com
State New
Headers show
Series [committed] arm: Use move-if-change for updating regenerated files [PR93548] | expand

Commit Message

Richard Earnshaw (lists) Feb. 3, 2020, 5:43 p.m. UTC
The t-arm make fragment currently uses 'mv' to update some files that 
are automatically regenerated, but this causes problems on read-only 
filesystems if the date stamps are incorrect and the files have not 
really changed.  So use move-if-change instead.

	PR target/93548
	* config/arm/t-arm: ($(srcdir)/config/arm/arm-tune.md,
	$(srcdir)/config/arm/arm-tables.opt): Use move-if-change.
diff mbox series

Patch

diff --git a/gcc/config/arm/t-arm b/gcc/config/arm/t-arm
index e8483d45688..b883f796956 100644
--- a/gcc/config/arm/t-arm
+++ b/gcc/config/arm/t-arm
@@ -70,13 +70,15 @@  $(srcdir)/config/arm/arm-tune.md: $(srcdir)/config/arm/parsecpu.awk \
 	$(srcdir)/config/arm/arm-cpus.in
 	$(AWK) -f $(srcdir)/config/arm/parsecpu.awk -v cmd=md \
 		$(srcdir)/config/arm/arm-cpus.in > arm-tune.new
-	mv arm-tune.new $(srcdir)/config/arm/arm-tune.md
+	$(srcdir)/../move-if-change arm-tune.new \
+				    $(srcdir)/config/arm/arm-tune.md
 
 $(srcdir)/config/arm/arm-tables.opt: $(srcdir)/config/arm/parsecpu.awk \
   $(srcdir)/config/arm/arm-cpus.in
 	$(AWK) -f $(srcdir)/config/arm/parsecpu.awk -v cmd=opt \
 		$(srcdir)/config/arm/arm-cpus.in > arm-tables.new
-	mv arm-tables.new $(srcdir)/config/arm/arm-tables.opt
+	$(srcdir)/../move-if-change arm-tables.new \
+				    $(srcdir)/config/arm/arm-tables.opt
 
 arm-cpu.h: s-arm-cpu ; @true
 s-arm-cpu: $(srcdir)/config/arm/parsecpu.awk \