This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
(egcs-mingw32/cygwin32) The collect2/ld problem workaround
- To: gnu-win32 at cygnus dot com
- Subject: (egcs-mingw32/cygwin32) The collect2/ld problem workaround
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Mon, 22 Dec 1997 14:35:10 -0600
For those of who've found the mysterious "collect2 exited with status 1"
error after seemingly being hung for a while, here's what happens:
- gcc invokes ld.exe in gcc's library directory (you can see what that
is by running `gcc -print-prog-name=ld'). This is the program
otherwise known as collect2 and needed for C++, especially for -frepo
and exception handling.
- collect2 (installed as ld.exe in library directory) does its thing
and then looks for the *real* ld.exe (GNU ld) according to a set of
rules (LIBRARY_PATH+COMPILER_PATH env variables, PATH, etc) and
execs that to do the final link editing.
Due to a bug in collect2, it's finding itself first (since it's called
ld.exe) and execing itself causing a recursion and eventually chokes.
Solution? Install the real ld.exe (GNU ld that's installed as ld.exe in
the binary directory) as collect-ld.exe in the directory where cc1.exe
lives (that's called gcc library/compiler directory). This is the
directory you see when you use the command `gcc -print-prog-name=cc1'.
Now ld.exe will exec collect-ld.exe instead and all will be well.
I know the problem exists for cygwin32, but not sure about mingw32. The
workaround above is safe for either case, so I recommend you do it.
I'll hopefully have a fix out soon.
Mumit
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".