Building hafnium on arm64 hosts isn't possible out of the box:
./prebuilts/linux-x64/gn/gn: 1: ELF: not found ./prebuilts/linux-x64/gn/gn: 2: @: not found ./prebuilts/linux-x64/gn/gn: 1: Syntax error: end of file unexpected (expecting ")"
The Makefile sets PREBUILTS to .../linux-x64, so tries to run x86-64 binaries on an arm64 host.
If I edit the Makefile to use linux-aarch64, then the build fails as there is no gn binary.
After setting GN and NINJA to external binaries, the build still fails as x86 is hard-coded in build/image/dtc.py:
DTC_ROOT = os.path.join(HF_ROOT, "prebuilts", "linux-x64", "dtc")
I have DTC binaries, so that's fine. If I patch dtc.py to use relative paths it will find those.
| File "/yocto/ross/build/tmp/work/tc0-poky-linux/hafnium/2.4+gitAUTOINC+fe7f737ec2-r0/git/prebuilts/linux-x64/clang/bin/clang", line 162, in invoke_compiler | os.execv(self.argv0, self.execargs) | OSError: [Errno 8] Exec format error
I'm sorry, Hafnium embeds its own copies of clang and gcc?