ARM64 Port Status

Hi all. Can those with a successful build please share their initial configure/jam commands? I’m about to have a try myself (I need to take my brain out of C++ (thus no Paladin either) and Covid for a few hours). I think I have the commands I need but just want to check in case there are gotchas you have got over already.

Also, if there’s anything in particular people want me to look at let me know. I’m using WSL2 Ubuntu with all the aarch64 cross compile tools, and plan to use qemu on Windows (I spotted a message about screen modes on another topic and qemu on Windows, so know that potential gotcha).

I have an RPi400, and a couple of 4s, 3B+s etc kicking about. (I know 3B+ usually runs in 32 bit mode, but I have them if we need them).

3 Likes

OK a little progress but my brains hurting so breaking for lunch. Here’s where I’ve got so far…

  1. Clone buildtools, haiku, haukiporter, haikuports, haikuports.cross
  2. build and installed jam for my system (ubuntu) following the guide on the website
  3. Configured haikuporter for arm64 architecture, no secondary arch (but bootstrap creates its own anyway)
  4. Created a generated.arm64 folder in haiku
  5. Ran ../configure -j12 --build-cross-tools arm64 --cross-tools-source ../../buildtools --distro-compatibility official --bootstrap ../../haikuporter/haikuporter ../../haikuports.cross ../../haikuports successfully
  6. Ran this jam -q -j12 @bootstrap-raw

The final error was this:

...failed BootstrapRepositoryFetchPackage1 /home/adam/git/haiku/generated.arm64/objects/haiku/arm64/packaging/repositories/HaikuPortsCross-build/packages/gcc_bootstrap-8.3.0_2021_02_27-1-arm64.hpkg ...

But with a lot of debug info I find this:

Supposedly built package /home/adam/git/haiku/generated.arm64/objects/haiku/arm64/packaging/repositories/HaikuPortsCross-build/packages/gcc_bootstrap_syslibs_devel-8.3.0_2021_02_27-1-arm64.hpkg does not exist; version mismatch?

It seems to fail because of a missing file within gcc_bootstrap’s build process:-

======================================================================
The following build dependencies were found:
----------------------------------------------------------------------
sys-devel::gcc_bootstrap-8.3.0_2021_02_27
        /home/adam/git/haiku/generated.arm64/../../haikuports.cross/sys-devel/gcc_bootstrap/gcc_bootstrap-8.3.0_2021_02_27.recipe
----------------------------------------------------------------------
Skipping download of source for 4ab0fe4d95a13d203733d2dac3895c014ba7d293.tar.gz
Validating checksum of 4ab0fe4d95a13d203733d2dac3895c014ba7d293.tar.gz
        updating dependency infos of zlib_bootstrap-1.2.11
Looking for stale dependency-infos ...
        removing mawk_bootstrap-1.3.4.DependencyInfo
        removing mawk_bootstrap_source-1.3.4.DependencyInfo
        removing libtool_cross_generic_source-2.4.DependencyInfo
        removing libtool_cross_generic-2.4.DependencyInfo
======================================================================
sys-devel::gcc_bootstrap-8.3.0_2021_02_27
======================================================================
The following build dependencies were found:
----------------------------------------------------------------------
sys-devel::gcc_bootstrap-8.3.0_2021_02_27
        /home/adam/git/haiku/generated.arm64/../../haikuports.cross/sys-devel/gcc_bootstrap/gcc_bootstrap-8.3.0_2021_02_27.recipe
----------------------------------------------------------------------
Skipping download of source for 4ab0fe4d95a13d203733d2dac3895c014ba7d293.tar.gz
Validating checksum of 4ab0fe4d95a13d203733d2dac3895c014ba7d293.tar.gz
Unpacking source of 4ab0fe4d95a13d203733d2dac3895c014ba7d293.tar.gz
Cleaning source dir for 4ab0fe4d95a13d203733d2dac3895c014ba7d293.tar.gz
Unpacking source of 4ab0fe4d95a13d203733d2dac3895c014ba7d293.tar.gz
[Errno 2] No such file or directory: '/home/adam/git/haiku/generated.arm64/objects/haiku/arm64/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-8.3.0_2021_02_27/sources/buildtools-4ab0fe4d95a13d203733d2dac3895c014ba7d293/gcc/zlib/contrib/minizip/ioapi.h'
error: unknown switch `b'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]

    --template <template-directory>
                          directory from which templates will be used
    --bare                create a bare repository
    --shared[=<permissions>]
                          specify that the git repository is to be shared amongst several users
    -q, --quiet           be quiet
    --separate-git-dir <gitdir>
                          separate git dir from working tree

Command '['git', 'init', '-b', 'main']' returned non-zero exit status 129.
Supposedly built package /home/adam/git/haiku/generated.arm64/objects/haiku/arm64/packaging/repositories/HaikuPortsCross-build/packages/gcc_bootstrap_syslibs-8.3.0_2021_02_27-1-arm64.hpkg does not exist; version mismatch?

Looking inside the folder I can confirm that HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-8.3.0_2021_02_27/sources/buildtools-4ab0fe4d95a13d203733d2dac3895c014ba7d293/gcc/zlib folder does not exist at all.

Not entirely sure where the fault lies here so would appreciate advice. Given its such a fundamental part of the build I’m assuming I’ve configured something wrong. If someone can just point me to what to fix first I’d be grateful. Figuring out which error cause what is a bit difficult, even reading the gcc_bootstrap recipe.

Thanks.

2 Likes

Ah hang on that version of buildtools pulled down by gcc_bootstrap was prior to the aarch64 patch on 15 Mar… Looks like a new version of that recipe for cross compiling is needed… Can someone please confirm my suspicions.

There are no successful builds, you are pretty much where the master is at the moment. It will likely take a long time before it is useful for anyone on real hardware.
That being said, I am working on bringing the tree up to a point where the bootloader can be built and started, with most of the ARM64 code stubbed out. Once that is in the tree I will post instructions on building. I do not intend to do this before as that will make me have less time to actually get the code in. So please be patient, unless you want to get your own port going.

1 Like

Sure I can wait. Just thought I’d try and do something useful today.

Is there anything I can do in the meantime that is useful? Update some of the cross tools recipes for example?

3 Likes

It is currently very early and I havn’t looked at what it takes to move from bootstrap packages to real packages but some packages needs to be setup at some point:

build-feature packages unavailable on arm64: gcc_syslibs gcc_syslibs_devel icu giflib glu mesa ffmpeg fluidlite libvorbis freetype fontconfig gutenprint webkit libpng libicns jasper jpeg zlib libedit libsolv qrencode_kdl tiff openexr libdvdread libdvdnav libwebp live555 ncurses6 expat zstd 
AddHaikuImagePackages: package bash not available! 
AddHaikuImagePackages: package bc not available! 
AddHaikuImagePackages: package coreutils not available! 
AddHaikuImagePackages: package freetype not available! 
AddHaikuImagePackages: package libsolv not available! 
AddHaikuImagePackages: package zlib not available! 
AddHaikuImagePackages: package icu66 not available! 
AddHaikuImagePackages: package gcc_syslibs not available!

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.