Prof A Olowofoyeku (The African Chief) wrote:
On 14 Feb 2003 at 15:29, Maurice Lombardi wrote:
[...]
What problem is this?
I have first downloaded your binaries, and installed them in my mingw tree (installed also gcc-3.2.2 from sourceforge). When trying to compile some pascal programs gpc answers that it cannot find as.exe, with a full path written with forward slashes. I then tried to compile gpc from your sources in W98, and it dies with similar message when xgpc wants to compile the first pascal program in the rts.
Yes, I have found the problem. It seems that "GPC" is never defined for xm-mingw32.h during compilation. So the condition "#ifdef GPC" is never satisfied. I wouldn't have thought that one needed to pass "-DGPC" at the command line - Frank, am I missing something?
`-DGPC' is used for the GPC specific changes, so the C compiler is not affected by them. Each patched source file is compiled twice -- for gcc without and for gpc with `-DGPC'. Therefore, `-DGPC' should not be given at the command line.
So what would have to be done here is to figure out all source files affected by this change (which include xm-mingw32.h directly or indirectly) and have them compiled again with `-DGPC' from the Makefile. Actually, I wonder which ones these are since gpc.c is compiled with `-DGPC', anyway, so it must be something else!?
I have made something stupid. Compiled it with MSYS-1.0.8 (1.0.9 had a bug) and latest mingw tools from sourceforge, with your sources, except replacing in xm-mingw2.h #ifdef GPC by #ifdef TARGET_W9x (like in 2.95.x)
This seems to be the solution (i.e., replacing #ifdef GPC by #ifdef TARGET_W9x).
That would be easier to do, but it breaks the principle that the GPC patches don't affect the C compiler. You can do so in your private patches, but I wouldn't like to include this in the "official" patches.
You synched with the FSF sources, I presume. The Mingw special sources contain their own patches, and that is where this is dealt with.
Well, then things are obvious, and kludging around with the machine file is not the right thing to do.
If the gcc.c patch is in the special mingw patches, then the gpc.c patch should also be there. (If the maintainers of the mingw patch won't accept it, you might have to make a mingw-gpc-special patch for now.) I don't want to "sync" gpc.c with inofficial gcc.c changes (which makes it harder to keep it up to date). Of course, the best solution would be to get the patch integrated in GCC. (I guess this might require some cleanups -- the #ifdef __MINGW32__ stuff doesn't seem so nice since platform specific stuff should generally go into the machine files. But that's for the GCC people to decide ...)
Frank