diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-01-28 11:31:35 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2021-01-28 11:33:53 +0100 |
commit | f7a6d314e7f7eeb6240a4f62511c189c90ef300c (patch) | |
tree | 93f557899e5f2d535901a6b5f3ca540d5ff20e46 /contrib/compare-lto | |
parent | 33a7a93218b1393d0135e3c4a9ad9ced87808f5e (diff) | |
download | gcc-f7a6d314e7f7eeb6240a4f62511c189c90ef300c.zip gcc-f7a6d314e7f7eeb6240a4f62511c189c90ef300c.tar.gz gcc-f7a6d314e7f7eeb6240a4f62511c189c90ef300c.tar.bz2 |
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.
Diffstat (limited to 'contrib/compare-lto')
-rwxr-xr-x | contrib/compare-lto | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/contrib/compare-lto b/contrib/compare-lto index 17379e1..c0bb71c 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 |