From patchwork Tue Apr 11 08:12:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 81794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2407198vqo; Tue, 11 Apr 2023 01:13:35 -0700 (PDT) X-Google-Smtp-Source: AKy350bbFj66p2PvpjSfrgn2dKkyN2mA0QJbVj4n/OnNxhYwM1FX8F1JBCwviD2/0AZa7HfmxJY2 X-Received: by 2002:aa7:c155:0:b0:504:b30a:2298 with SMTP id r21-20020aa7c155000000b00504b30a2298mr3442719edp.42.1681200815784; Tue, 11 Apr 2023 01:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681200815; cv=none; d=google.com; s=arc-20160816; b=1DzN4KU2reBNs+jcOmRloTw1uaJCSe+yROOT9bri4n5xikZXdjEXjcKgnSzb8LfDR/ gf4Uk2rN3tPDv6MKRudD1fVhDI0Lg4ircXqIsfle6DPIWuWOVRAU9WwCNJ+Eo45D2qOm CLK4sf4Sd1HzcD99/jXl7e4tELhaOcTw04NaMQs/sh1l6K+EFATTthu2VAuxt8USuR93 47F9n6n5AXPq2dlDdudFn9gHieJov/xNEUyRREfsfoflB6BC/KO8k95s2eJgN5dcxFyx nmXbyZKftfXdmBtMuUiOXC7rV792dq0qL8Lkg3iy9gz4Mw36SKnwetlFiHk5AoPGS5Ic RVEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:cc:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=IqQ8Z3G+J4630mV/ICbl4mvfr8zILDO5DqX/Blxu1rc=; b=uyxrJl1+9cc9eTQZrcFELN9jNUzgV0qrlMB9Xe7hXjU+66Hf98jo8D5ZQWiSI+uEfE Ugot9ZCe3IYZBKrnMNyViYA0o5m8Ey9rIyU37tqcL/4ISxTjM1J8rwHb5vvDuoJmtiN6 DAEoi58vFaxE31LWZ0M0CGtVGlDJ3yHnMk+ICQ7krwUEtrOlcA/ZdM9lq96m1TapzA4J 7WO4JeRTolhFwvV14lFrdZdsQDIog65TVula/6dHMMLv2LjaKcPqPMdhcSAo92Oyzkba Te2vhD3ubonVUXd1AzApLWSuVx8FnV1mHSidjl5y64ZUDjCqPQA7uM/WXwnxXayEucef ieAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="lr/ah2bW"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id n15-20020a056402514f00b00501e4bca007si233075edd.39.2023.04.11.01.13.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Apr 2023 01:13:35 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="lr/ah2bW"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ABB253858422 for ; Tue, 11 Apr 2023 08:13:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABB253858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681200796; bh=IqQ8Z3G+J4630mV/ICbl4mvfr8zILDO5DqX/Blxu1rc=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=lr/ah2bWKikXDc+afqMcxyYfODaM/xMUAjzelg1g1eSsWNpTUZp4m3ydiyFJxWXmj +affJnp2rjS7AGcJIb/gyk+EpQKMlqENSKhMExtilZuMQNnOsmaVdDv0yabyJCknec TlcAtFev6PqGytadeor4GcZukQKK4L40AHPtgapM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5DBF63858D28 for ; Tue, 11 Apr 2023 08:12:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DBF63858D28 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-134-FfFut8WOPt2pzG2dB8KuKw-1; Tue, 11 Apr 2023 04:12:31 -0400 X-MC-Unique: FfFut8WOPt2pzG2dB8KuKw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E483299E758; Tue, 11 Apr 2023 08:12:31 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29DFD492B00; Tue, 11 Apr 2023 08:12:31 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 33B8CMQx2465707 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 11 Apr 2023 10:12:28 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 33B8CMdL2465706; Tue, 11 Apr 2023 10:12:22 +0200 Date: Tue, 11 Apr 2023 10:12:21 +0200 To: Jason Merrill , Nathan Sidwell Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] c++: Fix Solaris bootstraps across midnight Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762866826783399705?= X-GMAIL-MSGID: =?utf-8?q?1762866826783399705?= 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. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2023-04-11 Jakub Jelinek * Make-lang.in (s-cp-module-version): New target. (cp/module.o): Depend on it. (MODULE_VERSION): Remove variable. (CFLAGS-cp/module.o): For -DMODULE_VERSION= argument just cat s-cp-module-version. Jakub --- gcc/cp/Make-lang.in.jj 2023-01-16 11:52:16.057734447 +0100 +++ gcc/cp/Make-lang.in 2023-04-06 10:03:34.344469067 +0200 @@ -59,12 +59,21 @@ CFLAGS-cp/module.o += -DHOST_MACHINE=\"$ # In non-release builds, use a date-related module version. ifneq ($(DEVPHASE_c),) -# Some date's don't grok 'r', if so, simply use today's -# date (don't bootstrap at midnight). -MODULE_VERSION := $(shell date -r $(srcdir)/cp/module.cc '+%y%m%d-%H%M' \ - 2>/dev/null || date '+%y%m%d-0000' 2>/dev/null || echo 0) - -CFLAGS-cp/module.o += -DMODULE_VERSION='($(subst -,,$(MODULE_VERSION))U)' +# Some date's don't grok 'r', if so, simply use today's date, +# but use date from previous stage if bootstrapping to avoid breaking +# bootstraps across midnight. +s-cp-module-version: $(srcdir)/cp/module.cc + MODULE_VERSION=`if date -r $(srcdir)/cp/module.cc '+%y%m%d%H%M' \ + 2>/dev/null; then :; \ + elif test ../prev-gcc/s-cp-module-version -nt \ + $(srcdir)/cp/module.cc; then \ + cat ../prev-gcc/s-cp-module-version; \ + else \ + date '+%y%m%d0000' 2>/dev/null; \ + fi`; \ + echo $${MODULE_VERSION}U > s-cp-module-version +cp/module.o: s-cp-module-version +CFLAGS-cp/module.o += -DMODULE_VERSION='$(shell cat s-cp-module-version)' endif # Create the compiler driver for g++.