public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@acm.org>
To: Jakub Jelinek <jakub@redhat.com>, Jason Merrill <jason@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c++: Fix Solaris bootstraps across midnight
Date: Tue, 11 Apr 2023 18:55:55 -0400	[thread overview]
Message-ID: <41cd4d9f-f541-e070-024a-b18f49addeb3@acm.org> (raw)
In-Reply-To: <52e00a19-2dfe-185f-a85e-8c5a1ea1524b@acm.org>

Jakub,
for avoidance of doubt, your version is fine.

nathan


On 4/11/23 18:06, Nathan Sidwell wrote:
> 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


      reply	other threads:[~2023-04-11 22:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11  8:12 Jakub Jelinek
2023-04-11 22:06 ` Nathan Sidwell
2023-04-11 22:55   ` Nathan Sidwell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41cd4d9f-f541-e070-024a-b18f49addeb3@acm.org \
    --to=nathan@acm.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).