------- Comment #6 from davek at gcc dot gnu dot org  2010-01-21 05:00 -------
So, the optimal solution would be to avoid using the redirection wrappers when
we're statically linking.

That's still possible: those undefined references without relocs don't cause
problems in and of themselves, but only because they turn the weak undefs that
*do* have relocs strong.  The obvious solution, since we're not using the
redirection wrapper functions, is to also not include the array of weak
function pointers.

That would be trival to do by building two different versions of the CRT
startup code in Cygwin itself, one for shared linking that contains the array,
one for static linking that doesn't, and selecting the appropriate one at link
time using a spec in the backend.

That would work fine for --static, but as things stand now, it will still fail
when just --static-libstdc++ is in use.  This is because of the situation
described in the two dependency PRs (Bug 41594 and Bug 41596): you can't test
for --static-libstdc++ in a spec, because the code in g++spec.c removes it from
the command-line.

So, I'm going to leave this bug open and suspend it now I've committed the
simple fix.  Then, next stage 1, we'll get the situation with
--static-libstdc++ resolved one way or another, and by that time I'll have
added the alternative startup CRT object to the Cygwin runtime, and then I'll
revert this fix and adjust the linker spec to select the correct startup
variant.


-- 

davek at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |SUSPENDED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42818

Reply via email to