I'm getting an error when using winegcc with stdin:
$ cat test.c | winegcc -xc -c - gcc: warning: ‘-x c’ after last input file has no effect gcc: error: -E or -x required when input is from standard input winegcc: gcc failed
Does anyone know what I could be doing wrong? I'm trying to use stdin because that's what the go (cgo) build tool is trying to use.
Leon
Hi,
On Fri, Mar 27, 2015 at 1:54 AM, Leon Bogaert leonbogaert@gmail.com wrote:
I'm getting an error when using winegcc with stdin:
$ cat test.c | winegcc -xc -c - gcc: warning: ‘-x c’ after last input file has no effect gcc: error: -E or -x required when input is from standard input winegcc: gcc failed
Does anyone know what I could be doing wrong? I'm trying to use stdin because that's what the go (cgo) build tool is trying to use.
I think it's not you who does something wrong, it's winegcc which runs gcc a bit wrongly. If you look at gcc command line arguments, you'll get something like
-fshort-wchar -DWINE_UNICODE_NATIVE -D_REENTRANT -fPIC -DWIN64 -D_WIN64 -D__WIN64 -D__WIN64__ -DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -D__WINNT -D__WINNT__ -D__stdcall=__attribute__((ms_abi)) -D__cdecl=__attribute__((ms_abi)) -D_stdcall=__attribute__((ms_abi)) -D_cdecl=__attribute__((ms_abi)) -D__fastcall=__attribute__((ms_abi)) -D_fastcall=__attribute__((ms_abi)) -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 -D__WINE__ -c - -xc -isystem/usr/include/wine/windows
Notice that '-xc' has moved after '-c -'. Maybe this should be considered a bug of winegcc.
Leon
Ruslan
Thanks! I've filed a bug: https://bugs.winehq.org/show_bug.cgi?id=38300
On Fri, Mar 27, 2015 at 8:21 AM, Ruslan Kabatsayev b7.10110111@gmail.com wrote:
Hi,
On Fri, Mar 27, 2015 at 1:54 AM, Leon Bogaert leonbogaert@gmail.com wrote:
I'm getting an error when using winegcc with stdin:
$ cat test.c | winegcc -xc -c - gcc: warning: ‘-x c’ after last input file has no effect gcc: error: -E or -x required when input is from standard input winegcc: gcc failed
Does anyone know what I could be doing wrong? I'm trying to use stdin because that's what the go (cgo) build tool is trying to use.
I think it's not you who does something wrong, it's winegcc which runs gcc a bit wrongly. If you look at gcc command line arguments, you'll get something like
-fshort-wchar -DWINE_UNICODE_NATIVE -D_REENTRANT -fPIC -DWIN64 -D_WIN64 -D__WIN64 -D__WIN64__ -DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -D__WINNT -D__WINNT__ -D__stdcall=__attribute__((ms_abi)) -D__cdecl=__attribute__((ms_abi)) -D_stdcall=__attribute__((ms_abi)) -D_cdecl=__attribute__((ms_abi)) -D__fastcall=__attribute__((ms_abi)) -D_fastcall=__attribute__((ms_abi)) -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 -D__WINE__ -c - -xc -isystem/usr/include/wine/windows
Notice that '-xc' has moved after '-c -'. Maybe this should be considered a bug of winegcc.
Leon
Ruslan