Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Mar 2012 11:40:15 +0200
From:      Volodymyr Kostyrko <c.kworr@gmail.com>
To:        Doug Hardie <bc979@lafn.org>
Cc:        "questions@FreeBSD.org" <questions@freebsd.org>
Subject:   Re: Dynamic Libraries
Message-ID:  <4F572CFF.8030708@gmail.com>
In-Reply-To: <E64D58F0-0EDD-46A1-B022-2CC8BB64BC29@lafn.org>
References:  <E64D58F0-0EDD-46A1-B022-2CC8BB64BC29@lafn.org>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Doug Hardie wrote:
> I have encountered something that I do not understand.  Everything works fine.  Basically I have a bunch of user modules (low level) that are built into a dynamic library.  If I write top level code that calls modules in that library, everything works just fine on i386 and AMD64.  However, the application involved has another library of modules.  Some of them call modules in the low level library.  The top level code call modules in both libraries.  Often when it calls a module in the mid level library, that module calls several modules in the low level library.
>
> All this works just fine on i386.  However, when I compile everything on AMD64 I get an error message that says the lower level library needs to be compiled with fPIC.  If I add that to the Makefile for the lower level library and rebuild everything, it all works again.  I don't understand why the fPIC is required for AMD64.
>
> Also, how do I tell if the lower level library is being dynamically linked at run time, or being directly incorporated into the mid level library or top level application?  Since both of these libraries are quite large, and they are in use by a number of top level applications, I want just one copy to exist in physical memory.

This sounds exactly like compiling with clang through ccache. There are 
issues with clang and ccache cooperation. Actually the one you may hit 
is libtool detecting implicit fPIC requirement when running clang 
through ccache.

-- 
Sphinx of black quartz judge my vow.



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?4F572CFF.8030708>