3 ms·
Compiling Linux on computer running BSD. User has no computer running Linux, but she has computer running BSD. She builds needed toolchain, downloads and comp
by feelin_googley 9y ago
Compiling Linux on computer running BSD. User has no computer running Linux, but she has computer running BSD. She builds needed toolchain, downloads and compiles Linux kernel. Its relatively easy to build BSD while running Linux. But vice versa?
- yjftsjthsd-h 9y agoOkay, so I tried it, and I'm going to say, "not easily". Started from base FreeBSD install, installed gcc and gmake, pulled down a tarball from kernel.org. Did a `gmake x86_64_defconfig` to get started. First problem: FreeBSD calls it "amd64", Linux calls it "ia86". Exported ARCH=ia86 and retried. It gets further now but appears to blow break trying to build some .S files (FreeBSD uses as from GNU binutils, but it's like a decade old). I couldn't figure out how to fix, so gave up:) I suspect it would work in a Linux jail, though, since that's a GNU userland with a Linux ABI from the kernel. Didn't try, though. I also won't speak to whether it would work on netbsd/openbsd/etc.
- feelin_googley 9y agochroot into /emul/linux directory/jail with GNU/Linux libraries, headers and GCC toolchain as Linux binaries, not BSD ones, then build. There are probably obvious reasons this wont work but without trying I do not know what they are.