Attached is an experimental patch to work around the problem. It uses the `--print-needed-options' mechanism, i.e. gpc --print-needed-options <your other options> somefile.pas will output to standard error(!) the options that must be given to the actual compilations.
[...]
After applying the patch, I get this error:
../../gcc/p/lang.c: In function `lang_init': ../../gcc/p/lang.c:487: error: `flag_iso' undeclared (first use in this function)
I see that flag_iso is declared in c-common.h which is specific to C and similar language frontends.
Unfortunately many targets' conditionals seem to depend on it, so we might have to provide a more or less dummy value for it. Neither one really makes sense in a non-C language, but since generally ISO C is quite a bit saner than K&R C, I'd rather try this. But I haven't checked exactly what kind of effects it has on various targets. So try inserting:
#define flag_iso 1
I see that in mingw32.h it affects the `_stdcall' and `_cdecl' macros (with one underscore, the ones with two underscores are always defined). Are they needed?
Frank