From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1285) id E086B3834407; Thu, 28 Jan 2021 10:40:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E086B3834407 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eric Botcazou To: gcc-cvs@gcc.gnu.org Subject: [gcc r9-9208] Fix LTO bootstrap on Windows X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/releases/gcc-9 X-Git-Oldrev: ad39fe64f69eaac1e395c6fd6598075299521819 X-Git-Newrev: faed344ee5f17b9a19961b3b1f8ea0ed10db6f2d Message-Id: <20210128104052.E086B3834407@sourceware.org> Date: Thu, 28 Jan 2021 10:40:52 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2021 10:40:53 -0000 https://gcc.gnu.org/g:faed344ee5f17b9a19961b3b1f8ea0ed10db6f2d commit r9-9208-gfaed344ee5f17b9a19961b3b1f8ea0ed10db6f2d Author: Eric Botcazou 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