ARM64 Port Status

OK great I’ll look at just those base packages for now then. Will hopefully save everyone some time later on. I take it these are the standard haikuports recipes and not the bootstrap/cross compiler ones?

I note a few comments about --disable-tls on arm64 with TODOs next to them. Does this refer to openssl or another package not supporting arm64 yet too?

I’ll start with bash etc for now and do it recipe at a time. Won’t be able to test obviously…

2 Likes

I don’t really know, and not sure how to go about those. I updated bootstrap recipes and GCC config, but it was just a day or two ago that I’ve seen anything starting on ARM64, so everything is up in the air. I havn’t even pushed the linker scripts in haiku repo yet.

Ah I think they are the bootstrap ones in haikuports.cross. _ see bash_boostrap recipes in there. I’ll start there as you will hit that first.

I did icu67_bootstrap and it’s used in the build, so that one might just need to fix some rules in the build as it wants icu66. I’m a beginner at bootstrap packages and such so that is all I know…

1 Like

There is still more work coming before tree is ok, need to do a few PR’s for those.

Yeah I’m just going to set up haikuporter to point to the haikuports.cross folder I have, then build one package at a time.

I note the discussion here about building on haiku/linux and unbootstrap too: Compiling HaikuPorts packages for different architecture - #13 by X512

I may create a fake target in haiku like @single-bash to get around the other packages failing in the meantime… I’ll have a look… Late lunch now… :slight_smile:

3 Likes

Your version of git seems to be too old and not support the “-b” option to git init. This is required in current versions of haikuporter. We probably should add a check for the minimal needed git version in haikuporter.

I have written this script to jump around this problem: unbootstrap.sh « pulkomandy « 3rdparty - haiku - Haiku's main repository

The normal procedure would be:

  • Build haiku in bootstrap mode
  • Run the built haiku
  • Run haikuporter inside that and get it to build the “real” packages
  • Extract these packages and upload them to the buildserver

Of course this is unrealistic when working on a new port of Haiku that doesn’t boot yet. So, this script allows to take a shortcut:

  • Build haiku in boostrap mode
  • Copy the bootstrap packages to any haiku install or any place where the “package” tool is available
  • Run the script to convert the “bootstrap” packages to non-bootstrap one
  • Upload the packages to the buildserver

After doing this, it will be possible to do a non-bootstrap build of Haiku, which is a lot faster, and easier to work on for bringing up the port. Later on when things run correctly, the “unbootstrapped” packages can be replaced with proper ones built from inside Haiku.

6 Likes

I’m on Ubuntu 20.04.3 LTS on WSL2 and had already done a full upgrade… Git reports a slightly older version - 2.25.1… Seems though you are right. -b was added in 2.28. How very odd.

Referenced here: xcode - 'git init -b <branch name>' command in terminal is throwing an 'unknown switch' error - Stack Overflow

Time to jump off the LTS version onto a more regularly updated version, clearly…

Yeah confirmed. Just adding the PPA for git-core and upgrading that now results in the build continuing. Likely to take forever, so in the meantime, for posterity here’s how to upgrade just git:-

sudo add-apt-repository -y ppa:git-core/ppa
sudo apt update
sudo apt install git -y

Yeah much further. Now complaining about a libtool for this arch not existing. @tqh is this something on your TODO list?

Looking for stale dependency-infos ...
======================================================================
haiku-apps::haikuporter-0
======================================================================
build-prerequires "cmd:aarch64_unknown_haiku_libtool" of package "ncurses6_bootstrap-6.0" could not be resolved
requires "lib:libncurses" of package "python_bootstrap-3.9.1" could not be resolved
requires "cmd:python" of package "haikuporter-0" could not be resolved

I’ll go back and see if I can coax the system to build some other packages for now. Might spend a little time adding a “build me a single package” command to the haiku build system. (I spotted a desire expressed on another page for this).

No I don’t think I have done anything or will look at libtool right now.

This should come from this recipe: haikuports.cross/libtool_cross_generic-2.4.recipe at master · haikuports/haikuports.cross · GitHub

It appears to be already enabled for arm64, so it should have been found?

4 Likes

OK thanks. I’ll have a look at this tonight and see if I can find out what is going on.

Anyone care to take a second look at buildtools/aarch64-haiku.h at master · haiku/buildtools · GitHub
I think it is probably fine, but good to find anything interesting early there.

Not so many changes left for bootloader to build/start, won’t happen today though…
arm64_changes

26 Likes

I tweaked my efi shell-script adding graphics hardware, xhci, usb-kbd and usb-tablet. Then this showed up…
bootmenu

33 Likes

Navigation works as well:
bootmenu_navigation

