Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jan 2007 13:21:01 +0100
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Tijl Coosemans <tijl@ulyssis.org>
Cc:        Boris Samorodov <bsam@ipt.ru>, Divacky, freebsd-current@freebsd.org, Roman <xdivac02@stud.fit.vutbr.cz>
Subject:   Re: broken linuxulator in -current as of Jan 8 17:51:45 CET
Message-ID:  <20070110132101.k8zzn281ic8w04ks@webmail.leidinger.net>
In-Reply-To: <200701101151.51662.tijl@ulyssis.org>
References:  <20070108165157.GA94941@stud.fit.vutbr.cz> <89559334@srv.sem.ipt.ru> <20070110075310.4vdsp3q68wgs4k4g@webmail.leidinger.net> <200701101151.51662.tijl@ulyssis.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Tijl Coosemans <tijl@ulyssis.org> (from Wed, 10 Jan 2007 =20
11:51:48 +0100):

> On Wednesday 10 January 2007 07:53, Alexander Leidinger wrote:
>> That's not possible. The way the linuxulator works is:
>>   - the linker in userland calls open("/foo/bar")
>>   - kernel looks for "/compat/linux/foo/bar"
>>     * it is there -> return it
>>     * it is not there -> look for "/foo/bar"
>>       + if it is there -> return it
>>       + if it is not there -> return error
>>   - the userland get's something which may be linux or FreeBSD stuff
>>   - the linker read()s this
>>   - the linker sees a wrong ELF ABI and bails out
>
> That means the linker tries to open /usr/lib/librt.so.1 instead of
> /lib/librt.so.1 which doesn't exist under /compat/linux. So I added a
> symlink there.
>
> ln -s ../../lib/librt-2.3.6.so /compat/linux/usr/lib/librt.so.1
>
> And now everything works.
>
>    - the linker in userland calls open("/usr/lib/librt.so.1")
>    - kernel looks for "/compat/linux/usr/lib/librt.so.1"
>      * it is there -> return it
>    - the linker read()s this
>    - the linker sees a wrong linux kernel ABI (in case of 2.4.2)
>      and calls open("/lib/obsolete/linuxthreads/librt.so.1")
>
> % ldd /compat/linux/bin/ls
> /compat/linux/bin/ls:
>         librt.so.1 =3D> /lib/obsolete/linuxthreads/librt.so.1 (0x4807c000)
>
> I think this is an easier solution than changing the runtime linker.

Does it still work with 2.6.16 (can't test ATM)? If yes: I agree, it =20
is more easy and we can change this in the linux base port very fast =20
(I have some other changes =20
(http://www.leidinger.net/FreeBSD/port-patches/emulators:linux_base-fc4.diff=
) =20
for which I wait for an important reason to commit them to the linux =20
base port).

Bye,
Alexander.

--=20
And you can't get any Watney's Red Barrel,
because the bars close every time you're thirsty...

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?20070110132101.k8zzn281ic8w04ks>