Date: Sun, 21 Mar 2004 04:03:13 +0900 (JST) From: Hiroki Sato <hrs@FreeBSD.org> To: chat95@mac.com Cc: kris@obsecurity.org Subject: Re: -fPIC or -fpic? Message-ID: <20040321.040313.90113953.hrs@eos.ocn.ne.jp> In-Reply-To: <20040319.142958.783378669.chat95@mac.com> References: <20040317111525.GA62305@xor.obsecurity.org> <20040317171904.GC93838@dragon.nuxi.com> <20040319.142958.783378669.chat95@mac.com>
next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart(Sun_Mar_21_04_03_14_2004_799)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Nakata Maho <chat95@mac.com> wrote in <20040319.142958.783378669.chat95@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 ----Security_Multipart(Sun_Mar_21_04_03_14_2004_799)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAXJVyTyzT2CeTzy0RAgzCAJoCbxVTVptj643rWSNov5b+emUdewCg32NN XscsN9x/abRBfqtGRhm4jSo= =/AKG -----END PGP SIGNATURE----- ----Security_Multipart(Sun_Mar_21_04_03_14_2004_799)----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040321.040313.90113953.hrs>