I wrote:
> I studied the ld man page for awhile but couldn't find any fix other
> than the one Tatsuo suggests of trying to run the linked test program.
> That means we have to guess at what to do in a cross-compilation.
> I suppose the safest choice is to not try to use --as-needed when
> cross-compiling, but does anyone want to argue for the other choice?
I've applied a patch along these lines. I checked it on RHEL-4 and it
seems to work as expected.
regards, tom lane