automake
[Top][All Lists]
Advanced

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

Re: automake and shared libraries


From: Andrew Suffield
Subject: Re: automake and shared libraries
Date: Tue, 29 Jul 2003 17:52:32 +0100
User-agent: Mutt/1.5.4i

On Tue, Jul 29, 2003 at 02:34:14PM +0200, Mattias Br?ndstr?m wrote:
> On Tue, 29 Jul 2003, Alexandre Duret-Lutz wrote:
> 
> > On Tue, Jul 29, 2003 at 01:16:53PM +0200, Mattias Br?ndstr?m wrote:
> > [...]
> > > automake: src/rkcone/common/Makefile.am: object `Exception.lo' created
> > > both with libtool and without
> > [...]
> > > I suspect there is an obvious solution to this that I am missing. Can
> > > someone set a library building newbie on the right path here? =)
> > [...]
> >
> > http://sources.redhat.com/ml/automake/2002-08/msg00128.html
> >
> 
> Unfortunateley I still fail to see how I can avoid the above problem.
> Building a convenience library would seem to solve the problem, but if I
> do that I am at the same place that I started this thread. Doing :
> 
>    librkcone_LDADD = common/libcommon.a
> 
> is for some reason not a portable thing to do?

To give you a little background:

Objects which are included in shared libraries need to be compiled
with -fPIC. Objects which are included in static libraries should be
compiled without -fPIC. On i386, it is possible to include non-PIC
code in a shared library; this does not work anywhere else, and it's
slow on i386 anyway.

A static or convenience library is usually built without -fPIC, so
it can't be included in a shared library.

It doesn't have to be, though. It would be possible for automake to
build convenience libraries with -fPIC where necessary - it just
doesn't. Actually, this might be hackable by stuffing -fPIC in the
relevant CFLAGS variable - then the warning is spurious.

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'                          |
   `-             -><-          |

Attachment: pgpaIDz5hMa6F.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]