From owner-freebsd-amd64@FreeBSD.ORG Fri Sep 26 18:14:52 2008 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 027B11065686 for ; Fri, 26 Sep 2008 18:14:52 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from parsely.rain.com (parsely.rain.com [199.26.172.196]) by mx1.freebsd.org (Postfix) with ESMTP id 4D0408FC0A for ; Fri, 26 Sep 2008 18:14:51 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from sopwith.solgatos.com (uucp@localhost) by parsely.rain.com (8.11.4/8.11.4) with UUCP id m8QIEkM65177 for freebsd-amd64@freebsd.org; Fri, 26 Sep 2008 11:14:46 -0700 (PDT) (envelope-from freebsd@sopwith.solgatos.com) Received: from localhost by sopwith.solgatos.com (8.8.8/6.24) id SAA00764; Fri, 26 Sep 2008 18:12:31 GMT Message-Id: <200809261812.SAA00764@sopwith.solgatos.com> To: freebsd-amd64@freebsd.org In-reply-to: Your message of "Fri, 26 Sep 2008 20:10:18 +0300." <20080926171018.GX47828@deviant.kiev.zoral.com.ua> Date: Fri, 26 Sep 2008 11:12:31 +0100 From: Dieter Subject: Re: amd64/127640: GCC will not build shared libraries with -fprofile-generate on amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2008 18:14:52 -0000 > > > Note that libgcov needs to be recompiled with -fPIC. > > > The R_X86_64_32 issue is systematic on amd64. When you build a shared > > > object, better make sure that all .o are compiled with -fPIC. > >=20 > > So shouldn't the system come with both static and shared versions > > of all the libraries? > > The system does. OP linked system supplied libgcov.a into .so. > Should /usr/lib/libgcov.a be built with -fPIC, is debatable. I think it > is overkill for most other static libs from /usr/lib. Note that there > are reasonable arguments against supplying static system libraries like > libc and libpthread. The thread started with "porting a specialized database library to FreeBSD". One can expect problems when porting new code. But the PIC problem is bigger than that. Ports don't compile due to this problem. Ports should compile cleanly out of the box, on all archs, with no problems. Example: On amd64, 7.0, try to build python25. I get: /usr/bin/ld: /usr/lib/crtbeginT.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC /usr/lib/crtbeginT.o: could not read symbols: Bad value *** Error code 1 Stop in /usr/ports/lang/python25/work/Python-2.5.1/portbld.shared.