From owner-freebsd-current@FreeBSD.ORG Fri Feb 10 18:17:30 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B1C0616A420 for ; Fri, 10 Feb 2006 18:17:30 +0000 (GMT) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6BBDE43D4C for ; Fri, 10 Feb 2006 18:17:30 +0000 (GMT) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.13.4/8.13.4) with ESMTP id k1AIHUMW023381 for ; Fri, 10 Feb 2006 10:17:30 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.13.4/8.13.1/Submit) id k1AIHTrR023380 for freebsd-current@freebsd.org; Fri, 10 Feb 2006 10:17:29 -0800 (PST) (envelope-from sgk) Date: Fri, 10 Feb 2006 10:17:29 -0800 From: Steve Kargl To: freebsd-current@freebsd.org Message-ID: <20060210181715.GA21782@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Subject: [jakub@redhat.com:Linking against libpthread via -pthread? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2006 18:17:30 -0000 Some background information: I routinely build GCC mainline on i386-*-freebsd and amd64-*-freebsd. GCC mainline is introducing OpenMP support. When libgomp.so.1 is built, the compiler is given the -pthread option throughout the construction of libgomp.so.1. However, a "ldd libgomp.so.1" shows no dependence on libpthread.so.2 Anyone have an answer to Jakub's question below. ----- Forwarded message from Jakub Jelinek ----- X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on troutmask.apl.washington.edu X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.0 Date: Fri, 10 Feb 2006 13:04:25 -0500 From: Jakub Jelinek To: Steve Kargl Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: Re: [gomp merge] Stage 2: OpenMP for the Fortran front end (take 2) Reply-To: Jakub Jelinek In-Reply-To: <20060210170929.GA43794@troutmask.apl.washington.edu> User-Agent: Mutt/1.4.1i On Fri, Feb 10, 2006 at 09:09:29AM -0800, Steve Kargl wrote: > jakub and I have discussed. The other failures are probably > due to FreeBSD's loader. I'll pursue that issue on the FreeBSD > mailing lists. libgomp.so.0 not linking against libpthread.so.* is indeed IMHO a FreeBSD bug. For FreeBSD 6+, there is: #define FBSD_LIB_SPEC " \ %{!shared: \ %{!pg: %{pthread:-lpthread} -lc} \ %{pg: %{pthread:-lpthread_p} -lc_p} \ }" #endif This means that -pthread doesn't imply -lpthread for -shared. Can anyone from the FreeBSD crowd explain why it isn't %{pthread:-lpthread%{pg:_p}} %{!shared:-lc%{pg:_p}} or better yet, why isn't -lc linked in automatically as well for -shared? Jakub ----- End forwarded message ----- -- Steve