public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r10-9307] Fix LTO bootstrap on Windows
Date: Thu, 28 Jan 2021 10:35:14 +0000 (GMT)	[thread overview]
Message-ID: <20210128103514.5F2653857C70@sourceware.org> (raw)

https://gcc.gnu.org/g:4be929be0317b2baf1c67b430ad0a2fbaed05152

commit r10-9307-g4be929be0317b2baf1c67b430ad0a2fbaed05152
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Thu Jan 28 11:31:35 2021 +0100

    Fix LTO bootstrap on Windows
    
    The latest fix 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 weird behavior
    because some tools add the implicit .exe suffix and others do not.
    
    contrib/
            PR lto/85574
            * compare-lto: Deal with PE-COFF executables specifically.

Diff:
---
 contrib/compare-lto | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

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


                 reply	other threads:[~2021-01-28 10:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210128103514.5F2653857C70@sourceware.org \
    --to=ebotcazou@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).