public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Perry Smith <pedzsan@gmail.com>
To: gcc@gcc.gnu.org
Subject: AIX library issues
Date: Tue, 18 Oct 2011 04:48:00 -0000	[thread overview]
Message-ID: <BEABC729-50AE-4EF6-B1F7-C6CB656807F5@gmail.com> (raw)

I've discovered an issue which I can't believe I'm the first to bump
in to.  But I've checked older gcc installs and find the same issue.
I did a brief internet search and found sorta similar issues but I'm
not sure if they explained it as I see it.

I bumped into this while trying to build lzma.  What follows is from a
gcc 4.5.2 build using gcc 4.5.2 to compile it running AIX 6.1 TL05
SP06.  But, as I said, I've compared this to output produced by a gcc
4.3.1 running on AIX 5.3 with the same results.

On AIX, there is a tool called dump.  dump -H <file> dumps out the
header of the loader section.

When I link lzma and try to run it, it dies with a long error (that I
won't post).  In essence it boils down to this: lzma needs libstdc++.
In that archive is one shared object.  The loader can find lzma and
can find the libstdc++ object but it can not load either because
libstc++ depends upon another library that the loader can not find.
Here is why:

dump -H libstdc++.so.6

./powerpc-ibm-aix6.1.0.0/libstdc++-v3/src/.libs/libstdc++.so.6.orig:

                        ***Loader Section***
                      Loader Header Information
VERSION#         #SYMtableENT     #RELOCent        LENidSTR
0x00000001       0x00000fe0       0x000033b6       0x000000da       

#IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
0x00000003       0x0003e9a8       0x0002dec7       0x0003ea82       


                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER              
0      /usr/work/build/gcc-4.5.2/powerpc-ibm-aix6.1.0.0/libstdc++-v3/src:/usr/work/build/gcc-4.5.2/powerpc-ibm-aix6.1.0.0/libstdc++-v3/src/.libs:/usr/work/build/gcc-4.5.2/./gcc:/usr/lib:/lib                                         
1                                    libc.a              shr.o               
2                                    libgcc_s.a          shr.o               

What this is telling us is that libstdc++.so.6 needs libc.a(shr.o) and
libgcc_s.a(shr.o) and it is also telling us that when libc.a(shr.o)
and libgcc_s.a(shr.o) is needed at run time, the list of places
searched is the list of directories listed in entry 0.  But the list
is the list of where the library is built -- not where it (or more
importantly where libgcc_s.a) will be installed.  When I configured
and built this gcc, prefix path was set to
/gsa/ausgsa/projects/r/ruby.

Here are the first few lines of my config.log:

 /usr/work/src/gcc-4.5.2/configure --prefix=/gsa/ausgsa/projects/r/ruby --with-gmp=/gsa/ausgsa/projects/r/ruby --with-mpfr=/gsa/ausgsa/projects/r/ruby --with-mpc=/gsa/ausgsa/projects/r/ruby --disable-nls --enable-threads=aix --with-libiconv-prefix=/usr --enable-languages=c,c++

I have told configure that /gsa/ausgsa/projects/r/ruby is the place I
plan to install this compiler.  Yet its search path does not include
this path at all.  For most (perhaps all) of the other shared objects,
the path doesn't make THAT much difference because the only library
needed is libc.a and it will be found in /usr/lib.

The executables suffer from the same thing.  Again, it doesn't seem to
matter since they only include libc.a.

I've been told but I do not know for sure that libtool understands
AIX's peculiarities.  In particular, what needs to happen is a relink
needs to be done.  The executables and libraries are correct for
testing the results in the current directory.  But they are not
correct when the final result is moved into the place it was designed
to go in to.

The good news is that a program compiled with gcc produces an object
file with the proper path so all the programs produced from the final
gcc are correct.

I'm fairly sure that this isn't a pilot error (I somehow botched the
call to configure or something like that) but I sure would be happy to
find out it was my fault.  This seems like a rather hard nut to crack.

I hope all this is clear.  I'm more than happy to help out in solving
this.

Thank you,
pedz

             reply	other threads:[~2011-10-18  2:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18  4:48 Perry Smith [this message]
2011-10-18  8:30 ` Jonathan Wakely
2011-10-18 10:28   ` Jonathan Wakely
2011-10-18 15:37 ` David Edelsohn
2011-10-24  0:59   ` Perry Smith
2011-10-24  2:36     ` David Edelsohn
2011-10-24  9:45       ` Perry Smith
     [not found]       ` <5FB999D3-E0FA-4AC7-A26A-DAA4397D833F@gmail.com>
2011-10-25  6:31         ` David Edelsohn
2011-10-25  9:13           ` Richard Guenther
2011-10-25  9:24             ` Arnaud Charlet
2011-10-25 15:14               ` David Edelsohn
2011-10-25 16:05                 ` Arnaud Charlet
2011-11-08 18:44                   ` David Edelsohn

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=BEABC729-50AE-4EF6-B1F7-C6CB656807F5@gmail.com \
    --to=pedzsan@gmail.com \
    --cc=gcc@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).