- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I want to build a library *.a that can be used for building share libraries and consequently link these with dynamic executables.
I want to use the same *.a library to build other static object as well.
I compiled the objects that go within this *.a library with -fPIC option (packet afterwards with ar ). As a result the objects that are inside *.a are suitable for creating share objects
the question : Are the object inside of *.a suitable for building static object ? I did a test case and It seems to be working . Any Recommendation or observation , am I getting away from the cannonical form? or it is indifferent
Regards
riveraro
I want to build a library *.a that can be used for building share libraries and consequently link these with dynamic executables.
I want to use the same *.a library to build other static object as well.
I compiled the objects that go within this *.a library with -fPIC option (packet afterwards with ar ). As a result the objects that are inside *.a are suitable for creating share objects
the question : Are the object inside of *.a suitable for building static object ? I did a test case and It seems to be working . Any Recommendation or observation , am I getting away from the cannonical form? or it is indifferent
Regards
riveraro
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are several good on-line references, e.g.
http://www.linux.org/docs/ldp/howto/Program-Library-HOWTO/shared-libraries.html
As far as I could see, the only likely loss with -fPIC in static libraries is the possible increase in code size and function call overhead.
http://www.linux.org/docs/ldp/howto/Program-Library-HOWTO/shared-libraries.html
As far as I could see, the only likely loss with -fPIC in static libraries is the possible increase in code size and function call overhead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the answer
I did read the article , specifically I couldn't find the answer , but googling for it , it seems to be not such a good idea .
Maybe more details :
I am able to build shared libraries with a normal *.a (this library is given and i can't rebuild it myself )
as expected if I build my objects and I try to link with the library *.a i get the error "the *.a was not compile with -fPIC cannot buld shared objects...."
the work around I figured out was , I compiled all object with the normal *.a library and -fPIC option
I have a collection of objects. I simply linked the objects to form the shared library and it works. If the performance is Ok , that is the question ?
I did read the article , specifically I couldn't find the answer , but googling for it , it seems to be not such a good idea .
Maybe more details :
I am able to build shared libraries with a normal *.a (this library is given and i can't rebuild it myself )
as expected if I build my objects and I try to link with the library *.a i get the error "the *.a was not compile with -fPIC cannot buld shared objects...."
the work around I figured out was , I compiled all object with the normal *.a library and -fPIC option
I have a collection of objects. I simply linked the objects to form the shared library and it works. If the performance is Ok , that is the question ?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page