Cross-compiling/porting to Linux

Dan Nelson dnelson at allantgroup.com
Tue Mar 29 08:09:02 PST 2005


In the last episode (Mar 29), Michael Hopkins said:
> On a related topic - I can see that there are ports for converting
> binaries between different formats (e.g. ELF to a.out).  As there is
> already a runtime compatibility established, how easy would it be to
> build something that reads in a FreeBSD binary or library and outputs
> a linux one?  Just a thought.

That would be near impossible.  The elf2aout program in ports has a
specific purpose: to convert static elf binaries to a.out format so
simple bootloaders can execute them.  The binary format is the least of
your worries when trying to run under a different OS.  You've got
structure changes (FILE for example), constant changes (ioctls,
signals, errnos), syscall number changes (even the method to invoke
syscalls is different), possibly different reserved registers, etc.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-emulation mailing list