From owner-freebsd-current@FreeBSD.ORG Sat Feb 11 18:23:22 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 31A4F16A420; Sat, 11 Feb 2006 18:23:22 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8BB643D46; Sat, 11 Feb 2006 18:23:21 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id k1BINKRU004761; Sat, 11 Feb 2006 13:23:20 -0500 (EST) Date: Sat, 11 Feb 2006 13:23:20 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Alexander Kabaev In-Reply-To: <20060211152627.GA88895@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: freebsd-current@freebsd.org, Steve Kargl Subject: Re: [jakub@redhat.com:Linking against libpthread via -pthread? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2006 18:23:22 -0000 On Sat, 11 Feb 2006, Alexander Kabaev wrote: > On Sat, Feb 11, 2006 at 09:39:08AM -0500, Daniel Eischen wrote: > > > > Why? If one _really_ needs a shared library linked to libpthread, > > -lpthread will always work. > > > > -- > > DE > > > Just think for a moment how exactly will your shared library depend > on a specific symbol version in C or thread libraries if no > dependencies on libc.so.6 and libpthread.so.2 were recorded in the > first place? When no -lc or -lpthreed were seen by ld at all? > The symbol is defined by a name, version and library's SONAME. Well, so far we want libthr and libpthread to use the same symbols with the same map name so this can all just work regardless of which thread library you use. I can see why this is really, really, needed for libc where you really want symbol versioning to work. I'm just wondering if there is a way for the thread libraries to do necessary versioning within libc. Like adding all the pthread_ interfaces into libc as stubs (we already do some of them and the thread libraries stuff their functions into a jump table). But I see that without actually linking to a thread library, symbol versioning won't work for the thread libraries unless we play games with libc or some other stub library (which then loads the appropriate thread library). -- DE