I am able to cross-compile using 64-bit toolchain successfully now. However, I am not able to verify the build result as I am still not able to get my hand on the RPI4 board locally yet. I would appreciate if someone who has the board now can help me to verify.
In order to get the 64-bit binary, checkout from “upgrade-toolchains” branch and build it like so:
$ DBE_TAG=latest URHO3D_LUAJIT=0 URHO3D_ANGELSCRIPT=0 RPI_ABI=RPI4 script/dockerized.sh rpi
Yeah, both the scripting subsystems still not working yet for this port.
Edit: I should clarify that LUA actually built cleanly.
Edit2: Now LUAJIT and AngelScript scripting subsystems can be built cleanly too. So, just do this below.
$ DBE_TAG=latest RPI_ABI=RPI4 script/dockerized.sh rpi
After the latest DBE images are re-tagged as “master”, even the “DBE_TAG=latest” option will not be required later.
Edit 3: Some checks on one of the sample 64-bit binary.
$ file build/rpi/bin/01_HelloWorld
build/rpi/bin/01_HelloWorld: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 4.20.8, stripped
$ $RPI_PREFIX-readelf -d build/rpi/bin/01_HelloWorld
Dynamic section at offset 0x9bbd68 contains 34 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libbcm_host.so.0]
0x0000000000000001 (NEEDED) Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED) Shared library: [librt.so.1]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libGLESv2.so.2]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000f (RPATH) Library rpath: [/usr/lib/aarch64-linux-gnu:]
0x000000000000000c (INIT) 0x428ad8
0x000000000000000d (FINI) 0xbe94d0
0x0000000000000019 (INIT_ARRAY) 0xdcb658
0x000000000000001b (INIT_ARRAYSZ) 1520 (bytes)
0x000000000000001a (FINI_ARRAY) 0xdcbc48
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x0000000000000004 (HASH) 0x400278
0x000000006ffffef5 (GNU_HASH) 0x404b70
0x0000000000000005 (STRTAB) 0x418c38
0x0000000000000006 (SYMTAB) 0x409710
0x000000000000000a (STRSZ) 51117 (bytes)
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000015 (DEBUG) 0x0
0x0000000000000003 (PLTGOT) 0xdcbfe8
0x0000000000000002 (PLTRELSZ) 8328 (bytes)
0x0000000000000014 (PLTREL) RELA
0x0000000000000017 (JMPREL) 0x426a50
0x0000000000000007 (RELA) 0x426978
0x0000000000000008 (RELASZ) 216 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000006ffffffe (VERNEED) 0x426858
0x000000006fffffff (VERNEEDNUM) 6
0x000000006ffffff0 (VERSYM) 0x4253e6
0x0000000000000000 (NULL) 0x0