I should note I’ve tried setarch x86 and there’s no difference.
Attempting to compile just the mail daemon results in:
MergeObjectFromObjects1 /boot/home/dev/haiku/generated/objects/haiku_host/x86_gcc2/release/build/libbe/app/app_kit.o
/packages/gcc-2.95.3_2014_10_14-4/.self/develop/tools/i586-pc-haiku/bin/ld: /boot/home/dev/haiku/generated/objects/haiku_host/x86_gcc2/release/build/libbe/app/Application.o: unrecognized relocation (0x2b) in section `.text’
/packages/gcc-2.95.3_2014_10_14-4/.self/develop/tools/i586-pc-haiku/bin/ld: final link failed: Bad value
Then if you want to build a complete image (you may need to alter -j4 to match your # of cpus):
jam -q -j4 @nightly-raw
Or if you just want to build one application/server, cd to that source directory and run (use your full generated.x86gcc2 path)
jam -sHAIKU_OUTPUT_DIR=/Data/haiku/haiku/generated.x86gcc2
I also create generated.x86 and generated.x86_64 build targets by booting into an x86 or x86_64 Haiku install and doing the same (replacing x86_gcc2 with x86 or x86_64 as needed). This is the way I found works best for me through trial and error but others more experienced developers may have other ideas.
This is a strange way of doing it. The canonical one is to go in your generated dir and run something like “jam -q app_server” (just like make, you can give jam a target name and it will build it).
Also, building the buildtools is normally not needed when building on Haiku, in that case you can use the host buildtools.
[quote=“PulkoMandy, post:5, topic:5433”]
This is a strange way of doing it. The canonical one is to go in your generated dir and run something like “jam -q app_server” (just like make, you can give jam a target name and it will build it).[/quote]
Ah, that is good to know. What about components that are not part of the build yet like SoftwareUpdater, I assume those will not work?
So then would this be correct?
cd to your project folder (in my case /Data/haiku)
git clone https://github.com/yourID/haiku
cd haiku
mkdir generated.x86gcc2
cd generated.x86gcc2
…/configure
jam -q -j4 @nightly-raw
[quote=“Perelandra0x309, post:6, topic:5433, full:true”]
Ah, that is good to know. What about components that are not part of the build yet like SoftwareUpdater, I assume those will not work?[/quote]
If I don’t know the name of a ‘target’, I too just enter the folder of the source of my target and do a “jam -q” there.
It’ll build everything needed for it, including libs etc. For example, changes to Tracker often also need the newly compiled libtracker.so. So to try out your modified Tracker, you copy the Tracker binary and the newly compiled libtracker.so and put it in a “lib” folder where you have your modified Tracker.
The old SHIFT+ALT+ click on the path to your generated binary and libs makes finding the built stuff easy.
Forking the github may have issues due to missing tags, IIRC. Others know more about that. The guide says to use “git clone https://git.haiku-os.org/haiku”.
Here is my cheatsheet for setting up a gcc2hybrid build:
git clone https://git.haiku-os.org/haiku
cd haiku
mkdir -p generated
cd generated
/Source-Haiku/haiku/configure -j8 --use-gcc-pipe --distro-compatibility official --include-gpl-addons --include-patented-code --target-arch x86_gcc2 --target-arch x86
cd ..
mkdir -p generated.x86
cd generated.x86
/Source-Haiku/haiku/configure -j8 --use-gcc-pipe --distro-compatibility official --include-gpl-addons --include-patented-code --target-arch x86
cd ..
Yes , I want to continue this conversation from over 4 years ago because I tried to compile Haiku x86_64 on Haiku x86_64 and found this but did not make any progress because I missed that elusive step-by-step guide. So, I made my own guide and will publish it here. I will obviously risk the comments from the Haiku community for this, but so be it! STEP BY STEP GUIDE:
This howto is based on the instructions given on Compiling for x86_64 | Haiku Project
and is only for compiling a x86_64 image. For other images see the Haiku documentation.
This is done on a machine running Haiku x86_64 and the resulting image can be burned to a cd or used to create a bootable USB drive.
The terminal commands are given directly after the numbers list bullet (e.g. the dot after 3. is NOT part of the command!!).
A fast internet connection is required.
The replies by the system are shown in italics.
Only final responses of the system are shown. Intermediate responses are streaming ones and are not shown.
open /boot/home/
0.1 cd ~
mkdir compile
THIS CAN BE ANY NAME YOU WISH
cd compile/
git clone https://review.haiku-os.org/haiku.git
Cloning into ‘haiku’…
remote: Counting objects: 14367, done
remote: Finding sources: 100% (756372/756372)
remote: Finding sources: 100% (756372/756372)MiB | 81.00 KiB/s
Receiving objects: x%(XXXXXX/756372) , YY.ZZ MiB | NN KiB/s
THIS IS VERY SLOW, SO BE PATIENT…
100% (756372/756372), 397.61 MiB | 1.33MiB/s ,done.
Resolving deltas: 100% (577909/577909), done.
Updating files : 100%(32217/32217), done.
git clone https://review.haiku-os.org/buildtools.git
Cloning into ‘buildtools’ …
THIS IS A SLOW PROCESS. WAIT UNTIL IT SHOWS THE RESULTS BELOW
remote: Counting objects: 292317, done
remote: Finding sources: 100% (292317/292317)
remote: Total 292317 (delta 170645), reused 292284 (delta 170645)
Receiving objects: 100% (292317/292317), 370.23 MiB | 1.76 MiB/s, done.
Resolving deltas: 100% (170645/170645), done.
Updating files: 100% (121130/121130), done.
AND WAIT FOR A WHILE ON MY MACHINE IT STARTED AT 17:32 …17:57 = 25 MINUTES
jam -q -j2 @nightly-anyboot
THIS CREATES AN ISO FILE TO BURN TO CD OR USB STICK.
THE NUMBER AFTER -j IS THE NUMBER OF CORES OF YOUR CPU. I LEFT IT AT 2.MORE CORES,LESS TIME TO WAIT.
AND WAIT FOR A WHILE ON MY MACHINE IT STARTED AT 17:59 …18:43=44 MINUTES
THIS COMPILES ALL THE FILES NEEDED AND PUTS THEM INTO THE IMAGE.
THE IMAGE IS LOCATED AT
/boot/home/compile/haiku/generated.x86_64/haiku-nightly-anyboot.iso
IT CAN BE BURNED TO CD OR USB STICK.
If you want to help, indicate the folder you mean by cd to … and not “the haiku source tree”.
You know why? Because I am scratching my head and I am a newby (he) I have added cd haiku now. Thanks (him/her) @khallebal
Building Haiku on Haiku… how can I build just the OS as a .hpkg file?
I’m trying to test out some experimental code on my laptop from Gerrit, and would like to get a new Haiku.hpkg to install that custom version of the OS. I recall this is possible, but I can’t recall where I saw it. I’ve checked the docs but didn’t see mention of just the OS for installing on the OS.
Trying to compile shows a lot of errors about undefined symbols which appear to be math related: __divi3, __umoddi3, __moddi3_moddi3. Which library am I missing?
So I’m trying to test this code [link] but building all of Haiku is failing. The code is in the path “src/add-ons/accelerants/intel_extreme/mode.cpp”. I was able to run jam -q -j6 @nightly-raw intel_extreme which created objects/haiku/x86_64/release/add-ons/kernel/drivers/graphics/intel_extreme/intel_extreme. The code had the directory “accelerants”, and this is just “drivers”, is this binary a result of that source code file?
I assume this still works even if compiling from Haiku? I did try that without effect, and the Software Updater shows no newer dev tools. I’m on hrev56001. I’ll update though, see what happens.
This is due to the 32-bit BIOS bootloader needing the full cross-tools to be built, and as of now it’s still included in haiku.hpkg (though that may change.) You can get around this by commenting out line 31 in build/jam/packages/Haiku.