This is the mail archive of the
mailing list for the GCC project.
RE: compiling g++ 3.2.3
- From: lrtaylor at micron dot com
- To: <dje at watson dot ibm dot com>, <longp at cae dot com>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Mon, 21 Jun 2004 13:23:36 -0600
- Subject: RE: compiling g++ 3.2.3
Actually, AIX has three library concepts or types on the Power platform
rather than the traditional two. There are static libraries (which are
.a archive files just like those you see on many other UNIX platforms),
shared libraries (which are special .a archive files that are built in
such as way as to be linked in dynamically at run time - as opposed to
statically like normal .a files are), and shared objects (the
traditional .so file). The terms "shared library" and "shared object"
are not synonymous on AIX like they essentially are on many other UNIX
AIX links to libraries ending in .a by default. This does not mean that
it is linking statically by default, unless the library it finds is a
static library. In order to tell the linker to link to .so files by
default, you need to specify the -brtl option (for run-time linking as
they call it). That's the option that is passed to IBM's VisualAge
compiler, so I don't know if GCC recognizes it. If it doesn't, then you
might try '-Wl,-brtl'.
From: email@example.com [mailto:firstname.lastname@example.org] On
Behalf Of David Edelsohn
Sent: Monday, June 21, 2004 1:10 PM
To: Tan-Long Phan
Subject: Re: compiling g++ 3.2.3
>>>>> Tan-Long Phan writes:
Phan> I'm compiling c++ code under AIX 4.3, I would like to link dynamic
Phan> (.so) with another one (.so). What linker option should I use to
Phan> differents (extension .so) libraries together? if I put -l option
Phan> by the library name it would link statically.
I am a little confused by your description. You are trying to
create a shared library on AIX that depends on another shared library?
Adding the dependent shared library on the link line creating the new
shared library should work. What do you mean by "it would link
statically"? Adding the library to the link line will not include the
code from the old library in the new one.
Are you sure that the libraries you created are shared objects?
AIX shared objects normally have file extension ".a", not ".so", and
normally are an *ARCHIVE* of shared objects, not a bare shared object,
AIX will deal with either. AIX ignores shared libraries with ".so"
extension unless the AIX linker -G (to create) / -brtl (to use) options
are used. If you are forcing the AIX linker to use the files with the
incorrect file extensions, the linker may be using different files than
you expect or you may be invoking different linker semantics than you