On Sun, Feb 22, 2015 at 08:18:33PM +0100, Bernhard R. Link wrote:
> > Here are two scenarios where building a static library (libfoo) with
> > -fPIC is desirable:
> >
> > * libbar has a stable API, so it should be shipped as a .so,
> > but if it links libfoo.a, and libfoo.a is not -fPIC, then
^^^^^^^^^^^^^^^^^
> > libbar has to be shipped as a a static library too
>
>
> This is wrong. If libbar.so needs libfoo.a then libfoo.a does not
> need to be PIC:
>
> echo 'int foo(void) {return 17;}' > foo.c
> echo 'int bar(void) {return foo();}' > bar.c
> echo 'int main() {return bar();}' > main.c
> gcc -c -Wall foo.c
> ar rs libfoo.a foo.o
> gcc -shared -fPIC -Wall bar.c -o bar.so
Are you suggesting to make a shared lib with undefined symbols?
--
WBR, wRAR
Attachment:
signature.asc
Description: Digital signature