-fPIC or -fpic?

Hiroki Sato hrs at FreeBSD.org
Sat Mar 20 11:06:00 PST 2004


Nakata Maho <chat95 at mac.com> wrote
  in <20040319.142958.783378669.chat95 at mac.com>:
chat95> Note:
chat95> at least amd64, in some cases, we need -fpic or -fPIC when we make
chat95> shared libraries. some programs don't set such flag when compiling as you know.
chat95> in i386, we don't need -fpic to make shared lib, so we force to make

 No, even if for i386 we should add -fpic.  Without -fpic (or -fPIC)
 the dynamic loader has to perform the relocation, and as a result it
 creates a private copy of the library for each process at runtime.

chat95> is not a good idea at all, since it doesn't sync with bsd.lib.mk.
chat95> splitting bsd.lib.mk to bsd.lib.pic.mk that contains only this,
chat95> then include at bsd.port.mk might be a better idea, but still dirty.
chat95> 
chat95> How do I do?

 Since this problem depends on the program, putting -fPIC globally
 is not a good solution and application developers should take
 care of it, I think.

-- 
| Hiroki SATO
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20040321/cfc8649e/attachment.bin


More information about the cvs-all mailing list