Re: Libraries and position independent code (-fPIC)
Marcin Owsiany <porridge@debian.org> immo vero scripsit:
> I read somewhere that code compiled with -fPIC is a little larger and
> slower. Is this the only reson for that policy requirement? If not,
> please give me for some information/pointers on that requirement.
I think that is mostly so.
Without -fPIC shared libraries will have problems,
with -fPIC, code gets larger, and slower.
I would convince upstream to use libtool.
Besides, adding rules to build different objects is trivial.
Call the library objects .lo, and add rules to :
sources=whatever.c somethingelse.c other.c
libtarget.whatever.so: ${sources:.c=.lo}
libtarget.a: ${sources:.c=.o}
%.lo: %.c
gcc -fPIC ......
%.o: %.c
gcc ....
regards,
junichi
--
dancer@debian.org : Junichi Uekawa http://www.netfort.gr.jp/~dancer
GPG Fingerprint : 17D6 120E 4455 1832 9423 7447 3059 BF92 CD37 56F4
Libpkg-guide: http://www.netfort.gr.jp/~dancer/column/libpkg-guide/
--
To UNSUBSCRIBE, email to debian-mentors-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: