Are BSD binaries portable across the different BSD flavors? reddit / BSD ---------------------------------------------------------------------- mcandre · 2017-10-17 00:29 Can OpenBSD run FreeBSD binaries and vice versa? Or are some BSD's just different kernels fundamentally? I'd expect HardenedBSD to be able to run FreeBSD binaries, though I have no idea what Dragonfly, NetBSD, and MirOS are really like. ---------------------------------------------------------------------- daemonpenguin · 2017-10-17 00:42 Short answer: no, binaries are not compatible across flavours of BSD. Longer answer: While you won't be able to run OpenBSD executables on FreeBSD (or the reverse) you can sometimes run executables on closely related flavours. For example, TrueOS is based on FreeBSD 12-CURRENT, so it will run FreeBSD 12-CURRENT binaries, but probably not older packages from, say, FreeBSD 10. HardenedBSD may be able to run some FreeBSD binaries, but there is no guarantee. Even though HardenedBSD is based on FreeBSD, it uses a more rolling development model and introduces security features which may break compatibility. Basically, assume any binary you have is not going to be cross- platform. Use the packages each operating system provides through its own package manager. Many packages can be ported though if you have the source code. ---------------------------------------------------------------------- calrogman · 2017-10-17 00:49 >are some BSD's just different kernels fundamentally They're all derived from the same kernel, but as each variant diverged, they changed their syscall interfaces and C runtimes in certain ways so no, "BSD binaries" are not portable. ---------------------------------------------------------------------- God_Pill · 2017-10-17 14:14 Are there any binaries that do strive to be executable across all BSD flavors? similar in scope maybe to Linux Appimage? I only ask out of curiosity. ---------------------------------------------------------------------- calrogman · 2017-10-17 15:15 There's no extant effort to do this that I'm aware of, and I'd be surprised if there ever were. I know I'd rather just install a package or build a port than depend on anything as necessarily complex and fragile as that. ---------------------------------------------------------------------- phessler · 2017-10-17 16:49 No. provide source. ---------------------------------------------------------------------- [deleted] · 2017-10-17 16:52 [deleted] ---------------------------------------------------------------------- God_Pill · 2017-10-17 16:53 Source for what? I didn't make a claim. ---------------------------------------------------------------------- pavetheway91 · 2017-10-17 17:05 FreeBSD and NetBSD were both forked from 386BSD in 1993 and OpenBSD from NetBSD in 1995. All kernels have been developed independently since the forks happened. ---------------------------------------------------------------------- phessler · 2017-10-17 17:05 for the code. source code, so it can be natively built. ---------------------------------------------------------------------- God_Pill · 2017-10-17 17:07 OH... sorry I'm such a noob, I usually get caught up in threads where its "PROVE IT! CITE YOUR SOURCES!" lol my bad. ---------------------------------------------------------------------- floatboth · 2017-10-18 22:38 > probably not older packages from, say, FreeBSD 10 FreeBSD is backwards-compatible all the way down to 4.x. Of course if you just try to run an old dynamically linked binary, you probably won't have the libraries it requires, but you can run a chroot/jail with old FreeBSD userspace on a new kernel. > security features which may break compatibility You can turn them off per binary using secadm, that's necessary for HBSD binaries too (mostly for JIT interpreters and such). ---------------------------------------------------------------------- floatboth · 2017-10-18 22:41 BSD flavors are different operating systems, unlike Linux distibutions which are based on the same kernel (Linux). Check out [CloudABI](https://nuxi.nl) though. CloudABI binaries run unmodified on FreeBSD (including HardenedBSD, TrueOS etc.), (patched) NetBSD, (patched) Linux, (userspace-translated) macOS. ---------------------------------------------------------------------- ogdenj · 2017-10-22 10:33 I made a proof of concept along these lines some time ago: https://github.com/linuxthor/sixnix ---------------------------------------------------------------------- mcandre · 2017-10-22 15:20 Wow, polyglot binaries are impressive! ---------------------------------------------------------------------- yukaia · 2017-10-26 18:50 HardenedBSD is FreeBSD with added exploit mitigation tech, there are both 10 and 11 stable releases. As floatboth mentioned, you can disable features per binary with secadm, that said an HBSD binary won't run on vanilla FBSD.