public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Is it possible/desirable to avoid using collect2 on Solaris?
       [not found] <fea8ac9f1002281215j53a70c32gc82457cc17660069@mail.gmail.com>
@ 2010-03-01 21:19 ` Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2010-03-01 21:19 UTC (permalink / raw)
  To: Joseph Garvin; +Cc: gcc-help

Joseph Garvin <joseph.h.garvin@gmail.com> writes:

> Based on the documentation here:
>
> http://gcc.gnu.org/onlinedocs/gccint/Collect2.html
>
> It appears that collect2 is inefficient in that it involves two
> passes. I've heard that the GNU linker doesn't require a second pass,
> so if you're using it collect2 should be unnecessary. I'm compiling on
> Solaris, and I know how to get GCC to invoke the GNU linker instead of
> the native Sun one (using -B to point it to a different folder) but if
> I do this and compile a file with -V I can see that it's still running
> collect2. Is there a way to suppress this or is my information
> outdated? If it is possible to avoid using collect2, do any special
> steps need to be taken when not using it or will things 'just work'?
> Google isn't being a lot of help.

Collect2 only uses a second pass if one is required.  When using GNU
ld a second pass is normally not required; it will only be needed in
some cases if you use -frepo.  So the inefficiency here is relatively
minor, basically just starting the collect2 program and having it do a
bit of argument processing and then start ld.  The collect2 program
will also run ld's stdout and stderr through the C++ demangler, but as
ld normally has no output this is cheap.

Ian

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-01 21:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <fea8ac9f1002281215j53a70c32gc82457cc17660069@mail.gmail.com>
2010-03-01 21:19 ` Is it possible/desirable to avoid using collect2 on Solaris? Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).