From owner-cvs-all@FreeBSD.ORG Thu Mar 18 23:35:30 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BDFC16A4CE; Thu, 18 Mar 2004 23:35:30 -0800 (PST) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68F4443D2D; Thu, 18 Mar 2004 23:35:29 -0800 (PST) (envelope-from ru@ip.net.ua) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.10/8.12.9) with ESMTP id i2J7e7CP049052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Mar 2004 09:40:08 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.12.11/8.12.11) id i2J7ZLOK018193; Fri, 19 Mar 2004 09:35:21 +0200 (EET) (envelope-from ru) Date: Fri, 19 Mar 2004 09:35:21 +0200 From: Ruslan Ermilov To: Nakata Maho Message-ID: <20040319073521.GA18091@ip.net.ua> References: <200403171047.i2HAlUsL048731@repoman.freebsd.org> <20040317111525.GA62305@xor.obsecurity.org> <20040317171904.GC93838@dragon.nuxi.com> <20040319.142958.783378669.chat95@mac.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline In-Reply-To: <20040319.142958.783378669.chat95@mac.com> User-Agent: Mutt/1.5.6i X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: maho@FreeBSD.org cc: cvs-ports@FreeBSD.org cc: ports-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: kris@obsecurity.org Subject: Re: -fPIC or -fpic? X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2004 07:35:30 -0000 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 19, 2004 at 02:29:58PM +0900, Nakata Maho wrote: > Dear all, >=20 > obrien give me detailed explanation the difference > -fpic and -fPIC (thanks!), > however, as kris told me, we must test which is better. > currently, it seems only for sparc64 -fPIC make sence, > so, in /usr/share/mk/bsd.lib.mk, we find, >=20 > .if !defined(PICFLAG) > .if ${MACHINE_ARCH} =3D=3D "sparc64" > PICFLAG=3D-fPIC > .else > PICFLAG=3D-fpic > .endif > .endif >=20 > this is a good choice. >=20 > However, in the framework of ports, there's no way to do this since: > % grep fPIC /usr/ports/Mk/bsd.* > % > % grep fpic /usr/ports/Mk/bsd.* > % >=20 > so I have to hardcode this, and I don't like to this. > (see in math/atlas, math/atlas-devel, and biology/pymol) >=20 > Otherwise, this patch (for example, math/atlas) >=20 > @@ -49,13 +49,7 @@ > @(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/alpha-patch) > .endif > =20 > -.if !defined(PICFLAG) > -.if ${MACHINE_ARCH} =3D=3D "sparc64" > -PICFLAG=3D-fPIC > -.else > -PICFLAG=3D-fpic > -.endif > -.endif > +.include >=20 >=20 > doesn't help me > % make > Warning: Object directory not changed from original /home/maho/work/ports= /math/atlas >=20 > Note: > at least amd64, in some cases, we need -fpic or -fPIC when we make > shared libraries. some programs don't set such flag when compiling as you= know. > in i386, we don't need -fpic to make shared lib, so we force to make > shared lib from static ones, so this can be a big problem. > at least in the ports, we need PICFLAG definiton. >=20 > putting this in bsd.port.mk > .if !defined(PICFLAG) > .if ${MACHINE_ARCH} =3D=3D "sparc64" > PICFLAG=3D-fPIC > .else > PICFLAG=3D-fpic > .endif > .endif >=20 > is not a good idea at all, since it doesn't sync with bsd.lib.mk. > splitting bsd.lib.mk to bsd.lib.pic.mk that contains only this, > then include at bsd.port.mk might be a better idea, but still dirty. >=20 > How do I do? >=20 PICFLAG!=3D ${MAKE} -f bsd.lib.mk -V PICFLAG Cheers, --=20 Ruslan Ermilov FreeBSD committer ru@FreeBSD.org --RnlQjJ0d97Da+TV1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAWqK5Ukv4P6juNwoRAqTXAJ4/YAIo/CWq6A0j3EEQDb6SgOyvWwCfWWGl +u1PhOnjNMm8U3NG3Vxpkg0= =xxcf -----END PGP SIGNATURE----- --RnlQjJ0d97Da+TV1--