How to compile Haiku on Haiku?

You supposed to use the crosscompiler on 64 bit from the buildtools repo.

Got it, cross-compile on 64-bit for optional 32-bit BIOS bootloader. I suppose then a 64-bit compiler can’t generate 32-bit code? Seems odd, given the -m32 flag in gcc.

I’ve faced the same kind of errors and solved them by pulling latest buildtools code and rebuilding it (rm -r cross-tools-x86_64 before running ../configure --update).

Gcc can do it, but the haikuports recipe isn’t written correctly, so the version of gcc from the hpkg file can’t.

It would be great if someone fixed that recipe.

3 Likes

The HaikuPorts GCC can do it just fine; but the recipe doesn’t build the 32-bit bootloader libgcc, so the resulting binaries can’t be linked.