RE: compiling g++ 3.2.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
platforms.

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'.

Thanks,
Lyle


-----Original Message-----
From: gcc-help-owner@xxxxxxxxxxx [mailto:gcc-help-owner@xxxxxxxxxxx] On
Behalf Of David Edelsohn
Sent: Monday, June 21, 2004 1:10 PM
To: Tan-Long Phan
Cc: gcc-help@xxxxxxxxxxx
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
library
Phan> (.so) with another one (.so). What linker option should I use to
link
Phan> differents (extension .so) libraries together? if I put -l option
followed
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,
but
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
intend.

David


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux