From owner-freebsd-current@FreeBSD.ORG Sat Nov 11 17:33:41 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 0A36116A412; Sat, 11 Nov 2006 17:33:41 +0000 (UTC) (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 60F4843D5E; Sat, 11 Nov 2006 17:33:40 +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.7/8.13.7/NETPLEX) with ESMTP id kABHXbXp026982; Sat, 11 Nov 2006 12:33:37 -0500 (EST) Date: Sat, 11 Nov 2006 12:33:37 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= In-Reply-To: <86lkmivws6.fsf@dwp.des.no> Message-ID: References: <20061110151247.GA64530@zone3000.net> <20061111022044.8191e1c8.nork@FreeBSD.org> <20061111065629.GA82094@xor.obsecurity.org> <20061111235332.89f24170.nork@FreeBSD.org> <86lkmivws6.fsf@dwp.des.no> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-1163266417=:6747" X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-2.0.2 (mail.ntplx.net [204.213.176.10]); Sat, 11 Nov 2006 12:33:37 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: freebsd-current@freebsd.org, Norikatsu Shigemura , Kris Kennaway Subject: Re: libpthread vs libthr. 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 Nov 2006 17:33:41 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-1804928587-1163266417=:6747 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sat, 11 Nov 2006, Dag-Erling Sm=F8rgrav wrote: >> =09resolve a symbol, sched_yield(2). So X server didn't run. >> >> =09In this case, gdm tried to resolve a symbol, >> =09sched_yield@LIBTHREAD_1_0 instead of sched_yield. So by changing >> =09libthr by libmap, gdm couldn't resolve a symbol, sched_yield(2). >> =09libthr doesn't have a sched_yield@LIBTHREAD_1_0, Yes, libc have >> =09a sched_yield, but sched_yield@LIBTHREAD_1_0. > > This is not a libthr issue, it's a symbol versioning issue. Arguably, > sched_yield should be removed from libpthread's symbol map, because > it's a wrapper for a syscall and we don't version syscalls. Yah we do, see src/lib/libc/sys/Symbol.map. In the above case(s), libpthread and libthr use LIBTHREAD_1_0 as the version namespace. This was done back in 5.x. But now that libc has symbol versioning and the thread libraries want to override some symbols in libc, they (libc and the thread libraries) need to use the same version namespace. I added LIBTHREAD_1_0 as a compatibility hack to libpthread in -current, but it also has and defaults to FBSD_1_0 which is also used by libc. The way to fix this for the above problem is to enable symbol versioning (set SYMVER_ENABLED=3Dyes in /etc/make.conf) and rebuild world. Then rebuild your ports. After that, all your ports will reference symbols in FBSD_1_0, and if libthr doesn't provide sched_yield@FBSD_1_0, it'll find it in libc. Before 7.0 goes out the door, symbol versioning will be enabled by default so you won't have this problem. --=20 DE ---559023410-1804928587-1163266417=:6747--