When creating a linux userland via debootstrap the default ELF interpreter is an absolute symlink to the real ELF interpreter. And when pointing compat.linux.emul_path to that userland and trying to run any ELF executable from it, it results in: ELF interpreter /lib64/ld-linux-x86-64.so.2 not found, error 2 After changing that absolute symlink to a relative one, the executable works fine. This suggests path translation didn't get triggered again for the absolute symlink and only the root file system gets searched for it, but not under compat.linux.emul_path. Fixing this would allow userlands created via debootstrap to be used directly on the host without chroot, for usecases where you don't want that seperation.
Seems like this change is the culprit: https://reviews.freebsd.org/D40479
This fixes it for me: https://github.com/freebsd/freebsd-src/pull/2166
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=459ac3044b516af698d7342431bdbcf784fdf7a4 commit 459ac3044b516af698d7342431bdbcf784fdf7a4 Author: Ricardo Branco <rbranco@suse.de> AuthorDate: 2026-04-26 16:44:39 +0000 Commit: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org> CommitDate: 2026-05-01 20:27:36 +0000 namei: Preserve ABI root for absolute symlinks before fallback D40479 changed namei() so that an absolute symlink target encountered during an ABI-root lookup restarts from the native root. This helps the native fallback case, but it also makes successful lookups inside an ABI root escape that root while following absolute symlinks. Only switch absolute symlink lookup to the native root after namei() is already in the restarted/native fallback pass. Do not mark the lookup as restarted merely because an absolute symlink was encountered while still resolving inside the ABI root. This preserves the intended native fallback behavior while keeping absolute symlinks within a successfully resolved ABI-root path in the ABI namespace. Signed-off-by: Ricardo Branco <rbranco@suse.de> PR: 289739 Reviewed by: kib Fixes: cea7c564c70a ("namei: Reset the lookup to ...") Pull-Request: https://github.com/freebsd/freebsd-src/pull/2166 sys/kern/vfs_lookup.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)