From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 14D843857C7A; Mon, 18 Jan 2021 14:29:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14D843857C7A From: "brechtsanders at users dot sourceforge.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/98729] New: GCC 11 MinGW Windows build doesn't generate working PE executables Date: Mon, 18 Jan 2021 14:29:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: brechtsanders at users dot sourceforge.net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2021 14:29:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98729 Bug ID: 98729 Summary: GCC 11 MinGW Windows build doesn't generate working PE executables Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: brechtsanders at users dot sourceforge.net Target Milestone: --- Created attachment 49994 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49994&action=3Dedit Invalid Windows .exe PE file When I try to build GCC 11 for MinGW (using MinGW-w64 8.0.0) configure fails (on both 32-bit and 64-bit) when it's trying to test if it can run a compil= ed .exe file. When I replicate this command with: `echo "int main () { return 0; }" | /R/winlibs64_stage/gcc-11-20210117/build_mingw/./gcc/xgcc -B/R/winlibs64_stage/gcc-11-20210117/build_mingw/./gcc/ -L/R/winlibs64_stage/inst_gcc-11-20210117/share/gcc/x86_64-w64-mingw32/lib -L/R/winlibs64_stage/inst_gcc-11-20210117/share/gcc/mingw/lib -isystem /R/winlibs64_stage/inst_gcc-11-20210117/share/gcc/x86_64-w64-mingw32/include -isystem /R/winlibs64_stage/inst_gcc-11-20210117/share/gcc/mingw/include -B/R/winlibs64_stage/inst_gcc-11-20210117/share/gcc/x86_64-w64-mingw32/bin/ -B/R/winlibs64_stage/inst_gcc-11-20210117/share/gcc/x86_64-w64-mingw32/lib/ -isystem /R/winlibs64_stage/inst_gcc-11-20210117/share/gcc/x86_64-w64-mingw32/include -isystem /R/winlibs64_stage/inst_gcc-11-20210117/share/gcc/x86_64-w64-mingw32/sys-in= clude --sysroot=3D/R/winlibs64_stage/gcc-11-20210117/build_mingw/mingw-w64 -o conftest.exe -g -O2 -xc -` it builds `conftest.exe`, but running it (fro MSYS2 bash shell) with `conftest.exe` fails with error `bash: ./conftest.exe: cannot execute binary file: Exec format error`, or when I run it from Windows or Command prompt it pops up a message saying `This app can't run on your PC`. The command `file conftest.exe` does return `conftest.exe: PE32+ executable (console) x86-64, for MS Windows`. I have attached this file.=