> What is GCC doing wrong?
See for yourself by using "gcc -v ...".
You'll have to propagate the -v into the invocation of .../collect2
by yourself in order to see the actual invocation of ld.
Or, you could run "strace -f -e trace=execve gcc ...".