Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run FreeBSD static binary on Linux?

Would a very small/simple command line program, programmed in standards compliant C99, and statically compiled on FreeBSD work if executed on Linux ?

(I would test this myself but I do not currently have a separate HDD to test on Linux.)

like image 787
Neeladri Vishweswaran Avatar asked Aug 01 '10 20:08

Neeladri Vishweswaran


People also ask

Is FreeBSD binary compatible with Linux?

FreeBSD provides optional binary compatibility with Linux®, allowing users to install and run unmodified Linux binaries. It is available for the i386, amd64, and arm64 architectures.

Can FreeBSD run Linux programs?

FreeBSD has been able to run Linux binaries since 1995, not through virtualization or emulation, but by understanding the Linux executable format and providing a Linux specific system call table.

Is Linux binary compatible?

Binary compatibility helps – just don't assume it's there However, as a rule, you'll find that Linux distributions are not binary compatible. Whether you're writing your code or purchasing code from a vendor, binary compatibility is something you need to look out for given the complex field of Linux distributions.

How is FreeBSD different from Linux?

How is FreeBSD different from Linux? FreeBSD is a complete operating system, with a kernel, drivers, documentation, and utilities. Linux only brings a kernel and drivers to the table and relies on third-party system software. FreeBSD source code is released under a BSD license, while Linux utilizes a copyleft GPL.


1 Answers

No, not in general, because the syscall interface is different. However, FreeBSD has a good Linux compatibility layer where you can run Linux binaries (that are compiled against the Linux syscall interface) on FreeBSD. There is such a layer available for both i386 and amd64 binaries.

See Chapter 10: Linux Binary Compatibility of the FreeBSD handbook for more information.

like image 180
Greg Hewgill Avatar answered Sep 23 '22 03:09

Greg Hewgill