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.