From owner-freebsd-current@FreeBSD.ORG Wed Sep 24 10:46:41 2003 Return-Path: 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 A91B516A4B3 for ; Wed, 24 Sep 2003 10:46:41 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCF5444003 for ; Wed, 24 Sep 2003 10:46:38 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id h8OHkYgG005557; Wed, 24 Sep 2003 13:46:34 -0400 (EDT) Date: Wed, 24 Sep 2003 13:46:34 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Dan Nelson In-Reply-To: <20030924170633.GA30073@dan.emsphone.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Freebsd Current Subject: Re: Fixing -pthreads (Re: ports and -current) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2003 17:46:41 -0000 On Wed, 24 Sep 2003, Dan Nelson wrote: > In the last episode (Sep 24), Daniel Eischen said: > > On Wed, 24 Sep 2003, Scott Long wrote: > > > Daniel Eischen wrote: > > > > o Doesn't break applications that use both -pthread and > > > > -l. We've been able to link both libc_r and libc > > > > in -current for well over 2 years. Indeed, if you build KDE > > > > and X with libpthread installed, you will see binaries that > > > > are linked to both libc_r and libpthread. > > > > > > I can't see how this behaviour would not be considered a bug, if it > > > is indeed true. Are you saying that there are packages out there > > > that will detect both -lpthread and -pthread and attempt to use > > > both on the compilers and linker lines? > > > > Yes, it's not just that. They can also find libc_r and include that > > (-lc_r) with -pthread. I installed libkse as libpthread and made the > > appropriate links and built X and KDE and there were a lot of > > binaries that were linked to both libc_r and libpthread. > > Does it really matter if you end up linked to multiple threads > libraries? The first library providing a symbol wins, so the other > shlibs just won't get used at all. Libraries linked from the > executable trump libraries linked from libraries, and LD_PRELOAD wins > above all. If one threads library exports a symbol not in the others, > I'd call that an API bug in the first library. Yes, it does matter. There are no problems with exported pthread symbols that I know of. I believe it is private symbols (__foo) that are causing problems and C++ style autoinit that is needed to initialize the libraries. We don't want applications to link to multiple thread libraries anyways. I don't know how to prevent it... -- Dan Eischen