From owner-cvs-all@FreeBSD.ORG Thu Mar 18 21:23:56 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 40A1C16A4CE; Thu, 18 Mar 2004 21:23:56 -0800 (PST) Received: from debussy.private.org (25.60.138.210.bn.2iij.net [210.138.60.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD89B43D1F; Thu, 18 Mar 2004 21:23:55 -0800 (PST) (envelope-from chat95@mac.com) Received: from localhost (localhost [127.0.0.1]) by debussy.private.org (8.12.10/8.12.10) with ESMTP id i2J5Tw9r005139; Fri, 19 Mar 2004 14:29:58 +0900 (JST) (envelope-from chat95@mac.com) Date: Fri, 19 Mar 2004 14:29:58 +0900 (JST) Message-Id: <20040319.142958.783378669.chat95@mac.com> To: kris@obsecurity.org, maho@FreeBSD.org, ports-committers@FreeBSD.org, cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org From: Nakata Maho In-Reply-To: <20040317171904.GC93838@dragon.nuxi.com> References: <200403171047.i2HAlUsL048731@repoman.freebsd.org> <20040317111525.GA62305@xor.obsecurity.org> <20040317171904.GC93838@dragon.nuxi.com> Organization: private X-Mailer: Mew version 3.3 on XEmacs 21.4.14 (Reasonable Discussion) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: -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 05:23:56 -0000 Dear all, 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, .if !defined(PICFLAG) .if ${MACHINE_ARCH} == "sparc64" PICFLAG=-fPIC .else PICFLAG=-fpic .endif .endif this is a good choice. 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.* % so I have to hardcode this, and I don't like to this. (see in math/atlas, math/atlas-devel, and biology/pymol) Otherwise, this patch (for example, math/atlas) @@ -49,13 +49,7 @@ @(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/alpha-patch) .endif -.if !defined(PICFLAG) -.if ${MACHINE_ARCH} == "sparc64" -PICFLAG=-fPIC -.else -PICFLAG=-fpic -.endif -.endif +.include doesn't help me % make Warning: Object directory not changed from original /home/maho/work/ports/math/atlas 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. putting this in bsd.port.mk .if !defined(PICFLAG) .if ${MACHINE_ARCH} == "sparc64" PICFLAG=-fPIC .else PICFLAG=-fpic .endif .endif 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. How do I do? --nakata maho