Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Aug 2006 10:10:53 +0200
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        jes@jes-2.demon.nl
Cc:        freebsd-emulation@FreeBSD.org
Subject:   Re: ports/102034: emulators/linux_base-fc4 library problems with RELENG_6_1
Message-ID:  <20060823101053.xhmqal89c8wk408c@netchild.homeip.net>
In-Reply-To: <20060822214853.GA83595@jes-2.demon.nl>
References:  <200608220730.k7M7UMbm036179@freefall.freebsd.org> <68219662@bsam.ru> <20060822155206.wnofa44ha8s0sok0@netchild.homeip.net> <59246999@serv3.int.kfs.ru> <20060822180941.h3kwmrrdycwwwswo@netchild.homeip.net> <20060822214853.GA83595@jes-2.demon.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Jim Segrave <jes@jes-2.demon.nl> (from Tue, 22 Aug 2006 =20
23:48:54 +0200):

> As it happens, nothing was referring to /usr/lib/libpthread.so.0, so I
> deleted it and now linux ports behave normally, for which I am most
> appreciative.
>
> I am puzzled though - /usr/compat/linux/lib/libpthread.0 is installed
> as part of linux_base-fc4 and is symlinked to
> /usr/compat/linux/lib/libpthread-2.3.6.so
>
> I thought that the linux emulation, barring abuse of LD_PATH or
> LD_PRELOAD would always try to resolve out of /compat/linux/lib or
> /compat/linux/usr/lib, so the existence of a FreeBSD libptread.0 would
> not have any effect. Why would a linux app ever even see the FreeBSD
> library of the same name?

Because it doesn't abuse LD_* stuff. :-)

If the kernel detects a Linux-brand (man brandelf) of an ELF =20
executable, it uses the linux-compatibility syscall table instead of =20
the FreeBSD native syscall table. The linux syscalls which do access =20
files first prefix the absolute path of files with /compat/linux. If =20
this lookup is successful, everything is ok. If not, the file without =20
a /compat/linux prefix is looked up (most probably a FreeBSD native =20
one). For looking up libs, you also have to take the search order of =20
library directories into account. libpthread is in /lib for FC4 and in =20
/usr/lib for FreeBSD. It seems FC4 (or our port) is searching in =20
/usr/lib before searching in /lib. So it first finds the old FreeBSD =20
native one, instead of the linux one.

Bye,
Alexander.

--=20
Acid absorbs 47 times its own weight in excess Reality.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID =3D B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID =3D 72077137




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