Building (a minimal) Haiku

I haven’t actually got as far as doing a full build of Haiku yet because my Haiku box seems to have given up mid way though building an x86-64 anyboot image, after spending hours building the toolchain.

I used this page as my guide to building Haiku:

I wanted to build Haiku for x64 under Haiku x64 so I ended up referring to this page:

That page says I need to run:

mkdir generated.x86_64; cd generated.x86_64
../configure --cross-tools-source ../../buildtools --build-cross-tools x86_64


./configure --cross-tools-source ../buildtools --build-cross-tools x86_64

Running these two commands can easy take well over an hour each on an average (i5 class) laptop or PC. It might be a good idea to give an idea of the expected build/execution times relative to a certain class of CPU for each command on this page.

Is it really necessary to build a cross-compilation toolchain when you are trying to build Haiku x64 under Haiku x64? Are there not packages in the HaikuDepot for providing the OS build toolchain?

That same page only mentions two jam build targets, a nighly anyboot or a raw disk image. I would suspect that both these options build the entirety of Haiku inc. gcc (again!), its kernel, desktop, toolkits and all of the default userland apps. How long does it take an average i5 or i7 class CPU to do a full build of Haiku?

Are there other jam build targets to just build a minimal subset of Haiku for example just enough to run tracker?


This is twice the same command. You only need one. You have to decide if you want the generated files in the “generated” directory you create yourself (as in the first command) or for the configure script to create a directory named “generated” by itself (second command). Doing both just does all the work twice for no reason.

Yes, the compiler used for building a complete Haiku needs to be able to build a few pieces of code in 32 bit mode (for the bootloader), and the one provided in Haiku packages is not able to do that.

No, gcc is built only once during the configure step.

There is a “minimal” image but you will find a lot of things are missing there. No translators, most drivers are not built, etc. It is pretty limiting to use. The “nightly” image is a reasonable one to use (it includes less things than the “release” image we use for our beta versions already).

The full build only takes a few minutes anyway on modern hardware (it is shorter than the configure step which builds gcc). Also, after you’ve built everything once, the subsequent builds will rebuild only what’s needed, again saving a lot of time.

1 Like

Technically it can, but it does not have any 32-bit runtime libraries (libgcc, etc.) built specifically for the bootloader, which are only built as part of the cross-tools setup.

I’ve tried again but this time under Debian. I was surprised my laptop can build the nightly image in under 10 minutes after building the toolchain. That’s much faster than I was expecting and another reason to prefer Haiku over Linux. I’m sure it’d take my laptop much longer than 10 minutes to build just the Linux kernel and some of its modules.