Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jan 2007 07:53:10 +0100
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Boris Samorodov <bsam@ipt.ru>
Cc:        Divacky Roman <xdivac02@stud.fit.vutbr.cz>, freebsd-current@freebsd.org
Subject:   Re: broken linuxulator in -current as of Jan 8 17:51:45 CET
Message-ID:  <20070110075310.4vdsp3q68wgs4k4g@webmail.leidinger.net>
In-Reply-To: <89559334@srv.sem.ipt.ru>
References:  <20070108165157.GA94941@stud.fit.vutbr.cz> <57417212@srv.sem.ipt.ru> <20070108180014.GA4540@stud.fit.vutbr.cz> <20070108210813.368389dc@Magellan.Leidinger.net> <20070109204604.62915dc7@Magellan.Leidinger.net> <89565167@srv.sem.ipt.ru> <20070109213151.2bf5a8f3@Magellan.Leidinger.net> <46677978@srv.sem.ipt.ru> <80597611@srv.sem.ipt.ru> <20070109210153.GA35342@stud.fit.vutbr.cz> <89559334@srv.sem.ipt.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Boris Samorodov <bsam@ipt.ru> (from Wed, 10 Jan 2007 00:42:49 +0300)=
:

> On Tue, 9 Jan 2007 22:01:53 +0100 Divacky Roman wrote:
>> On Tue, Jan 09, 2007 at 11:57:08PM +0300, Boris Samorodov wrote:
>> > On Tue, 09 Jan 2007 23:51:01 +0300 Boris Samorodov wrote:
>> >
>> > > for i in (linux,freebsd) do
>> > >   for y in (/usr,/usr/local,etc) do
>> >
>> > I ment if linux, use '/compat/linux + y' prefix.
>> >
>> > >     find_a_library
>> > >   done
>> > > done
>> >
>> > Hm, even if we can implement it, the (potential) problem with linux
>> > ports installed to /usr/local remains...
>
>> how does this solve the problem? I might misunderstand whats going on
>
> All possible linux paths are searched fistly.

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

What you describe would require changing the linker to set a flag =20
which let's the kernel know it has to search in the linux or in the =20
FreeBSD path, and the linker has to search the complete path list =20
twice. This is out of question.

Another approach would be to teach the linker to not bail out on ELF =20
ABI errors and continue searching the right lib. This would also need =20
a change in the linker, but it is a change which the glibc people may =20
accept (compared to the search twice and set a flag solution). This =20
would not be an immediate solution, but after a while the new linker =20
would hit every linux distribution and it would arrive in FreeBSD =20
(yes, we can replace the linker with a self-made one, and this would =20
be the solution in the mean time, but so far no such change is done in =20
glibc). Anyone up to  implement this and to convince the glibc people =20
that it is a good idea to include this behavior in the runtime linker?

Bye,
Alexander.

--=20
Computer Science is the only discipline in which we view
adding a new wing to a building as being maintenance
=09=09-- Jim Horning

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?20070110075310.4vdsp3q68wgs4k4g>