From owner-freebsd-threads@FreeBSD.ORG Thu Aug 5 14:53:59 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8BC7716A4CE; Thu, 5 Aug 2004 14:53:59 +0000 (GMT) Received: from itchy.rabson.org (mailgate.nlsystems.com [80.177.232.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id D322C43D54; Thu, 5 Aug 2004 14:53:58 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from ns0.nlsystems.com (ns0.nlsystems.com [80.177.232.243]) by itchy.rabson.org (8.12.11/8.12.11) with ESMTP id i75Ertmw027989; Thu, 5 Aug 2004 15:53:55 +0100 (BST) (envelope-from dfr@nlsystems.com) From: Doug Rabson To: David Xu Date: Thu, 5 Aug 2004 15:53:51 +0100 User-Agent: KMail/1.6.2 References: <200408050940.36506.dfr@nlsystems.com> <411248DA.3080607@freebsd.org> In-Reply-To: <411248DA.3080607@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408051553.51692.dfr@nlsystems.com> X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on itchy.rabson.org X-Virus-Scanned: clamd / ClamAV version 0.71, clamav-milter version 0.71 X-Virus-Status: Clean cc: freebsd-threads@freebsd.org Subject: Re: Pthread patches for TLS X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2004 14:53:59 -0000 I haven't tried to support static linked TLS at all. The plan is to get the kernel to size the TLS segment and add extra AUXARGs to report its size, initialiser location and alignment. The stubs in libc/gen/tls.c would be extended to provide support for allocating the TLS blocks in the static case. I was under the impression that no-one particularly wanted to support pthreads in statically linked binaries? On Thursday 05 August 2004 15:48, David Xu wrote: > This patch does not work for statically linked binary even if the > binary does > not use __thread, I think you still need to use malloc to allocate > memory for tcb if it is being compiled as a static library. > I have tested it on AMD64, dynamically linked binary works fine. > > David Xu > > Doug Rabson wrote: > >This is the current state of my patches to add TLS support to > > libpthread and libthr. I have added code for i386, amd64 and ia64 > > but I've only tested i386. I believe the code for amd64 is right. I > > don't much like what I've done to the ia64 version though. I would > > like to commit only the i386 version at this stage. The amd64 code > > could be committed if someone tests it.