http://bugs.winehq.org/show_bug.cgi?id=21526
Summary: several programs fail to compile under cygwin Product: Wine Version: 1.1.37 Platform: x86 URL: http://www.cygwin.com OS/Version: Windows XP Status: NEW Keywords: download, source Severity: enhancement Priority: P2 Component: build-env AssignedTo: wine-bugs@winehq.org ReportedBy: austinenglish@gmail.com
Seems to be related to command line arguments: cmd.exe-HRRQ2O.c: In function `main': cmd.exe-HRRQ2O.c:5: error: `__wargv' undeclared (first use in this function) cmd.exe-HRRQ2O.c:5: error: (Each undeclared identifier is reported only once cmd.exe-HRRQ2O.c:5: error: for each function it appears in.)
Also affects: dxdiag.exe-8dF1r2.c:5: error: `__wargv' undeclared (first use in this function) explorer.exe-huqBP4.c:5: error: `__wargv' undeclared (first use in this function) extrac32.exe-ZBAgOk.c:5: error: `__wargv' undeclared (first use in this function) mshta.exe-ivENd9.c:5: error: `__wargv' undeclared (first use in this function) reg.exe-bHwntd.c:5: error: `__wargv' undeclared (first use in this function) start.exe-LokQFy.c:5: error: `__wargv' undeclared (first use in this function) svchost.exe-ntfQ5M.c:5: error: `__wargv' undeclared (first use in this function) termsv.exe-aacxDf.c:5: error: `__wargv' undeclared (first use in this function) uninstaller.exe-iXvRef.c:5: error: `__wargv' undeclared (first use in this function) winebrowser.exe-zWnYcC.c:5: error: `__wargv' undeclared (first use in this function) winedevice.exe-SvwxgZ.c:5: error: `__wargv' undeclared (first use in this function) winepath.exe-guBaBG.c:5: error: `__wargv' undeclared (first use in this function) xcopy.exe-0dP3a3.c:5: error: `__wargv' undeclared (first use in this function)
Notepad/regedit have a different (but possibly related) problem: dialog.o: In function `DIALOG_Search': /home/austin/wine-git/programs/notepad/dialog.c:1059: undefined reference to `___assert_func' dialog.o: In function `DIALOG_Replace': /home/austin/wine-git/programs/notepad/dialog.c:1093: undefined reference to `___assert_func'
hexedit.o: In function `HexEdit_WindowProc': /home/austin/wine-git/programs/regedit/hexedit.c:307: undefined reference to `___assert_func' regproc.o: In function `import_registry_file': /home/austin/wine-git/programs/regedit/regproc.c:671: undefined reference to `___assert_func' collect2: ld returned 1 exit status
Other than this, when using CFLAGS="-D _WIN32" the compile works.
http://bugs.winehq.org/show_bug.cgi?id=21526
David Gerard dgerard@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dgerard@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #1 from David Gerard dgerard@gmail.com 2010-01-31 12:13:17 --- __wargv is defined in include/msvcrt/stdlib.h . Somehow this is not getting included in cmd.exe-XXXXXX.c when compiling in cygwin. cmd.exe-XXXXXX.c is, of course, a generated file:
=== make[2]: Entering directory `/home/Administrator/wine-git/programs/cmd' ../../tools/winegcc/winegcc -B../../tools/winebuild --sysroot=../.. -mconsole -municode batch.o builtins.o directory.o wcmdmain.o Cs.res Da.res De.res En.res Es.res Fr.res It.res Ja.res Ko.res Lt.res Nl.res No.res Pl.res Pt.res Ru.res Si.res Tr.res wcmdrc.res -o cmd.exe -lshell32 -luser32 -ladvapi32 -lkernel32 -lwine ../../libs/port/libwine_port.a cmd.exe-8n0LMQ.c: In function `main': cmd.exe-8n0LMQ.c:5: error: `__wargv' undeclared (first use in this function) cmd.exe-8n0LMQ.c:5: error: (Each undeclared identifier is reported only once cmd.exe-8n0LMQ.c:5: error: for each function it appears in.) winegcc: gcc failed ===
Andre Hentschel had suggestions to edit programs/cmd/Makefile (which we realise is a generated file):
=== 1. add "msvcrt" to "IMPORTS" (might be line 8) and run make in that folder
2. also add "-mno-cygwin" to "APPMODE" (might be line 6) and run make in that folder
3. remove the msvcrt of step 1 so that only the "-mno-cygwin"-change is in and run make in that folder ===
None of these worked.
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #2 from André H. nerv@dawncrow.de 2010-01-31 12:42:04 --- Created an attachment (id=25987) --> (http://bugs.winehq.org/attachment.cgi?id=25987) Patch for that Problem?
i somehow dont get this far, i get stuck in d3dx9_36 even with my workaround... i once wrote a patch for that but didnt tried it yet because my mentioned problem
http://bugs.winehq.org/show_bug.cgi?id=21526
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv@dawncrow.de
--- Comment #3 from André H. nerv@dawncrow.de 2010-01-31 12:43:24 --- (In reply to comment #1)
Andre Hentschel had suggestions to edit programs/cmd/Makefile (which we realise is a generated file):
Thats the way i work :D First try to identify the problem, even in generated files and then fix the source of it.
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #4 from David Gerard dgerard@gmail.com 2010-01-31 12:45:45 --- Per bug 21181, whatever bug -D_WIN32 works around is a bit of a Heisenbug - it would manifest or not for me at various times. Eventually I did a "make clean" and it works for me.
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #5 from David Gerard dgerard@gmail.com 2010-01-31 15:07:53 --- Re comment #2 - Andre, that patch didn't work for me just now applied to latest git.
http://bugs.winehq.org/show_bug.cgi?id=21526
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #25987|0 |1 is obsolete| |
http://bugs.winehq.org/show_bug.cgi?id=21526
Alex cerebro.alexiel@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |cerebro.alexiel@gmail.com
--- Comment #6 from Alex cerebro.alexiel@gmail.com 2010-02-19 13:31:17 --- $ cd /cygdrive/c/wine-git/programs/cmd
$ make ../../tools/winegcc/winegcc -B../../tools/winebuild --sysroot=../.. -mconsole -municode batch.o builtins.o directory.o wcmdmain.o Cs.res Da.res De.res En.re s Es.res Fr.res It.res Ja.res Ko.res Lt.res Nl.res No.res Pl.res Pt.res Ru.res S i.res Tr.res wcmdrc.res -o cmd.exe -lshell32 -luser32 -ladvapi32 -lkernel32 -lwine ../../libs/port/libwine_port.a cmd.exe-jGNutZ.c: In function 'main': cmd.exe-jGNutZ.c:5: error: '__wargv' undeclared (first use in this function) cmd.exe-jGNutZ.c:5: error: (Each undeclared identifier is reported only once cmd.exe-jGNutZ.c:5: error: for each function it appears in.) winegcc: gcc failed make: *** [cmd.exe] Error 2
$ ../../tools/winegcc/winegcc -B../../tools/winebuild --sysroot=../.. -mconsole -municode *.o *.res -o cmd.exe -lshell32 -luser32 -ladvapi32 -lkernel32 -lwine ../../libs/port/libwine_port.a -I ../../include/msvcrt/ -lmsvcrt
$
However, I don't know how to add "-I ../../include/msvcrt/ -lmsvcrt" in Makefile.in
http://bugs.winehq.org/show_bug.cgi?id=21526
Pierre Monteux iampierremonteux@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |iampierremonteux@gmail.com
--- Comment #7 from Pierre Monteux iampierremonteux@gmail.com 2010-02-23 02:25:44 ---
__wargv is defined in include/msvcrt/stdlib.h . Somehow this is not getting included in cmd.exe-XXXXXX.c when compiling in cygwin. cmd.exe-XXXXXX.c is, of course, a generated file:
On my system, it was not including the stdlib.h in include/msvcrt. It was including the stdlib.h in /usr/include/. I tested this by modifying winegcc.c about line 551 to make the stub like this
create_file( main_stub, 0644, "#include <stdlib.h>\n" "#include "/home/Pierre/wine/include/msvcrt/stdlib.h"\n" "extern int wmain(int,wchar_t**);\n" "int main( int argc, char *argv[] )\n{\n" " return wmain( argc, __wargv );\n}\n" ); return compile_to_object( opts, main_stub, NULL );
After recompiling just winegcc and cmd.exe, the errors came out with a lot of messages like this
/home/Pierre/wine/include/msvcrt/stdlib.h:40:1: warning: "EXIT_FAILURE" redefine d In file included from cmd.exe-nvOwXC.c:1: /usr/include/stdlib.h:53:1: warning: this is the location of the previous defini tion
Is it supposed to be including the system stdlib.h?
I'm using the latest wine-git in cygwin 1.7 in XP 32 bit.
http://bugs.winehq.org/show_bug.cgi?id=21526
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |21181
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #8 from Alex cerebro.alexiel@gmail.com 2010-03-05 08:20:08 --- Created an attachment (id=26622) --> (http://bugs.winehq.org/attachment.cgi?id=26622) Adding msvcrt dependency when needed
Theorically it should work but I can't test it now. Could someone do './configure && make depend && make -k > log 2>&1' from a clean git and post the result here ?
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2010-03-05 09:18:48 --- You should handle this in winegcc.
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #10 from Austin English austinenglish@gmail.com 2010-03-05 12:15:12 --- (In reply to comment #8)
Created an attachment (id=26622)
--> (http://bugs.winehq.org/attachment.cgi?id=26622) [details]
Adding msvcrt dependency when needed
Theorically it should work but I can't test it now. Could someone do './configure && make depend && make -k > log 2>&1' from a clean git and post the result here ?
Still fails: ../../tools/winegcc/winegcc -B../../tools/winebuild --sysroot=../.. -mconsole -municode batch.o builtins.o directory.o wcmdmain.o Cs.res Da.res De.res En.res Es.res Fr.res It.res Ja.res Ko.res Lt.res Nl.res No.res Pl.res Pt.res Ru.res Si.res Tr.res wcmdrc.res -o cmd.exe -lshell32 -luser32 -ladvapi32 -lkernel32 -lwine ../../libs/port/libwine_port.a cmd.exe-pupG1P.c: In function `main': cmd.exe-pupG1P.c:5: error: `__wargv' undeclared (first use in this function) cmd.exe-pupG1P.c:5: error: (Each undeclared identifier is reported only once cmd.exe-pupG1P.c:5: error: for each function it appears in.) winegcc: gcc failed make: *** [cmd.exe] Error 2
http://bugs.winehq.org/show_bug.cgi?id=21526
Alex cerebro.alexiel@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #26622|0 |1 is obsolete| |
--- Comment #11 from Alex cerebro.alexiel@gmail.com 2010-03-05 12:36:37 --- Created an attachment (id=26625) --> (http://bugs.winehq.org/attachment.cgi?id=26625) Add -mno-cygwin option to winegcc
The 'boss' said I should handle this in winegcc but thanks for testing. I'm quite new here so I don't know all wine compiling mechanism.
In fact, Pierre Monteux was right. Current version links against libc instead of using msvcrt library. And that's -mno-cygwin do.
See http://source.winehq.org/git/wine.git/?a=blob;f=tools/winegcc/winegcc.c#l124... and line 442.
This patch is not tested.
I noticed xcopy had '-mno-cygwin' flag though it fails compiling according to the first post. I guess the fix is not so far...
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #12 from André H. nerv@dawncrow.de 2010-03-05 13:26:22 --- I think i might be able to fix it, but got no time... But David, i think i already sent you a patch for winegcc, maybe that includes some idea where to start... Be free to attach it here
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #13 from David Gerard dgerard@gmail.com 2010-03-07 17:41:04 --- Andre - the winegcc patch you sent me was your first patch on this bug! And it doesn't make any difference even now, unfortunately.
(You also sent me another, which patches dlls/kernel32/tests/file.c, which is highly unlikely to be related ...)
http://bugs.winehq.org/show_bug.cgi?id=21526
Alex cerebro.alexiel@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #26625|0 |1 is obsolete| |
--- Comment #14 from Alex cerebro.alexiel@gmail.com 2010-03-12 14:36:45 --- Created an attachment (id=26773) --> (http://bugs.winehq.org/attachment.cgi?id=26773) Modify a bit -mno-cygwin winegcc implementation
In winegcc.c, opts.use_msvcrt case was not implemented in mingw_unicode_hack when opts->nostdinc was true. Moreover, "-mno-cygwin" is not a valid gcc parameter anymore so I replaced it by msvcrt linking options.
This patch seems to work but you need to apply my previous patch (try2.patch) before that adds '-mno-cygwin' option to some Makefiles.in.
Please note that -mo-cygwin is also used by mingw so this patch could break wine when compiling under mingw.
But currently we don't care, I mean, we just want to say "hey it doesn't work because..."
The last error (unrelated with this bug) I get is now De.rc:62:4: Error: VIRTKEY code is not equal to ascii value make[1]: *** [De.res] Error 1 make[1]: Leaving directory `/cygdrive/c/wine-git/programs/view' make: *** [programs/view] Error 2
Tell me if you have the same error.
Any comment is welcome
http://bugs.winehq.org/show_bug.cgi?id=21526
Alex cerebro.alexiel@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #26625|1 |0 is obsolete| |
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #15 from Austin English austinenglish@gmail.com 2010-03-12 17:02:28 --- No errors here. At the end of compile, I get: gcc: -lmscvrt: linker input file unused because linking was not done gcc: -lmscvrt: linker input file unused because linking was not done
Some programs still don't run, e.g., notepad: /home/austin/wine-git/programs/notepad/notepad.exe: error while loading shared libraries: libwine.dll: cannot open shared object file: No such file or directory
but clock works. Oleview doesn't get an error, but doesn't run. Haven't tested the rest.
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #16 from Alex cerebro.alexiel@gmail.com 2010-03-13 05:32:41 --- Glad to see that my patches are working. Can you tell me in what directory the "linker input file unused" message appear ? These are just warnings but it sould not be too hard to fix.
Others errors are not related to this bug as we are trying to fix the ones from the first comment.
But before filling another bug, please wait until my patches are commited and this bug is closed.
Meanwhile, I will try to compile again from a clean working directory (still with ccache). Darn Heisenbugs !!
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #17 from Austin English austinenglish@gmail.com 2010-03-15 02:13:53 --- Created an attachment (id=26815) --> (http://bugs.winehq.org/attachment.cgi?id=26815) make log
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #18 from Alex cerebro.alexiel@gmail.com 2010-03-19 12:42:01 --- This should be fixed by http://source.winehq.org/git/wine.git/?a=commitdiff;h=561a3e643ea8b35adfc032...
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #19 from Austin English austinenglish@gmail.com 2010-03-19 12:52:09 --- (In reply to comment #18)
This should be fixed by http://source.winehq.org/git/wine.git/?a=commitdiff;h=561a3e643ea8b35adfc032...
Nope, still present: ../../tools/winegcc/winegcc -B../../tools/winebuild --sysroot=../.. -mconsole -municode -mno-cygwin batch.o builtins.o directory.o wcmdmain.o Cs.res Da.res De.res En.res Es.res Fr.res It.res Ja.res Ko.res Lt.res Nl.res No.res Pl.res Pt.res Ru.res Si.res Tr.res wcmdrc.res -o cmd.exe -lshell32 -luser32 -ladvapi32 -lkernel32 -lwine ../../libs/port/libwine_port.a cmd.exe-84Iwp8.c: In function `main': cmd.exe-84Iwp8.c:5: error: `__wargv' undeclared (first use in this function) cmd.exe-84Iwp8.c:5: error: (Each undeclared identifier is reported only once cmd.exe-84Iwp8.c:5: error: for each function it appears in.) winegcc: ccache failed make: *** [cmd.exe] Error 2
using wine-1.1.40-313-g594a196
http://bugs.winehq.org/show_bug.cgi?id=21526
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #20 from Austin English austinenglish@gmail.com 2010-06-16 14:37:00 --- Fixed by http://source.winehq.org/git/wine.git/?a=commitdiff;h=5f7bbb2ab2ce4f2d66e610...
http://bugs.winehq.org/show_bug.cgi?id=21526
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #21 from Alexandre Julliard julliard@winehq.org 2010-06-18 12:47:15 --- Closing bugs fixed in 1.2-rc4.
http://bugs.winehq.org/show_bug.cgi?id=21526
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- OS/Version|Windows XP |Windows
http://bugs.winehq.org/show_bug.cgi?id=21526
--- Comment #22 from Saulius K. saulius2@gmail.com --- SHA1 of fix missing.
http://bugs.winehq.org/show_bug.cgi?id=21526
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |5f7bbb2ab2ce4f2d66e610e8f50 | |39733dea2653e