https://bugs.winehq.org/show_bug.cgi?id=47025
Bug ID: 47025 Summary: wine cannot run exe created with winegcc: "Bad EXE Format" Product: Wine Version: 4.6 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: jeffersoncarpenter2@gmail.com Distribution: ---
Full steps to reproduce from cloning the Wine source tree:
$ git clone git://source.winehq.org/git/wine.git $ mkdir wine64_build
$ cd wine64_build $ ../wine/configure --enable-win64 $ make $ cd ..
$ mkdir test_program $ cd test_program $ echo 'int main() { return 0; }' > main.c $ PATH="$PATH:../wine64_build/tools/winebuild/" /home/rofl/wine64-build-debug/tools/winegcc/winegcc -L/home/rofl/wine64-build-debug/dlls/advapi32 -L/home/rofl/wine64-build-debug/dlls/user32 -L/home/rofl/wine64-build-debug/dlls/ntdll/ -L/home/rofl/wine64-build-debug/dlls/winecrt0 -L/home/rofl/wine64-build-debug/dlls/kernel32 -L/home/rofl/wine64-build-debug/libs/wine/ main.c -o main $ ../wine64_build/wine64 ./main.exe
On my machine, the last command outputs
wine: Bad EXE format for Z:\home\rofl\test_program\main.exe.
Is this expected behavior meaning I'm using winegcc incorrectly, or is this a bug?
https://bugs.winehq.org/show_bug.cgi?id=47025
--- Comment #1 from jeffersoncarpenter2@gmail.com --- Sorry, build command is
$ PATH="$PATH:../wine64_build/tools/winebuild/" ../wine64_build/tools/winegcc/winegcc -L../wine64_build/dlls/advapi32 -L../wine64_build/dlls/user32 -L../wine64_build/dlls/ntdll/ -L../wine64_build/dlls/winecrt0 -L../wine64_build/dlls/kernel32 -L../wine64_build/libs/wine/ main.c -o main
https://bugs.winehq.org/show_bug.cgi?id=47025
--- Comment #2 from jeffersoncarpenter2@gmail.com --- Created attachment 64186 --> https://bugs.winehq.org/attachment.cgi?id=64186 configure output
https://bugs.winehq.org/show_bug.cgi?id=47025
Zhiyi Zhang zzhang@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |zzhang@codeweavers.com
--- Comment #3 from Zhiyi Zhang zzhang@codeweavers.com --- $ winegcc ~/Downloads/temp.c -o a.exe $ file a.exe a.exe: POSIX shell script, ASCII text executable $ vim a.exe
winegcc produce a script as a result. You use mingw toolchains to produce a windows binary if you want exe.
https://bugs.winehq.org/show_bug.cgi?id=47025
jeffersoncarpenter2@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID
--- Comment #4 from jeffersoncarpenter2@gmail.com --- Apparently I have to run `main.exe.so` and not `main.exe` with wine.
Strangely, I had this output:
$ file main.exe main.exe: PE32+ executable (console) x86-64, for MS Windows
but cannot figure out how that happened - presently when I run the same build script main.exe is a shell script.
https://bugs.winehq.org/show_bug.cgi?id=47025
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing Invalid.