Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Aug 2023 09:21:15 +0200
From:      Felix Palmen <zirias@freebsd.org>
To:        ports@freebsd.org, emulation@freebsd.org
Subject:   Re: Building a Linuxulator userland from source
Message-ID:  <cnbxytnfqoh4dr6clz3qdhygeehjh7e3kqjdiarhiqsjhburhk@eotxvli5ma23>
In-Reply-To: <SI2PR01MB50366A01896746D4DAFC18F7FA1EA@SI2PR01MB5036.apcprd01.prod.exchangelabs.com>
References:  <xcztahm3vu3bjghjqqxuoy2xabyjmyfq22jw6mkaaaqo7wa36s@fdq7dlvpuhlk> <i3kr2kukjwgw2xvjlzgshwe72bjpnln4lvl7prhk77nelzidm6@2g56zi3ku7ec> <SI2PR01MB5036EAB6EE2D224BBDAF86B0FA19A@SI2PR01MB5036.apcprd01.prod.exchangelabs.com> <SI2PR01MB50366A01896746D4DAFC18F7FA1EA@SI2PR01MB5036.apcprd01.prod.exchangelabs.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--ycjtlyco6ssenf4n
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Tatsuki Makino <tatsuki_makino@hotmail.com> [20230821 15:38]:
> Linux branded ELF is executed by linuxulator no matter where it is
> placed on /, right?

Yes.

> Binaries running on linuxulator have priority access to files in
> /compat/linux.

Well, when they access some file, a path with /compat/linux prepended is
tried first. Only when there's nothing, the original path is tried.
That's it in a nutshell, the exact rules are a bit more complicated.

> What I don't understand is...
> If a linux binary running on linuxulator can't find a linux library,
> but can find a FreeBSD library, can it link and use that FreeBSD
> library?

No.

> Another problem is that linuxulator does not work for the shell script
> shbang.
> The "bash scripts" installed on /compat/linux, such as ldd, try to use
> freebsd bash outside of /compat/linux.

This works perfectly fine when used from within a Linux shell. Example
=66rom testing my new userland:

| [00:00:20] Entering interactive test mode. Type 'exit' when done.
| root@14a-default:~ # /compat/linux/bin/bash
| bash-5.2# ldd /bin/bash
|         linux-vdso.so.1 (0x00007fffffffe000)
|         libreadline.so.8 =3D> /usr/lib64/libreadline.so.8 (0x000000080115=
4000)
|         libhistory.so.8 =3D> /usr/lib64/libhistory.so.8 (0x00000008011ad0=
00)
|         libncursesw.so.6 =3D> /usr/lib64/libncursesw.so.6 (0x00000008011b=
b000)
|         libc.so.6 =3D> /usr/lib64/libc.so.6 (0x0000000801400000)
|         /lib64/ld-linux-x86-64.so.2 (0x0000000001021000)
| bash-5.2#=20

Cheers, Felix

--=20
 Felix Palmen <zirias@FreeBSD.org>     {private}   felix@palmen-it.de
 -- ports committer --                     {web}  http://palmen-it.de
 {pgp public key}  http://palmen-it.de/pub.txt
 {pgp fingerprint} 6936 13D5 5BBF 4837 B212  3ACC 54AD E006 9879 F231

--ycjtlyco6ssenf4n
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iNUEABYKAH0WIQRpNhPVW79IN7ISOsxUreAGmHnyMQUCZOMQal8UgAAAAAAuAChp
c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0Njkz
NjEzRDU1QkJGNDgzN0IyMTIzQUNDNTRBREUwMDY5ODc5RjIzMQAKCRBUreAGmHny
MX39AP47xhoE2kK0M9NjRz7O7G2MM+do2lxGrJVj3ogFE+esnwD9GbIDAcb1G4og
nj6gFuWuurHoX+polx5xXLUBEpH9DgA=
=JP14
-----END PGP SIGNATURE-----

--ycjtlyco6ssenf4n--



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