public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Edelsohn <dje@watson.ibm.com>
To: Andrey Slepuhin <pooh@msu.ru>
Cc: egcs@cygnus.com
Subject: Re: AIX & shared libstdc++
Date: Tue, 07 Oct 1997 11:41:00 -0000	[thread overview]
Message-ID: <9710071523.AA28892@rios1.watson.ibm.com> (raw)
In-Reply-To: <3439FE5B.53F1D3CC@msu.ru>

>>>>> Andrey Slepuhin writes:

Andrey> I tried to build egcs-970929 on AIX 4.2.1 configured with
Andrey> --enable-shared
Andrey> option. The resulting shared libstdc++ was only ~600K instead of ~3M
Andrey> static one.
Andrey> This is because AIX linker does not know what symbols must be exported.
Andrey> Passing option -bexpall to linker did not solve the problem, so I tried
Andrey> to build export file manually by hacking makeC++SharedLib script. After
Andrey> removing some symbols causing linker warnings from resulting export
Andrey> file,
Andrey> I obtain shared libstdc++ with size ~2.3M and I can successfully link my
Andrey> programs with this library.
Andrey> I'm not sure that all my operation were correct and I can't check if all
Andrey> necessary symbols are included into the export file. But it seems to me,
Andrey> that the only way to receive correct shared version of libstdc++ on AIX
Andrey> is to use explicit export file. Any help will be appreciated.

	I am somewhat surprised that -bexpall does not export all
necessary symbols.  That is not the default because it can cause
significant bloat and is not the way that XLC operates.  AIX linker
performs garbage collection on symbols and removes any symbols which are
not referenced or exported.  If -bexpall does not trivially work around
the problem, one must use something like makeC++SharedLib.  Note: IBM's
C++ compiler and G++ use different name mangling schemes, so assumptions
about the internal structure of C++ symbols is incorrect.

Andrey> PS: Passing option -unix to linker is incorrect on AIX, because AIX
Andrey> linker
Andrey> recognize it as option -u with a parameter "nix". As a result there
Andrey> are
Andrey> many linker warnings.

	Who is passing -unix option to linker?  That is not in the GCC
specs.  Does libstdc++ assume that?

David

  reply	other threads:[~1997-10-07 11:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-07  2:18 Andrey Slepuhin
1997-10-07 11:41 ` David Edelsohn [this message]
1997-10-07 23:14   ` Andrey Slepuhin
1997-10-07 23:14     ` David Edelsohn
     [not found] <3439FE5B.53F1D3CC.cygnus.egcs@msu.ru>
1997-10-07  3:15 ` Jason Merrill
1997-10-07  3:48   ` Andrey Slepuhin
1997-10-09  9:26   ` Andrey Slepuhin
1997-10-09 15:14     ` Ian Lance Taylor
1997-10-13  5:05       ` Andrey Slepuhin

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=9710071523.AA28892@rios1.watson.ibm.com \
    --to=dje@watson.ibm.com \
    --cc=egcs@cygnus.com \
    --cc=pooh@msu.ru \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).