From owner-freebsd-current@FreeBSD.ORG Fri Feb 10 19:39:19 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 869AD16A420 for ; Fri, 10 Feb 2006 19:39:19 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id A88E443D6D for ; Fri, 10 Feb 2006 19:39:09 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id k1AJd8Ho032780; Fri, 10 Feb 2006 13:39:08 -0600 (CST) (envelope-from dan) Date: Fri, 10 Feb 2006 13:39:08 -0600 From: Dan Nelson To: Steve Kargl Message-ID: <20060210193907.GE2090@dan.emsphone.com> References: <20060210181715.GA21782@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060210181715.GA21782@troutmask.apl.washington.edu> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 Cc: freebsd-current@freebsd.org Subject: Re: [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 19:39:19 -0000 In the last episode (Feb 10), Steve Kargl said: > 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 There was a discussion about this back when the default switched from libc_r to libpthread, and I think the consensus was that shared libraries should never record dependencies against threads libs, which means you have to add -pthread to the link line when building the final executable. This avoids problems where an executable links to three shlibs, one library is linked to libc_r, one's linked to libkse, and a third is linked to libpthread. -- Dan Nelson dnelson@allantgroup.com