Re: Building a Linuxulator userland from source

From: Felix Palmen <>
Date: Mon, 21 Aug 2023 07:21:15 UTC
* Tatsuki Makino <> [20230821 15:38]:
> Linux branded ELF is executed by linuxulator no matter where it is
> placed on /, right?


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


> 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
from 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
| (0x00007fffffffe000)
| => /usr/lib64/ (0x0000000801154000)
| => /usr/lib64/ (0x00000008011ad000)
| => /usr/lib64/ (0x00000008011bb000)
| => /usr/lib64/ (0x0000000801400000)
|         /lib64/ (0x0000000001021000)
| bash-5.2# 

Cheers, Felix

 Felix Palmen <>     {private}
 -- ports committer --                     {web}
 {pgp public key}
 {pgp fingerprint} 6936 13D5 5BBF 4837 B212  3ACC 54AD E006 9879 F231