From owner-freebsd-amd64@FreeBSD.ORG Sun Feb 22 00:33:03 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F84016A4CE for ; Sun, 22 Feb 2004 00:33:03 -0800 (PST) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 98B0643D1D for ; Sun, 22 Feb 2004 00:33:03 -0800 (PST) (envelope-from peter@evilpete.dyndns.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id 603D12A8EB for ; Sun, 22 Feb 2004 00:33:03 -0800 (PST) (envelope-from peter@overcee.wemm.org) Received: from overcee.wemm.org (unknown [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id C79EA2C1AC for ; Sun, 22 Feb 2004 00:33:02 -0800 (PST) (envelope-from peter@overcee.wemm.org) Received: from overcee.wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (8.12.11/8.12.10) with ESMTP id i1M8X2JK010504; Sun, 22 Feb 2004 00:33:02 -0800 (PST) (envelope-from peter@overcee.wemm.org) Received: from localhost (localhost [[UNIX: localhost]]) by overcee.wemm.org (8.12.11/8.12.10/Submit) id i1M8X1FG010503; Sun, 22 Feb 2004 00:33:01 -0800 (PST) (envelope-from peter) From: Peter Wemm To: freebsd-amd64@freebsd.org Date: Sun, 22 Feb 2004 00:33:01 -0800 User-Agent: KMail/1.6 References: <4CC57F17-64E9-11D8-ACAA-000A95BAD088@raisdorf.net> In-Reply-To: <4CC57F17-64E9-11D8-ACAA-000A95BAD088@raisdorf.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200402220033.01795.peter@wemm.org> Subject: Re: CFLAGS+= -fPIC per default? X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2004 08:33:03 -0000 On Saturday 21 February 2004 07:43 pm, Hendrik Scholz wrote: > On Feb 21, 2004, at 9:59 PM, Christian Weisgerber wrote: > > Why are these shared objects not built with -fPIC in the first > > place? > > Ask the authors of the third party applications :) > Most architectures don't need -fPIC and/or it slows them down (thanks > for the > comment Peter!). Yes, exactly. Some folks thought it would be an idea to add a flag to libtool to force it to link non-pic code into shared libraries. Essentially this reduces the sharability since we do relocations on the text segment, but the flipside is that its faster on i386 and on some libraries they figured it was worth burning extra memory that would be wasted by not using -fPIC. > The ports I've dealt with either use a hand written Makefile without > honoring > CFLAGS set in the environment or without having -fPIC set since i386 > (I guess that > is what most of the guys test and run their stuff on) doesn't need > it. Ports utilizing GNU configure may check if -fPIC is supported but > usually don't > set it since it's not needed on the developers system. The real shame is that the libtool/autoconf tests that attempt to determine if -fpic can be safely left out, are not tripping because the test code they use is too simple and doesn't cause the relocations types to be emitted that cause all the trouble. ie: even the ones that actually test it with autconf aren't doing it right. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5