Re: [i386] Why g++ _always_ link an executable with libm.so?

Mike Hearn <[email protected]>
Newsgroups gmane.comp.gcc.devel,gmane.linux.gcc
Message-ID <[email protected]>
On Tue, 04 Jan 2005 18:06:51 -0500, Andrew Pinski wrote:
> Then write a better collect2 which only links in the libraries which
> are needed and have it find the needed libraries without supplying
> the option to link the library (yes this is on the TODO page of gcc).

I thought there was already an option for this in ld, --as-needed or
something.

I also find it strange (broken) that a c++ app that doesn't use any libm
symbols is linked to it anyway. Why does it matter? If stdc++ needs it
then fine, but the link tree should look like:

a.out
  - libc.so.6
  - libstdc++.so.6
       - libm.so.6
       - libc.so.6

and so on. Why does the link tree not look how you'd intuitively expect it
to?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.