Dear ListFolks,
I am attempting to make an i486-pc-mingwmsvc (i.e., Windows NT standalone) version of the latest gpc alpha (gpc-19991030) using the Cygwin B20.1 emulation, and I get a compilation error when the build process attempts to make the run-time library. Specifically, I get:
/usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c: At top level: /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:577: warning: `struct passwd' declared inside parameter list /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:577: warning: its scope is only this definition or declaration, which is probably not what you want.
/usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c: In function `_p_pwl2c': /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:579: dereferencing pointer to incomplete type /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:592: dereferencing pointer to incomplete type /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:593: dereferencing pointer to incomplete type /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:594: dereferencing pointer to incomplete type /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:595: dereferencing pointer to incomplete type
I don't know enough C to be sure, but this looks like a syntax error. Surely, though, it must compile on other systems, so I'm stumped. Perhaps it has something to do with the Cygwin-specific version of gcc?
As far as I can tell, everything was unloaded, patched, and configured correctly. The compiler itself appears to have been made correctly, i.e., I have xgpc.exe, gpc1.exe, and gpc-cpp.exe in the object directory. The invocation on the RTL appears to be:
../../i486-pc-mingwmsvc-gcc -c -I. -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -g -O2 -DRTS_RELEASE_STRING="'__GPC_RTS_VERSION_`cat /usr/local/src/gcc-2.95.2/gcc/p/rts/rts_release`__'" -DBSD_RTS=0 `if [ x@with_shared@ = xyes ] ; then echo -fPIC; fi` -v /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c
I've tried compiling rts.c with gcc-2.8.1 as a test, and I get the same error. Could someone point me in the right direction? Thanks!
-- Dave
On 20 Jan 00, at 22:42, J. David Bryan wrote:
Dear ListFolks,
I am attempting to make an i486-pc-mingwmsvc (i.e., Windows NT
standalone) version of the latest gpc alpha (gpc-19991030) using the Cygwin B20.1 emulation, and I get a compilation error when the build process attempts to make the run-time library. Specifically, I get:
/usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c: At top level: /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:577: warning: `struct passwd' declared inside parameter list /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:577: warning: its scope is only this definition or declaration, which is probably not what you want.
/usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c: In function `_p_pwl2c': /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:579: dereferencing pointer to incomplete type /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:592: dereferencing pointer to incomplete type /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:593: dereferencing pointer to incomplete type /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:594: dereferencing pointer to incomplete type /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:595: dereferencing pointer to incomplete type
I don't know enough C to be sure, but this looks like a syntax error. Surely, though, it must compile on other systems, so I'm stumped. Perhaps it has something to do with the Cygwin-specific version of gcc?
Well, you have got a lot farther than I have ever got. I gave up on trying to build a Mingw compiler long ago and settled for using the Cygwin compiler with '-mno-cygwin' to produce Mingw programs.
Your problem is probably due to things that are missing in the gcc Mingw libraries (and there are many of them). However, I have been able to produce a Mingw version of the RTS. It has involved a lot of patches, C macros in a new header (we presently call it 'os- hacks.h'), and sources going back and forth between Frank and me. The good news is that the next gpc snapshot will probably solve these problems that you are having.
I am quite disorganised at the moment, having just arrived back from down under. But when I am more settled, I can send you a copy of my 'os-hacks.h' file. Frank can tell you where you need to '#include' it.
Best regards, The Chief ----- Dr Abimbola A Olowofoyeku (The African Chief) Email: laa12@keele.ac.uk Author of Chief's Installer Pro v5.21.1 for Win32 http://ourworld.compuserve.com/homepages/African_Chief/chief32.htm
On 21 Jan 00, at 9:58, Dr A Olowofoyeku wrote:
Well, you have got a lot farther than I have ever got.
It took quite a bit of perseverence to get as far as I did! I spent my first three weeks trying to understand just enough Unixisms to get a 2.95.2 cross-C compiler built! :-)
I gave up on trying to build a Mingw compiler long ago and settled for using the Cygwin compiler with '-mno-cygwin' to produce Mingw programs.
I'd be happy to post here how I did it, if it'll further the cause of getting GPC to compile for NT. It actually wasn't too hard, as the majority of time I spent trying to dope out exactly what "configure" did in response to various combinations of --host, --target, and --build. Once I got all those straight, and with the help of a few symbolic links here and there, it all worked OK.
Your problem is probably due to things that are missing in the gcc Mingw libraries (and there are many of them).
I was wondering if the warning reference I quoted:
/usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:577: warning: `struct passwd' declared inside parameter list /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:577: warning: its scope is only this definition or declaration, which is probably not what you want.
was significant. I am using the latest 2.95.2 + some patches supplied by Mumit Khan at:
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/gcc.html
Perhaps this is checking something more stringently than the "standard" 2.95.2, and that gives the warning? I admit I don't know C that well, but isn't this a complaint about the source of "rts.c", rather than a complaint about a Mingw-included file?
But when I am more settled, I can send you a copy of my 'os-hacks.h' file. Frank can tell you where you need to '#include' it.
That would be wonderful, thanks! Please send it to my address on this message.
-- Dave
On 21 Jan 00, at 10:28, J. David Bryan wrote:
On 21 Jan 00, at 9:58, Dr A Olowofoyeku wrote:
Well, you have got a lot farther than I have ever got.
It took quite a bit of perseverence to get as far as I did! I spent my first three weeks trying to understand just enough Unixisms to get a 2.95.2 cross-C compiler built! :-)
Mumit Khan sent me instructions on how to do that - I still couldn't get it working ...
I gave up on trying to build a Mingw compiler long ago and settled for using the Cygwin compiler with '-mno-cygwin' to produce Mingw programs.
I'd be happy to post here how I did it, if it'll further the cause of getting GPC to compile for NT.
That would be helpful, please. I have some sort of documentation on how I compiled the gpc Cygwin compiler, but it is at the moment only in the form of a (well commented ) bash script. Between us we should be able to produce fairly comprehensive documentation on compiling gpc under Windows.
Your problem is probably due to things that are missing in the gcc Mingw libraries (and there are many of them).
I was wondering if the warning reference I quoted:
/usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:577: warning: `struct passwd' declared inside parameter list /usr/local/src/gcc-2.95.2/gcc/p/rts/rts.c:577: warning: its scope is only this definition or declaration, which is probably not what you want.
was significant. I am using the latest 2.95.2 + some patches supplied by Mumit Khan at:
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/gcc.html
That is what I use too.
Perhaps this is checking something more stringently than the "standard" 2.95.2, and that gives the warning? I admit I don't know C that well, but isn't this a complaint about the source of "rts.c", rather than a complaint about a Mingw-included file?
Probably not. 'configure' checks for many things in setting up the system. I had to fiddle a bit with the 'rts-config' files and Frank had to introduce more 'configure' checks for the things that came up - there have been umpteen patches. So, the stuff that you have will still probably throw up problems. The next snapshot should solve all of this. After my last build effort, I think that we had managed to fix all the remaining Mingw issues.
But when I am more settled, I can send you a copy of my 'os-hacks.h' file. Frank can tell you where you need to '#include' it.
That would be wonderful, thanks! Please send it to my address on this message.
Ok.
Best regards, The Chief ----- Dr Abimbola A Olowofoyeku (The African Chief) Email: laa12@keele.ac.uk Author of Chief's Installer Pro v5.21.1 for Win32 http://ourworld.compuserve.com/homepages/African_Chief/chief32.htm
On 21 Jan 00, at 9:58, Dr A Olowofoyeku wrote:
Your problem is probably due to things that are missing in the gcc Mingw libraries (and there are many of them).
I have tracked my specific problem down to the lack of a "pwd.h" file in Mingw (thanks, Chief!). The trouble is that "_p_pwl2c" in "rts.c" references the "passwd" struct, which is defined in "pwd.h", but "pwd.h" isn't part of Mingw. This is detected by the Pascal "configure", which sets "#undef HAVE_PWD_H" in "rts-config.h" but is not covered by alternate code in "rts.c". The result is a syntax error when compiling.
-- Dave