On 4/11/23 04:12, Jakub Jelinek wrote:
Hi!
When working on the PR109040 fix, I wanted to test it on some
WORD_REGISTER_OPERATIONS target and tried sparc-solaris on GCC Farm.
My bootstrap failed in comparison failure on cp/module.o, because
Solaris date doesn't support the -r option and one stage's cp/module.o
was built before midnight and next stage's cp/module.o after midnight,
so they had different -DMODULE_VERSION= value.
Now, I think the advice (don't bootstrap at midnight) is something
we shouldn't have, so the following patch stores the module version
(still generated through the same way, date -r cp/module.cc
if it works, otherwise just date) into a temporary file, makes sure
that temporary file is updated when cp/module.cc source is updated
and when date -r doesn't work copies file from previous stage
if it is newer than cp/module.cc.
looks good. one could tweak it slightly to avoid the MODULE_VERSION variable
(but then I was the original lazy one!) Something like:
....
s-cp-module-version: $(srcdir)/cp/module.cc
if date -r $(srcdir)/cp/module.cc '+%y%m%d%H%MU' \
2>/dev/null >$@; then :; \
elif test ../prev-gcc/$@ -nt \
$(srcdir)/cp/module.cc; then \
cp ../prev-gcc/$@ $@; \
else \
date '+%y%m%d0000U' 2>/dev/null >$@; \
fi`; \
....
nathan
--
Nathan Sidwell