Linux chroot under OpenBSD /bin/bash: Exec format error
*BSDThis forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
First off, the operating system syscall numbers (which any non-trivial program is more than likely going to call) are different, as well as the method for calling syscalls.
Second, Linux-compiled libraries will need to be present (i.e. a Linux binary wouldn't be able to call an OpenBSD library of the same name as the Linux library it needs).
Third (and perhaps most critically), even if you got everything else to line up properly, the calling conventions are different between Linux and OpenBSD (Linux passes parameters in registers and uses the stack for overflow parameters, OpenBSD passes all parameters on the stack).
Fourth, Linux emulation was removed from OpenBSD many, many moons ago (which required syscall emulation and linux libraries to be installed).
Ahh, you're right. There was a discussion around removing it, but it wasn't actually removed (I don't use Linux compat, so I never bothered following the conversation to completion). Looking at CURRENT sources, I see /usr/src/sys/compat/linux...so the code is still there, it seems.
It's no longer in the default kernel build, however, so running Linux binaries would require a custom kernel.