linux-gcc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denis Zaitsev <zzz@anda.ru>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: gcc@gcc.gnu.org, linux-gcc@vger.kernel.org
Subject: Re: [i386] Why g++ _always_ link an executable with libm.so?
Date: Thu, 6 Jan 2005 03:25:45 +0500	[thread overview]
Message-ID: <20050106032545.L1437@natasha.ward.six> (raw)
In-Reply-To: <m3hdlwpv5h.fsf@uniton.integrable-solutions.net>; from gdr@integrable-solutions.net on Wed, Jan 05, 2005 at 01:38:34AM +0100

On Wed, Jan 05, 2005 at 01:38:34AM +0100, Gabriel Dos Reis wrote:
> Denis Zaitsev <zzz@anda.ru> writes:
> 
> | On Tue, Jan 04, 2005 at 11:30:05PM +0100, Gabriel Dos Reis wrote:
> | > Denis Zaitsev <zzz@anda.ru> writes:
> | > | 
> | > |   a) why g++ assumes that libstdc++ is always needed?
> | > 
> | > Because that is the way it is designed.  If you don't want libstdc++,
> | > say -nostdlib as explained in our documentation.
> | 
> | This doesn't work out of the box...
> 
> If -nostdlib does not work as explained in the documentation, then you
> might have found a bug.  If you don't explain why it does not work as
> explained in the documentation or do not a fill a proper bug report,
> the probability that it gets fixed is near to zero.

It is not explained in the doc. in a much details.  So I don't know
either it is error or what.  In short, -nostdlib leads to the 'no std
objects' as well, and, as I understand, I must link them explicitly.
Or what does this mean:

/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 08048094

?

> | Ok, but do we force users to use libm every time libc is used?
> 
> What is libc?  How do you define it?

I assume GLIBC, of course.  For x86, but I don't know either this
matters.

> |  No, we
> | don't.  Of course, we don't.  And I emphasised the word 'always':
> | not _every_ routine from libstdc++ need libm, but it always
> | required...
> 
> The C++ standard library is a whole entity (minus the "freestanding"
> part) that is hard to split in meaningfully independent parts.
> Personnaly, I have zilk interest in splitting it into zillions
> arbitrary parts (or maintain such splits) and require users to supply
> zillions -lxxx switches. 
> 
> As a C++ user, when I say
> 
>    copy(istream_iterator<int>(cin), istream_iterator<int>(),
>         back_insert(v));
> 
> I have no idea of which of those zillions parts are involved
> underneath, I do not want to know, and a fortiori I do not want to
> be required to supply a cabalistic combination of switches to get it
> work. The compiler is better at that than I.

No, no, no...  The initial question has been asked having this in
mind: why the dependencies are used per-shared-object vs. per-module-inside-it?
As I understand now, it's impossible to have that per-module deps for
elf shared objects.  Ok, it's no a question more.

But then another question: if libstdc++ itself has libm in its NEEDED
list, why the whole app having libstdc++ in its NEEDED list is forced
(by the linker?) to have libm there too?  While the app itself never
really needs that libm?

  reply	other threads:[~2005-01-05 22:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-04 22:01 [i386] Why g++ _always_ link an executable with libm.so? Denis Zaitsev
2005-01-04 22:05 ` Daniel Jacobowitz
2005-01-04 22:18   ` Denis Zaitsev
2005-01-04 22:30     ` Gabriel Dos Reis
2005-01-04 22:59       ` Denis Zaitsev
2005-01-04 23:06         ` Andrew Pinski
2005-01-04 23:16           ` Denis Zaitsev
2005-01-05  0:40           ` Gabriel Dos Reis
2005-01-05 17:14           ` Mike Hearn
2005-01-05 18:21             ` Andrew Pinski
2005-01-05 18:51               ` Mike Hearn
2005-01-05 18:48                 ` Andrew Pinski
2005-01-05 19:10                   ` Mike Hearn
2005-01-05 22:09               ` Denis Zaitsev
2005-01-05 22:16                 ` Andrew Pinski
2005-01-05 22:30                   ` Denis Zaitsev
2005-01-05 22:32                     ` Andrew Pinski
2005-01-05 22:39                 ` Gabriel Dos Reis
2005-01-05  0:38         ` Gabriel Dos Reis
2005-01-05 22:25           ` Denis Zaitsev [this message]
2005-01-05 22:30             ` Andrew Pinski
2005-01-05 22:44             ` Gabriel Dos Reis
2005-01-05 22:55               ` Denis Zaitsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050106032545.L1437@natasha.ward.six \
    --to=zzz@anda.ru \
    --cc=gcc@gcc.gnu.org \
    --cc=gdr@integrable-solutions.net \
    --cc=linux-gcc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).