On 30 Jun 2001, at 20:25, Nicola Girardi wrote:
...but when I run i...-mingw32-gpc I get a message about collect2 missing. And in fact, it is missing. Only symlinking ld to collect2 works smoothly. Why does that happen?
"collect2" appears to be involved with ensuring that C++ constructors and destructors are called correctly. I do not believe that it has any function in GPC.
See:
http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_3.html#SEC59
"collect2" is being called because the GPC build process creates a "specs" file that has this section present:
*linker: collect2
During the build process, the "specs" file is created by executing these commands:
./xgcc -dumpspecs > tmp-specs mv tmp-specs specs
Note that the "specs" file is created by running "xgcc" and not "xgpc".
"gpc.c" is based on "gcc.c". However, newer versions of "gcc.c" (e.g., 2.95.3) check to see if "collect2" exists. If not, "ld" is called in its place. Perhaps that check should be migrated to "gpc.c".
The workaround you have used is OK. Other GPC-specific workarounds are to change the "specs" entry to:
*linker: ld
...or to regenerate a GPC-specific "specs" file:
gpc -dumpspecs > specs
(and then move the resulting "specs" file to the appropriate place).
-- Dave