30 Likes

I’ve pushed the changes I think are needed to reproduce my progress. Lets try to explain how to build.

Packages

I am using a Debian Buster container for building so these are packages I install:

apt-get install --no-install-recommends bc attr git nasm autoconf automake texinfo flex bison gawk build-essential unzip wget zip less zlib1g-dev libtool mtools gcc-multilib xorriso python python3 u-boot-tools device-tree-compiler ca-certificates libncurses-dev cmake autopoint pkg-config

cmake for haikuporter, autopoint for make build
pkg-config for make
libncurses-dev for texinfo host tools

Get the Code:

Then I have a base directory haiku-projects where I setup git repos:

git clone https://review.haiku-os.org/buildtools
git clone https://review.haiku-os.org/haiku
git clone git@github.com:haikuports/haikuports.git
git clone git@github.com:haikuports/haikuports.cross.git
git clone git@github.com:haikuports/haikuporter.git

Build and Install jam

(from haiku-projects dir)

cd buildtools/jam
make
sudo ./jam0 install

Configure cross-compiler

(from haiku-projects dir)

cd haiku
mkdir arm64
cd arm64
../configure --build-cross-tools arm64 --cross-tools-source ../../buildtools --distro-compatibility official -j4 --use-gcc-pipe  --bootstrap ../../haikuporter/haikuporter ../../haikuports.cross ../../haikuports

Build Bootstrap Packages and Haiku

Note: It will fail before full haiku image atm
(still in arm64 dir from previous step)

jam -j4 -q @bootstrap-raw

This will take a very long time, but rerunning it should be much faster as bootstrap packages should have been built and it is more like an ordinary Haiku build.

Install QEMU

Note: Debian QEMU is very outdated in buster so we use buster-backports

apt-get install -t buster-backports qemu-system-aarch64 qemu-efi-aarch64

The qemu-efi-aarch64 will install the UEFI firmware in /usr/share/qemu-efi-aarch64/

Running the Bootloader

(still in arm64 dir from above steps)

Create a Fake UEFI Boot Partition

mkdir disk
cd disk
ln -s ../objects/haiku/arm64/release/system/boot/efi/haiku_loader.efi
cd ..

Copy UEFI fw to dir

cp /usr/share/qemu-efi-aarch64/QEMU_EFI.fd .

Just to make sure that we don’t mess with the original.

Launch QEMU

qemu-system-aarch64 -m 256M -cpu cortex-a57 -M virt -bios QEMU_EFI.fd \
	-device virtio-gpu-pci -device qemu-xhci \
	-usb -device usb-kbd -device usb-tablet \
	-display gtk,grab-on-hover=on,zoom-to-fit=off \
	-net none -no-reboot -serial stdio \
	-drive file=fat:rw:disk,format=raw

The fake disk we created above is used as a fat drive.

Launch haiku_loader.efi

You should now be in UEFI shell. It will countdown or you can press ESC.
Here you can type help for info about commands in the shell.
We are going to change to our disk called fs0 as it is the first filesystem found.

fs0:

Then you can do ls if you want to see what is there, but lets run, start typing hai and press TAB, for auto-completion. Or do:

haiku_loader.efi

This should bring you to the bootloader and where the port is currently at. Here is how it looks like:
uefi_shell

33 Likes

After running jam to build bootstrap packages and Haiku I get the following error: (I’ve got git version 2.25.1)

2021-08-27 14:55:40 (6.13 MB/s) - ‘/home/leo/Dev/haiku/arm64/…/…/haikuports.cross/sys-devel/gcc_bootstrap/download/4ab0fe4d95a13d203733d2dac3895c014ba7d293.tar.gz’ saved [196090445]
Validating checksum of 4ab0fe4d95a13d203733d2dac3895c014ba7d293.tar.gz
Unpacking source of 4ab0fe4d95a13d203733d2dac3895c014ba7d293.tar.gz
error: unknown switch `b’
usage: git init [-q | --quiet] [–bare] [–template=] [–shared[=]] [
]

I also noticed this error that happened before the git one:

LinkApplicationCatalog1 objects/catalogs/kits/package/pt_BR.catalog
In file included from /home/leo/Dev/haiku/arm64/cross-tools-arm64/aarch64-unknown-haiku/include/c++/8.3.0/bits/stl_algo.h:59,
from /home/leo/Dev/haiku/arm64/cross-tools-arm64/aarch64-unknown-haiku/include/c++/8.3.0/algorithm:62,
from …/src/kits/interface/TextView.cpp:28:
/home/leo/Dev/haiku/arm64/cross-tools-arm64/aarch64-unknown-haiku/include/c++/8.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~

You need to upgrade git.