From patchwork Thu Jan 28 08:26:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1432594 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=adacore-com.20150623.gappssmtp.com header.i=@adacore-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=1ccnSjrw; dkim-atps=neutral Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DRD825D2Qz9sT6 for ; Thu, 28 Jan 2021 19:26:09 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF29F398D034; Thu, 28 Jan 2021 08:26:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id BD691398D027 for ; Thu, 28 Jan 2021 08:26:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BD691398D027 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=botcazou@adacore.com Received: by mail-wr1-x42a.google.com with SMTP id c12so4477151wrc.7 for ; Thu, 28 Jan 2021 00:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=iwEGTJMMuRhNYqQf51qJ1dfEyOE8ImubPBmSWCNct/Q=; b=1ccnSjrwVovqEcjRGV8eU77R78F7AIZ6x1flQl7x43bnYBcECCRtF9iwAtjPA6TTeZ 1mItys47weDUooqG9psU5w+2CXKZS6lo06HaqRUHFXnzQSQaCLwsMmx12h6p7ZKgcgFN poZgv2RmTLI2brpnUDAjdkdkDdg9KU3HJNCZREu0NN+4MWshNEojQLLareabw1X+cxb6 ZxVgIUB0Oz/D8d2zQKp1DKe9SNnFpbpPVD3aG/ScQgZZkJMIi85XVa8wi7rnVraI9IzO JAijrto1GC9VHidtr+6CEIj3MgadUrV1cGQlbbNNaoK75HX1GkXClvDfHfhHSN3UK9co ZNww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=iwEGTJMMuRhNYqQf51qJ1dfEyOE8ImubPBmSWCNct/Q=; b=VHrgc2gh3PpLEPa8rP7fZCZoUDBzuLtXhDxAIn/HmBxwMrSsQgwRrjTXv+vxLmAQho WSwnIyRKuPXrXyonvYGNOCxGyZDPZ5de574psLjHQlaMYAkNk417eQx42ga+/Tpn7DBf WutvvxDLeBOWR4SDuuO5ihbqFfYMg3M+w4f/1Cr8pQu8lRiO30UnBrImcH1cFVL7fioU 3erJHb+sFBzVPw8nejZN59W5W+iXg/5dI5lBh6tcQD9pa0+Kyp1qvfBJPKX/1NljSe8W HkUwpUY9uWhtSrjP8GOo+HLDJoX/pEh9vH05P+VYNcyIh/Ha1ZQRysFmyRPrCR3unfZC 7yNw== X-Gm-Message-State: AOAM533E4zeJgt++cAHvLEKVCO69TL1m4d7qYpkJEVM47K9cVDVbPVfr YMM80S595Vnq+AJ8AI+gYbcO5ZAlrurMl8/O X-Google-Smtp-Source: ABdhPJwqvg//KCdEadD6NwdYWp7m62rKJmiLUnJBr9tqEmBsAoa+R9T3lBhvQrzq62LS6bAH8vO8xA== X-Received: by 2002:adf:ba47:: with SMTP id t7mr14779135wrg.285.1611822363390; Thu, 28 Jan 2021 00:26:03 -0800 (PST) Received: from fomalhaut.localnet ([2a01:e0a:41b:84f0:cf71:f5e0:b050:bede]) by smtp.gmail.com with ESMTPSA id s25sm6279280wrs.49.2021.01.28.00.26.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Jan 2021 00:26:02 -0800 (PST) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix LTO bootstrap on Windows (PR lto/85574) Date: Thu, 28 Jan 2021 09:26:01 +0100 Message-ID: <1669973.bGtRa8e5aY@fomalhaut> MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" The last fix made for PR lto/85574 introduced a comparison of executables and this cannot directly work on Windows because they are timestamped. Moreover nobody sets $(exeext) at top level, at least on MinGW, so you get a weird behavior because some tools add the implicit .exe suffix and others don't. Bootstrapped in LTO mode on Windows, OK for all active branches? 2021-01-28 Eric Botcazou contrib/ PR lto/85574 * compare-lto: Deal with PE-COFF executables specifically. diff --git a/contrib/compare-lto b/contrib/compare-lto index 17379e196a7..c0bb71c0765 100755 --- a/contrib/compare-lto +++ b/contrib/compare-lto @@ -32,7 +32,7 @@ case $1 in esac if test $# != 2; then - echo 'usage: compare-lto file1.o file2.o' >&2 + echo 'usage: compare-lto file1 file2' >&2 exit 1 fi @@ -101,6 +101,25 @@ else else status=1 fi + + # PE-COFF executables are timestamped so skip leading bytes for them. + else + case "$1" in + *.exe) + if cmp -i 256 "$1" "$2"; then + status=0 + else + status=1 + fi + ;; + *) + if test -f "$1.exe" && cmp -i 256 "$1.exe" "$2.exe"; then + status=0 + else + status=1 + fi + ;; + esac fi fi