This sets up a build environment using Haiku cross tools and a test environment using HyClone.
The guide assumes a clean Ubuntu 23.04 environment.
git clone https://github.com/trungnt2910/hyclone
# Haiku build deps
sudo apt install -y git nasm bc autoconf automake texinfo flex bison gawk build-essential unzip wget zip less zlib1g-dev libzstd-dev xorriso libtool python3
cd hyclone
./copy_objects.sh
# HyClone build
mkdir build; cd build
sudo apt install -y cmake libgmp-dev libmpfr-dev zlib1g-dev libzstd-dev
cmake .. -DCMAKE_INSTALL_PREFIX=.
sudo make install
# Haiku rootfs setup
export HPREFIX=~/buildroot
./build_hprefix.sh \
-S "haiku_devel" \
-A "icu66_devel,krb5,krb5_devel,llvm12_libunwind,llvm12_libunwind_devel,openssl,openssl_devel,zlib,zlib_devel"
export HPREFIX=~/buildroot
export HPATH=/boot/system/bin:/boot/system/non-packaged/bin
~/hyclone/build/bin/haiku_loader bash --login
A Haiku terminal session should appear.
.NET contains multiple components, only a few components work.
On a Linux terminal:
# if running on WSL1
# https://github.com/dotnet/runtime/issues/70799#issuecomment-1158427454
export COMPlus_EnableWriteXorExecute=0
git clone https://github.com/trungnt2910/dotnet-runtime
cd dotnet-runtime
# make the Haiku cross-compiler available
export PATH=$PATH:~/haiku/generated.x86_64/cross-tools-x86_64/bin
# make the Haiku sysroot available; libraries and headers will be in here
export ROOTFS_DIR=$HPREFIX
git checkout haiku-dotnet7
./build.sh clr.runtime -arch x64 -os haiku -c debug -cross -gcc
./build.sh mono.runtime -arch x64 -os haiku -c debug -cross -gcc
./build.sh libs.native -arch x64 -os haiku -c debug -cross -gcc
./build.sh host.native -arch x64 -os haiku -c debug -cross -gcc
./build.sh clr.paltests -arch x64 -os haiku -c debug -cross -gcc
On a Haiku terminal session (powered by HyClone):
# Assuming you're already at /SystemRoot/home/<YOUR LINUX USER NAME>
cd dotnet-runtime
src/coreclr/pal/tests/palsuite/runpaltests.sh artifacts/bin/coreclr/$(uname).x64.Debug/paltests