From owner-freebsd-amd64@FreeBSD.ORG Thu Sep 25 21:00:03 2008 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECAF61065693 for ; Thu, 25 Sep 2008 21:00:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C45B08FC16 for ; Thu, 25 Sep 2008 21:00:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m8PL03AQ007971 for ; Thu, 25 Sep 2008 21:00:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m8PL0310007967; Thu, 25 Sep 2008 21:00:03 GMT (envelope-from gnats) Resent-Date: Thu, 25 Sep 2008 21:00:03 GMT Resent-Message-Id: <200809252100.m8PL0310007967@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jonathan Briggs Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E18E106568B for ; Thu, 25 Sep 2008 20:50:44 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8918FC15 for ; Thu, 25 Sep 2008 20:50:44 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m8PKohQc095843 for ; Thu, 25 Sep 2008 20:50:43 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id m8PKohFr095842; Thu, 25 Sep 2008 20:50:43 GMT (envelope-from nobody) Message-Id: <200809252050.m8PKohFr095842@www.freebsd.org> Date: Thu, 25 Sep 2008 20:50:43 GMT From: Jonathan Briggs To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 X-Mailman-Approved-At: Thu, 25 Sep 2008 22:46:17 +0000 Cc: Subject: 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: Thu, 25 Sep 2008 21:00:04 -0000 >Number: 127640 >Category: amd64 >Synopsis: GCC will not build shared libraries with -fprofile-generate on amd64 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 25 21:00:03 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Jonathan Briggs >Release: 7.0-RELEASE >Organization: >Environment: FreeBSD freebsd64 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 10:35:36 UTC 2008 root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: I was porting a specialized database library to FreeBSD and the build failed with this error: /usr/bin/ld: /usr/lib/libgcov.a(_gcov_merge_add.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC /usr/lib/libgcov.a: could not read symbols: Bad value The library uses -fprofile-generate, runs a test set, then rebuilds with -fprofile-use. It's worth a few ms per lookup. Also, this builds very well on i386 FreeBSD 7.0 and on many varieties of Linux and their GCC builds (Debian ia64, Gentoo amd64, CentOS 5.2, Fedora 5, 8, 9). I can work around the problem by just not doing a profile build. >How-To-Repeat: Put the following in a shell script: #!/bin/sh cat < int counter(int count) { int i; for(i=0; iFix: >Release-Note: >Audit-Trail: >Unformatted: