Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Nov 2006 12:33:37 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= <des@des.no>
Cc:        freebsd-current@freebsd.org, Norikatsu Shigemura <nork@freebsd.org>, Kris Kennaway <kris@obsecurity.org>
Subject:   Re: libpthread vs libthr.
Message-ID:  <Pine.GSO.4.64.0611111224560.6747@sea.ntplx.net>
In-Reply-To: <86lkmivws6.fsf@dwp.des.no>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
  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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0611111224560.6747>