http://bugs.winehq.org/show_bug.cgi?id=24402
Summary: winegcc does not properly pass cmdline args, e.g. -Wb,--as-cmd="as --32" Product: Wine Version: 1.3.2 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: critical Priority: P2 Component: build-env AssignedTo: wine-bugs@winehq.org ReportedBy: armin.kazmi@tu-dortmund.de
When trying to build a simple test.c file with winegcc, winegcc fails to properly pass over commandline arguments to winebuild.
test.c only contains an emtpy main function. In practise this error was verified with the vst plugin of lmms.
Test cmdline: winegcc test.c -o test -m32 -Wb,--as-cmd="as --32",--ld-cmd="ld -melf_i386"
Resulting output: winebuild: as --32 failed with status 1 winegcc: winebuild failed
Another testcase
Cmdline: winegcc test.c -o test -m32 -Wb,--as-cmd="as ",--ld-cmd="ld "
Output: winebuild: as failed with status 1 winegcc: winebuild failed
Running the same first cmdline with the -v option reveals the error:
winegcc test.c -o test -m32 -Wb,--as-cmd="as --32",--ld-cmd="ld -melf_i386" -v
----- gcc -m32 -fshort-wchar -DWINE_UNICODE_NATIVE -D_REENTRANT -fPIC -DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -D__WINNT -D__WINNT__ -D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -D_stdcall=__attribute__((__stdcall__)) -D_cdecl=__attribute__((__cdecl__)) -D__fastcall=__attribute__((__fastcall__)) -D_fastcall=__attribute__((__fastcall__)) -D__declspec(x)=__declspec_##x -D__declspec_align(x)=__attribute__((aligned(x))) -D__declspec_allocate(x)=__attribute__((section(x))) -D__declspec_deprecated=__attribute__((deprecated)) -D__declspec_dllimport=__attribute__((dllimport)) -D__declspec_dllexport=__attribute__((dllexport)) -D__declspec_naked=__attribute__((naked)) -D__declspec_noinline=__attribute__((noinline)) -D__declspec_noreturn=__attribute__((noreturn)) -D__declspec_nothrow=__attribute__((nothrow)) -D__declspec_novtable=__attribute__(()) -D__declspec_selectany=__attribute__((weak)) -D__declspec_thread=__thread -D__int8=char -D__int16=short -D__int32=int -D__int64=long long -D__WINE__ -c -o test-5hFdhw.o -m32 -v test.c -isystem/usr/include/wine/windows
STRIPPED
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/cc1 -fpreprocessed /home/armin/.ccache/tmp/test.tmp.Armin-Lappy.24225.i -quiet -dumpbase test.tmp.Armin-Lappy.24225.i -m32 -mtune=generic -march=x86-64 -auxbase-strip /home/armin/.ccache/8/f/e763402f4ba107ebe0a46887176150-5354.o.tmp.Armin-Lappy.24225 -version -fshort-wchar -fPIC -o /tmp/cc1MonbO.s
STRIPPED
winebuild -v -fno-asynchronous-unwind-tables -m32 -D_REENTRANT -fPIC --exe -o test.exe-mBoapU.spec.o -F test.exe --subsystem console -L/usr/lib/wine -L/usr/lib -L/usr/lib -L/usr/local/lib -L/lib --as-cmd=as --32 --ld-cmd=ld -melf_i386 -- test-5hFdhw.o as --32 --32 -o test.GRCnmk.o test.QLV4hW.s winebuild: as --32 failed with status 1 winegcc: winebuild failed ------
The error lies in $WINESRC/tools/winegcc/winegcc.c lines 1360 and following. Winegcc assumes that the command line arguments remain quoted as shown in the cmdline above, but instead winegcc receives the following as 4th arg "--as-cmd=as --32" (as verified with a simple program just outputting the args), so actually the quotes get lost and need to be manually filled in if winegcc starts a script running winebuild. Franky, I don't know too much of the process used here.
Attached is a chatlog between me and A. Hentschel.
http://bugs.winehq.org/show_bug.cgi?id=24402
Armin Kazmi armin.kazmi@tu-dortmund.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv@dawncrow.de
--- Comment #1 from Armin Kazmi armin.kazmi@tu-dortmund.de 2010-09-14 16:52:41 CDT --- If you alter the command line like this:
winegcc test.c -o test -m32 "-Wb,--as-cmd="as --32",--ld-cmd="ld -melf_i386"" -v
The correct quotation of the cmdline tokens shows up, but still the command fails. It might be possible that winebuild does not parse --as-cmd and --ld-cmd as being a command + arguments but instead as a command only.
http://bugs.winehq.org/show_bug.cgi?id=24402
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source Severity|critical |normal
--- Comment #2 from Austin English austinenglish@gmail.com 2010-09-14 17:14:22 CDT --- Not critical.
http://bugs.winehq.org/show_bug.cgi?id=24402
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|build-env |tools
http://bugs.winehq.org/show_bug.cgi?id=24402
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|source |
http://bugs.winehq.org/show_bug.cgi?id=24402
--- Comment #3 from Alexandre Julliard julliard@winehq.org 2010-09-15 09:21:01 CDT --- Note that you shouldn't need --as-cmd or --ld-cmd, winebuild should be able to figure out the correct command by itself.
http://bugs.winehq.org/show_bug.cgi?id=24402
--- Comment #4 from Armin Kazmi armin.kazmi@tu-dortmund.de 2010-09-16 06:24:02 CDT --- @Alexandre Julliard:
The specific problem is that I try to compile 32bit code using an 64bit host (with both wine versions available). Only using winegcc test.c -o test -m32 (and well, -m32 is crucial here) results in the following error message:
/usr/bin/ld: Relocatable linking with relocations from format elf64-x86-64 (/usr/lib/wine/libwinecrt0.a(exe_entry.o)) to format elf32-i386 (test.ayxZu1.o) is not supported winebuild: /usr/bin/ld failed with status 1 winegcc: winebuild failed
Also adding the 32bit search path for ld using -Wb,-L /usr/lib32 does not change anything here. I'd also like to add that this error (more precise, building lmms vst plugin which uses the following extra cflags "-m32 -Wb,--as-cmd='as --32',--ld-cmd='ld -melf_i386' -L/usr/lib32") does not occur with wine 1.2.
http://bugs.winehq.org/show_bug.cgi?id=24402
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |ABANDONED
--- Comment #5 from André H. nerv@dawncrow.de 2010-09-19 13:05:22 CDT --- -m32 should be all you need After that you run into the lib problem: /usr/bin/ld: Relocatable linking with relocations from format elf64-x86-64 (/usr/local/lib64/wine/libwinecrt0.a(exe_entry.o)) to format elf32-i386 (my32bitapp.Yz5Piu.o) is not supported
but thats another bug and i filed it: http://bugs.winehq.org/show_bug.cgi?id=24470
http://bugs.winehq.org/show_bug.cgi?id=24402
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from André H. nerv@dawncrow.de 2010-09-19 13:05:58 CDT --- closing
http://bugs.winehq.org/show_bug.cgi?id=24402
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |f7272176d9e74f8f645572bd3a3 | |6f6a452eaf460 Status|CLOSED |RESOLVED Resolution|ABANDONED |FIXED
--- Comment #7 from Alexandre Julliard julliard@winehq.org 2013-06-11 04:40:22 CDT --- Fixed by f7272176d9e74f8f645572bd3a36f6a452eaf460 (but you still shouldn't need to do this...)
http://bugs.winehq.org/show_bug.cgi?id=24402
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org 2013-06-14 13:25:26 CDT --- Closing bugs fixed in 1.6-rc2.