1Haiku compilers 2=============== 3 4For legacy reason, Haiku uses gcc2 to build parts of the system. This only applies to the x86 32bit 5version of Haiku, which maintains binary compatibility with BeOS applications. The other ports of 6Haiku are not affected by this, and use a more modern version of GCC (version 10 at the time of the 7writing). 8 9The compilers are available in the separate "buildtools" repository. This repository contains gcc 10as well as the binutils (assembler, linker, etc). These are modified versions of the GNU tools, to 11handle the specifics of Haiku. The gcc2 compiler is still getting some maintenance updates and 12bugfixes. For the modern tools, the goal is to eventually re-integrate these changes into the 13upstream version. 14 15There is also work in progress to be able to build Haiku with llvm/clang as an alternative to gcc. 16 17Summary of changes made to gcc for Haiku support 18------------------------------------------------ 19 20This is an incomplete list of the changes. 21 22- The -pthread option does nothing. In Haiku, pthreads are always enabled. 23- The -fPIE option does the same thing as -fPIC. In Haiku, executables are also loadable as shared 24 libraries because they can be loaded using load_add_on for use as replicants. Using the standard 25 gcc implementation of -fPIE would then break, because it generates code that can't be used in a 26 shared library. For this reason, -fPIE in Haiku instead does the same thing as -fPIC. 27- Header search path in Mac OS is case sensitive. Mac OS can handle both case sensitive and case 28 insensitive filesystems. Building Haiku requires a case sensitive filesystem, otherwise it's not 29 possible to tell apart headers like string.h and String.h. When compiling gcc for Mac OS, it 30 normally has code to force case insensitive comparison of header filenames, no matter what the 31 underlying filesystem offers. This is disabled in our version of gcc. 32