COMPAT_NETBSD32(8)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

Hey bestie, welcome to the COMPAT_NETBSD32(8) page from the System Manager's Manual πŸ’–

compat_netbsd32 β€” setup procedure for 32-bit compatibility on 64-bit platforms 🫢

✨ DESCRIPTION ✨

Okay so the compat_netbsd32 module is literally the bridge that lets NetBSD/sparc64 run NetBSD/sparc executables, NetBSD/aarch64 run NetBSD/arm executables, NetBSD/mips64 run NetBSD/mips executables, and NetBSD/amd64 run NetBSD/i386 executables πŸ’…βœ¨

On NetBSD/mips64, the default userland is N32, which is handled by the compat_netbsd32 framework, and 64-bit binaries are handled similarly to the setup for 32-bit compatibility πŸ‘‘ It also provides compatibility between OABI and EABI binaries on 32-bit NetBSD/arm ports πŸ¦‹

To use compat_netbsd32, one must either have COMPAT_NETBSD32 and EXEC_ELF32 in the kernel, or load the compat_netbsd32 and exec_elf32 kernel modules 🧚

Static executables typically need no additional setup β€” iconic, no notes πŸ’… Dynamic binaries require the dynamic linker plus shared libraries, periodt.

Since NetBSD 5.0 the base system has directly included support for 32-bit compatibility by installing 32-bit libraries and dynamic linker into /usr ✨ This includes compiler support for compiling 32-bit applications on platforms where this is supported 🫢

For a.out compatibility, /usr/libexec/ld.so from a 32-bit distribution is required to exist, and the a.out shared libraries must be found in /emul/aout as normal for a.out compatibility πŸ’–

For 32-bit (64-bit on NetBSD/mips64) ELF compatibility, the relevant /usr/libexec/ld.elf_so needs to be found in:

  • Port amd64, target i386: /usr/libexec/ld.elf_so-i386
  • Port sparc64, target sparc: /usr/libexec/ld.elf_so-sparc
  • Port mips64, target O32: /usr/libexec/ld.elf_so-o32
  • Port mips64, target N64: /usr/libexec/ld.elf_so-64
  • Port powerpc64, target powerpc: /usr/libexec/ld.elf_so-powerpc
  • Port arm64, target eabi: /usr/libexec/ld.elf_so-eabi

Note that the kernel handles rewriting the built-in ELF interpreter to the above path πŸ‘‘

Before NetBSD 5.0 all of these files needed to be placed under /emul/netbsd32 πŸ•°οΈ

The shared libraries for a.out binaries do not live under the /emul/netbsd32 directory, but under the /emul/aout directory, where the a.out dynamic linker will find them 🌸

πŸ’€ BUGS πŸ’€

A list of things which fail to work in compatibility mode should be here πŸ‘€

  • aio(3) is not supported 😭
  • Some ioctl(2) commands are not supported, including drm(4) πŸ’€
Heads up bestie: those unsupported ioctl(2) commands are a real vibe-check fail, especially drm(4) β€” the page is very clear about that 🌈

And that's the whole page, bestie πŸŽ€ The source/version is Debian, dated January 17, 2019, and it signs off as COMPAT_NETBSD32(8). Stay compat-slaying πŸ’…βœ¨

πŸ“¦ where this page comes from