Cross compiling to aarch64
#1
I'm trying to build kodi on Linux and I wish to target aarch64. I'm using Ubuntu 22.10 on amd64.

How do I specify using aarch64? Do I need to also target a specific gcc lib that's on the target device?

cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=wayland -DAPP_RENDER_SYSTEM=gl -DCMAKE_CXX_FLAGS="-march=armv8-a
Reply
#2
see https://github.com/xbmc/xbmc/tree/master/tools/depends

you'll need a aarch64-cross toolchain (e.g. gcc-aarch64-linux-gnu) and related kernel headers
Reply
#3
The simplest way I've found to cross compile to other CPU variants (such as Pi) is a qemu chroot on a host system (not the target system).

Also works great for modifying a rootfs.

A overall general example of what I mean here: https://a-delacruz.github.io/ubuntu/rpi3...ystem.html

Adjust as needed, it's just an example.

That will give you a complete shell for your target system which you can run on your host system. When finished, image it, pack it, write it to sd/usb, whatever you desire.
Reply
#4
(2023-01-10, 15:26)wsnipex Wrote: see https://github.com/xbmc/xbmc/tree/master/tools/depends

you'll need a aarch64-cross toolchain (e.g. gcc-aarch64-linux-gnu) and related kernel headers
Thanks wsnipex!

With shared libraries such as liblzo2.so (and presumably the same will apply to libz.so, libpng.so, libgif.so and libjpeg.so etc.)

Does it compile these into a static kodi bin or do they need to exist on the target device? (They do not at present).

I can get my system to find these libraries on the compile device (x86_64) by doing this:

sudo dpkg --add-architecture arm64

sudo touch /etc/apt/sources.list.d/arm-cross-compile-sources.list
deb [arch=arm64] http://ports.ubuntu.com/ kinetic main restricted
deb [arch=arm64] http://ports.ubuntu.com/ kinetic-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ kinetic universe
deb [arch=arm64] http://ports.ubuntu.com/ kinetic-updates universe
deb [arch=arm64] http://ports.ubuntu.com/ kinetic multiverse
deb [arch=arm64] http://ports.ubuntu.com/ kinetic-updates multiverse
deb [arch=arm64] http://ports.ubuntu.com/ kinetic-backports main restricted universe multiverse

sudo apt-get install liblzo2-dev:arm64 
etc.
Reply
#5
I'm a bit stuck in that it still insists on checking /usr/lib/x86_64-linux-gnu/ alsoi it cant find Python3_LIBRARY:
Quote:cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=wayland -DAPP_RENDER_SYSTEM=gles -DWITH_ARCH=aarch64 -DWITH_CPU=cortex-a76 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++
-- The CXX compiler identification is GNU 12.2.0
-- The C compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/aarch64-linux-gnu-gcc
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Source directory: /home/xx/Sites/kodi
-- Build directory: /home/xx/Sites/kodi-build
-- Generator: Single-configuration: Release (Unix Makefiles)
-- CMake Version: 3.24.2
-- System type: Linux
-- Linker: GNU gold
-- Host architecture is little-endian
-- Core system type: linux
-- Platform: wayland
-- CPU: cortex-a76, ARCH: aarch64
-- Cross-Compiling: FALSE
-- Execute build artefacts on host: 
-- Depends based build: 
-- statx is available
-- Could not find hardware support for SSE (missing: _SSE_TRUE _SSE_OK) 
-- Could not find hardware support for SSE2 (missing: _SSE2_TRUE _SSE2_OK) 
-- Could not find hardware support for SSE3 (missing: _SSE3_TRUE _SSE3_OK) 
-- Could not find hardware support for SSSE3 (missing: _SSSE3_TRUE _SSSE3_OK) 
-- Could not find hardware support for SSE4.1 (missing: _SSE41_TRUE _SSE41_OK) 
-- Could not find hardware support for SSE4.2 (missing: _SSE42_TRUE _SSE42_OK) 
-- Could not find hardware support for AVX (missing: _AVX_TRUE _AVX_OK) 
-- Could not find hardware support for AVX2 (missing: _AVX2_TRUE _AVX2_OK) 
-- Found Git: /usr/bin/git (found version "2.37.2") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Could NOT find CCache (missing: CCACHE_PROGRAM) 
-- Could NOT find ClangFormat (missing: CLANG_FORMAT_EXECUTABLE) 
-- Found FlatC: /bin/flatc (found version "2.0.6") 
-- Found Lzo2: /usr/lib/aarch64-linux-gnu/liblzo2.so  
-- Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib/aarch64-linux-gnu/libpng.so (found version "1.6.38") 
-- Found GIF: /usr/lib/aarch64-linux-gnu/libgif.so  
-- Found JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (found version "80") 
-- Building internal TexturePacker
-- Shipping internal TexturePacker
-- Internal TexturePacker will be executed during build
-- Found Alsa: /usr/lib/x86_64-linux-gnu/libasound.so (found version "1.2.7.2") 
-- Found Avahi: /usr/lib/x86_64-linux-gnu/libavahi-client.so (found version "0.8") 
-- Could NOT find Bluetooth (missing: BLUETOOTH_LIBRARY) 
-- Found Bluray: /usr/lib/x86_64-linux-gnu/libbluray.so (found suitable version "1.3.2", minimum required is "0.9.3") 
-- Could NOT find CAP (missing: CAP_LIBRARY CAP_INCLUDE_DIR) 
-- Found CEC: /usr/lib/x86_64-linux-gnu/libcec.so (found suitable version "6.0.2", minimum required is "4.0.0") 
-- Could NOT find Dav1d (missing: DAV1D_LIBRARY DAV1D_INCLUDE_DIR) 
-- Found DBus: /usr/lib/x86_64-linux-gnu/libdbus-1.so (found version "1.14.0") 
CMake Warning at cmake/modules/FindCdio.cmake:24 (message):
  Detected libcdio (2.1.0) and libcdio++ () version mismatch.  libcdio++ will
  not be used.
Call Stack (most recent call first):
  cmake/modules/FindIso9660pp.cmake:18 (find_package)
  cmake/scripts/common/Macros.cmake:372 (find_package)
  cmake/scripts/common/Macros.cmake:419 (find_package_with_ver)
  CMakeLists.txt:219 (core_optional_dep)


-- Found Cdio: /usr/lib/x86_64-linux-gnu/libcdio.so  
-- Could NOT find Iso9660pp (missing: ISO9660PP_LIBRARY ISO9660PP_INCLUDE_DIR CDIOPP_INCLUDE_DIR) 
-- Found LCMS2: /usr/lib/x86_64-linux-gnu/liblcms2.so (found version "2.13") 
-- Found LircClient: /usr/lib/x86_64-linux-gnu/liblirc_client.so  
-- Could NOT find MDNS (missing: MDNS_LIBRARY MDNS_INCLUDE_DIR) 
-- Found MicroHttpd: /usr/lib/x86_64-linux-gnu/libmicrohttpd.so (found version "0.9.75") 
-- Found NFS: /usr/lib/x86_64-linux-gnu/libnfs.so (found version "4.0.0") 
-- Could NOT find Pipewire (missing: PIPEWIRE_LIBRARY PIPEWIRE_INCLUDE_DIR SPA_INCLUDE_DIR) 
-- Found Plist: /usr/lib/x86_64-linux-gnu/libplist-2.0.so (found version "2.2.0") 
-- Found PulseAudio: /usr/lib/x86_64-linux-gnu/libpulse.so (found version "16.1") 
-- Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Python3_LIBRARIES Development Development.Module Development.Embed) 
-- Found Python3: /usr/bin/python3.10 (found version "3.10.7") found components: Interpreter 
-- Found SmbClient: /usr/lib/x86_64-linux-gnu/libsmbclient.so (found version "0.7.0") 
-- Could NOT find Sndio (missing: SNDIO_LIBRARY SNDIO_INCLUDE_DIR) 
-- Found UDEV: /usr/lib/x86_64-linux-gnu/libudev.so (found version "251") 
-- Could NOT find Udfread (missing: UDFREAD_LIBRARY) 
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.14") 
-- Found XSLT: /usr/lib/x86_64-linux-gnu/libxslt.so (found version "1.1.35") 
-- Found VAAPI: /usr/lib/x86_64-linux-gnu/libva.so (found suitable version "1.15.0", minimum required is "0.39.0") 
-- Found ASS: /usr/lib/x86_64-linux-gnu/libass.so (found version "0.16.0") 
CMake Warning at cmake/modules/FindCdio.cmake:24 (message):
  Detected libcdio (2.1.0) and libcdio++ () version mismatch.  libcdio++ will
  not be used.
Call Stack (most recent call first):
  cmake/scripts/common/Macros.cmake:372 (find_package)
  cmake/scripts/common/Macros.cmake:386 (find_package_with_ver)
  CMakeLists.txt:220 (core_require_dep)


-- Found Patch: /usr/bin/patch (found version "2.7.6") 
-- Found CrossGUID: optimized;/home/xx/Sites/kodi-build/build/lib/libcrossguid.a;debug;/home/xx/Sites/kodi-build/build/lib/libcrossguid-dgb.a (found version "ca1bf4b810e2d188d04cb6286f957008ee1b7681") 
-- Found UUID: /usr/lib/aarch64-linux-gnu/libuuid.so (found version "2.38.0") 
-- Found Curl: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.85.0") 
-- FFmpeg 5.0.0 not found, falling back to internal build
-- dav1d not found, internal ffmpeg build will be missing AV1 support!
-- Found FlatBuffers: /usr/include  
-- Found Fmt: /usr/lib/aarch64-linux-gnu/libfmt.so (found version "9.0.0") 
-- Found FreeType: /usr/lib/x86_64-linux-gnu/libfreetype.so (found version "24.3.18") 
-- Found FriBidi: /usr/lib/x86_64-linux-gnu/libfribidi.so (found version "1.0.8") 
-- Found Fstrcmp: /usr/lib/libfstrcmp.so (found version "0.7.D001") 
-- Found HarfBuzz: /usr/lib/x86_64-linux-gnu/libharfbuzz.so (found version "2.7.4") 
-- Found Iconv: /usr/lib/aarch64-linux-gnu/libc.so  
-- Found KissFFT: /home/xx/Sites/kodi/xbmc/contrib
-- Found LibDvdCSS: /home/xx/Sites/kodi-build/build/lib/libdvdcss.a (found version "1.4.3-Next-Nexus-Alpha2-2") 
-- Found LibDvdRead: /home/xx/Sites/kodi-build/build/lib/libdvdread.a (found version "6.1.3-Next-Nexus-Alpha2-2") 
-- Found LibDvdNav: /home/xx/Sites/kodi-build/build/lib/libdvdnav.a (found version "6.1.1-Next-Nexus-Alpha2-2") 
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found suitable version "3.0.5", minimum required is "1.1.0")  
-- Found PCRE: /usr/lib/x86_64-linux-gnu/libpcrecpp.so (found version "8.39") 
-- Found RapidJSON: /home/xx/Sites/kodi-build/build/include (found version "1.1.0") 
-- Found Threads: TRUE  
-- Found Spdlog: /usr/lib/aarch64-linux-gnu/libspdlog.so (found version "1.10.0") 
-- Found Sqlite3: /usr/lib/x86_64-linux-gnu/libsqlite3.so (found version "3.39.3") 
-- Found TagLib: /usr/lib/x86_64-linux-gnu/libtag.so (found version "1.11.1") 
-- Found TinyXML: /usr/lib/x86_64-linux-gnu/libtinyxml.so (found version "2.6.2") 
-- Checking for module 'wayland-protocols'
--   Found wayland-protocols, version 1.26
-- Found WaylandProtocols: 1 (found suitable version "1.26", minimum required is "1.7") 
-- Found Waylandpp: /usr/include (Required is at least version "0.2.2") 
-- Found LibDRM: /usr/lib/x86_64-linux-gnu/libdrm.so (found version "2.4.113") 
-- Found Xkbcommon: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "1.4.1", minimum required is "0.4.1") 
-- Found OpenGLES: /usr/lib/x86_64-linux-gnu/libGLESv2.so  
-- Found EGL: /usr/lib/x86_64-linux-gnu/libEGL.so (found version "1.5") 
-- Found Atomic: atomic  
-- Could NOT find MariaDBClient (missing: MARIADBCLIENT_LIBRARY MARIADBCLIENT_INCLUDE_DIR) 
-- Could NOT find MySqlClient (missing: MYSQLCLIENT_LIBRARY) (found version "8.0.31")
-- Could NOT find Shairplay (missing: SHAIRPLAY_LIBRARY HAVE_SHAIRPLAY_CALLBACK_CLS) 
-- Found Java: /usr/bin/java (found version "11.0.17") found components: Runtime 
-- Found SWIG: /usr/bin/swig4.0 (found version "4.0.2") 
-- Found Gtest: /usr/lib/x86_64-linux-gnu/libgtest.a (found version "1.12.1") 
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.1") found components: doxygen missing components: dot
-- #---- CONFIGURATION ----#
-- Platforms: wayland
-- App package: org.xbmc.kodi
-- -- PATH config --
-- Prefix: /usr/local
-- Libdir: /usr/local/lib
-- Bindir: /usr/local/bin
-- Includedir: /usr/local/include
-- Datarootdir: /usr/local/share
-- Datadir: /usr/local/share
-- Docdir: /usr/local/share/doc/kodi
-- CCACHE enabled: No
-- CLANGFORMAT enabled: No
-- CLANGTIDY enabled: No
-- CPPCHECK enabled: No
-- INCLUDEWHATYOUUSE enabled: No
-- ALSA enabled: Yes
-- AVAHI enabled: Yes
-- BLUETOOTH enabled: No
-- BLURAY enabled: Yes
-- CAP enabled: No
-- CEC enabled: Yes
-- DAV1D enabled: No
-- DBUS enabled: Yes
-- ISO9660PP enabled: No
-- LCMS2 enabled: Yes
-- LIRCCLIENT enabled: Yes
-- MDNS enabled: No
-- MICROHTTPD enabled: Yes
-- NFS enabled: Yes
-- PIPEWIRE enabled: No
-- PLIST enabled: Yes
-- PULSEAUDIO enabled: Yes
-- PYTHON enabled: Yes
-- SMBCLIENT enabled: Yes
-- SNDIO enabled: No
-- UDEV enabled: Yes
-- UDFREAD enabled: No
-- XSLT enabled: Yes
-- VAAPI enabled: Yes
-- MARIADBCLIENT enabled: No
-- MYSQLCLIENT enabled: No
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Python3_LIBRARY
    linked by target "kodi-test" in directory /home/xx/Sites/kodi
    linked by target "kodi" in directory /home/xx/Sites/kodi
    linked by target "libkodi" in directory /home/xx/Sites/kodi

CMake Warning at CMakeLists.txt:386 (add_executable):
  Cannot generate a safe runtime search path for target kodi because files in
  some directories may conflict with libraries in implicit directories:

    runtime library [libuuid.so.1] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu
    runtime library [libfmt.so.9] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu
    runtime library [libc.so] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu
    runtime library [liblzo2.so.2] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu
    runtime library [libspdlog.so.1.10] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu
    runtime library [libz.so.1] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu

  Some of these libraries may not be found correctly.


CMake Warning at CMakeLists.txt:424 (add_executable):
  Cannot generate a safe runtime search path for target kodi-test because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libuuid.so.1] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu
    runtime library [libfmt.so.9] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu
    runtime library [libc.so] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu
    runtime library [liblzo2.so.2] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu
    runtime library [libspdlog.so.1.10] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu
    runtime library [libz.so.1] in /usr/lib/aarch64-linux-gnu may be hidden by files in:
      /usr/lib/x86_64-linux-gnu

  Some of these libraries may not be found correctly.


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
Reply
#6
you have to build the depends first. See the link I gave you
after depends are built successfully, you can use this https://github.com/xbmc/xbmc/blob/Nexus/...s/Makefile to configure kodi for aarch64 cross compilation.
e.g. from the kodi source root dir:
make -c tools/depends/target/cmakebuildsys
cd build; make -j8
Reply
#7
Thanks. I've tried:

cd tools/depends
./bootstrap
./configure --with-toolchain=/usr --prefix=/home/xbmc/opt/xbmc-deps --host=aarch64-linux-gnu --with-rendersystem=gles

For toolchain I've tried /usr /usr/bin and --with-toolchain=/usr/lib/aarch64-linux-gnu
Quote:./configure --prefix=/home/xbmc/opt/xbmc-deps --host=aarch64-linux-gnu --with-rendersystem=gles
checking build system type... x86_64-pc-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking for ccache... no
checking for curl... /usr/bin/curl
checking for tar... /usr/bin/tar
checking for sha512sum... /usr/bin/sha512sum
checking for sha256sum... /usr/bin/sha256sum
checking for ranlib... /usr/bin/ranlib
checking for ld... /usr/bin/ld
checking for ar... /usr/bin/ar
checking for readelf... /usr/bin/readelf
checking for strip... /usr/bin/strip
checking for as... /usr/bin/as
checking for nm... /usr/bin/nm
checking for objdump... /usr/bin/objdump
checking for clang... gcc
checking for clang++... g++
checking for aarch64-linux-gnu-ranlib... /usr/bin/aarch64-linux-gnu-ranlib
checking for aarch64-linux-gnu-ld... /usr/bin/aarch64-linux-gnu-ld
checking for aarch64-linux-gnu-ar... /usr/bin/aarch64-linux-gnu-ar
checking for aarch64-linux-gnu-readelf... /usr/bin/aarch64-linux-gnu-readelf
checking for aarch64-linux-gnu-strip... /usr/bin/aarch64-linux-gnu-strip
checking for aarch64-linux-gnu-as... /usr/bin/aarch64-linux-gnu-as
checking for aarch64-linux-gnu-nm... /usr/bin/aarch64-linux-gnu-nm
checking for aarch64-linux-gnu-objdump... /usr/bin/aarch64-linux-gnu-objdump
checking for aarch64-linux-gnu-gcc... /usr/bin/aarch64-linux-gnu-gcc
checking for aarch64-linux-gnu-g++... /usr/bin/aarch64-linux-gnu-g++
checking for aarch64-linux-gnu-gcc... /usr/bin/aarch64-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether /usr/bin/aarch64-linux-gnu-gcc accepts -g... yes
checking for /usr/bin/aarch64-linux-gnu-gcc option to enable C11 features... none needed
checking how to run the C preprocessor... /usr/bin/aarch64-linux-gnu-gcc -E
checking for library containing iconv_open... none required
checking whether the compiler supports GNU C++... yes
checking whether /usr/bin/aarch64-linux-gnu-g++ accepts -g... yes
checking for /usr/bin/aarch64-linux-gnu-g++ option to enable C++11 features... none needed
checking whether /usr/bin/aarch64-linux-gnu-g++ supports C++17 features with -std=c++17... yes
configure: creating ./config.status
config.status: creating native/config.site.native
config.status: creating Makefile.include
config.status: creating target/config.site
config.status: creating target/config-binaddons.site
config.status: creating target/Toolchain.cmake
config.status: creating target/Toolchain_binaddons.cmake
config.status: creating native/Toolchain-Native.cmake
'target/config.site' -> '/home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/share/config.site'
'target/config-binaddons.site' -> '/home/xbmc/opt/xbmc-deps/x86_64-linux-gnu-native/share/config-binaddons.site'
'target/Toolchain.cmake' -> '/home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/share/Toolchain.cmake'
'target/Toolchain_binaddons.cmake' -> '/home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/share/Toolchain_binaddons.cmake'
'native/config.site.native' -> '/home/xbmc/opt/xbmc-deps/x86_64-linux-gnu-native/share/config.site'
'native/Toolchain-Native.cmake' -> '/home/xbmc/opt/xbmc-deps/x86_64-linux-gnu-native/share/Toolchain-Native.cmake'


#------- configuration -------#
ccache:         no
build type:         debug
build system:     x86_64-pc-linux-gnu
build cpu:         x86_64
build includes:     
toolchain:         /usr
cpu:             aarch64
host:         aarch64-linux-gnu
CC:         /usr/bin/aarch64-linux-gnu-gcc
CXX:         /usr/bin/aarch64-linux-gnu-g++
cflags:         -fPIC -DPIC -Og -g -D_DEBUG 
cxxflags:         -fPIC -DPIC -Og -g -D_DEBUG  -std=c++17
ldflags:         -Wl,-rpath-link=/home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/lib  
platform_includes:     
ffmpeg options:     
prefix:         /home/xbmc/opt/xbmc-deps
depends:         /home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug
Quote:make -C tools/depends/target/cmakebuildsys BUILD_DIR=/home/xbmc/kodi-build
make: Entering directory '/home/xbmc/kodi/tools/depends/target/cmakebuildsys'
mkdir -p /home/xbmc/kodi-build
cd /home/xbmc/kodi-build; /home/xbmc/opt/xbmc-deps/x86_64-linux-gnu-native/bin/cmake -DCMAKE_TOOLCHAIN_FILE=/home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/share/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=/home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug  -DENABLE_INTERNAL_CROSSGUID=ON -DENABLE_INTERNAL_FFMPEG=OFF  /home/xbmc/kodi
/bin/sh: 1: /home/xbmc/opt/xbmc-deps/x86_64-linux-gnu-native/bin/cmake: not found
make: *** [Makefile:45: all] Error 127
make: Leaving directory '/home/xbmc/kodi/tools/depends/target/cmakebuildsys'


Why is it looking for cmake here? cmake is in:
cmake: /usr/bin/cmake /usr/lib/x86_64-linux-gnu/cmake

Prefix is a required path.
Reply
#8
I've added a quick symlink for cmake so I can continue. I'm currently stuck here - missing INTL_LIBRARY.

I have installed gettext:arm64 which adds:

/usr/aarch64-linux-gnu/include/libintl.h
/usr/lib/aarch64-linux-gnu/preloadable_libintl.so
 
Quote:-- Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Python3_LIBRARIES Development Development.Module Development.Embed) (Required is exact version "3.11")
CMake Error at cmake/modules/FindPython.cmake:73 (find_library):
  Could not find INTL_LIBRARY using the following names: intl
Call Stack (most recent call first):
  cmake/scripts/common/Macros.cmake:372 (find_package)
  cmake/scripts/common/Macros.cmake:421 (find_package_with_ver)
  CMakeLists.txt:219 (core_optional_dep)
Reply
#9
did you actually _compile_ depends? You have to run make after configure.....
Reply
#10
(2023-01-15, 22:31)wsnipex Wrote: did you actually _compile_ depends? You have to run make after configure.....

No that wasn't mentioned anywhere in the docs... Smile I assumed make was run in the kodi root. Trying it now.. So have I wasted the last few hours!!

It would be good to know what it is actually compiling in the tools/depends!!
Reply
#11
(2023-01-15, 22:31)wsnipex Wrote: did you actually _compile_ depends? You have to run make after configure.....

Ends with an error after lots of compilation
Quote: /usr/bin/mkdir -p '/home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/share/gettext'
 /usr/bin/install -c -m 644 ABOUT-NLS '/home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/share/gettext'
make[5]: Leaving directory '/home/xbmc/kodi/tools/depends/target/gettext/aarch64-linux-gnu-debug/gettext-runtime'
make[4]: Leaving directory '/home/xbmc/kodi/tools/depends/target/gettext/aarch64-linux-gnu-debug/gettext-runtime'
make[3]: Leaving directory '/home/xbmc/kodi/tools/depends/target/gettext/aarch64-linux-gnu-debug/gettext-runtime'
touch .installed-aarch64-linux-gnu-debug
make[2]: Leaving directory '/home/xbmc/kodi/tools/depends/target/gettext'
make[1]: Leaving directory '/home/xbmc/kodi/tools/depends/target'
make: *** [Makefile:11: target/.installed-aarch64-linux-gnu-debug] Error 2

I can continue but end on this error:
Quote:writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
creating 'dist/pycryptodomex-3.12.0-py3.11-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pycryptodomex-3.12.0-py3.11-linux-x86_64.egg
creating /home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/lib/python3.11/site-packages/pycryptodomex-3.12.0-py3.11-linux-x86_64.egg
Extracting pycryptodomex-3.12.0-py3.11-linux-x86_64.egg to /home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/lib/python3.11/site-packages
Adding pycryptodomex 3.12.0 to easy-install.pth file

Installed /home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/lib/python3.11/site-packages/pycryptodomex-3.12.0-py3.11-linux-x86_64.egg
Processing dependencies for pycryptodomex==3.12.0
Finished processing dependencies for pycryptodomex==3.12.0
cd /home/xbmc/opt/xbmc-deps/aarch64-linux-gnu-debug/lib/python3.11/site-packages; mkdir -p Cryptodome && cp -rf pycryptodomex*.egg/Cryptodome/* ./Cryptodome && rm -rf pycryptodomex*.egg
touch .installed-aarch64-linux-gnu-debug
make[2]: Leaving directory '/home/xbmc/kodi/tools/depends/target/pythonmodule-pycryptodome'
make -C tinyxml
make[2]: Entering directory '/home/xbmc/kodi/tools/depends/target/tinyxml'
make[2]: Leaving directory '/home/xbmc/kodi/tools/depends/target/tinyxml'
make -C samba-gplv3
make[2]: Entering directory '/home/xbmc/kodi/tools/depends/target/samba-gplv3'
cd aarch64-linux-gnu-debug; WAF_MAKE=1 ./buildtools/bin/waf --targets=smbclient
The project was not configured: run "waf configure" first!
make[2]: *** [Makefile:84: aarch64-linux-gnu-debug/bin/default/source3/libsmb/libsmbclient.a] Error 1
make[2]: Leaving directory '/home/xbmc/kodi/tools/depends/target/samba-gplv3'
make[1]: *** [Makefile:173: samba-gplv3] Error 2
make[1]: Leaving directory '/home/xbmc/kodi/tools/depends/target'
 
Reply
#12
The main issue I'm stuck on right now is below. I can try running waf configure myself, but I have no idea what options I am supposed to use??
Quote:make -C samba-gplv3
make[2]: Entering directory '/home/xbmc/kodi/tools/depends/target/samba-gplv3'
cd aarch64-linux-gnu-debug; WAF_MAKE=1 ./buildtools/bin/waf --targets=smbclient
The project was not configured: run "waf configure" first!
make[2]: *** [Makefile:84: aarch64-linux-gnu-debug/bin/default/source3/libsmb/libsmbclient.a] Error 1
make[2]: Leaving directory '/home/xbmc/kodi/tools/depends/target/samba-gplv3'
make[1]: *** [Makefile:173: samba-gplv3] Error 2
make[1]: Leaving directory '/home/xbmc/kodi/tools/depends/target'
make: *** [Makefile:11: target/.installed-aarch64-linux-gnu-debug] Error 2

If I do run waf configure and continue to run tools/depends/make I get the below. Of course I don't know if I ran waf configure correctly.
Quote:[ 820/2011] Linking bin/default/source4/heimdal_build/libcom_err-samba4.so
/usr/bin/ld: source4/heimdal/lib/com_err/com_err.c.129.o: in function `error_message':
com_err.cSad.text+0x9f): undefined reference to `rep_strlcpy'
/usr/bin/ld: source4/heimdal/lib/com_err/error.c.129.o: in function `com_right_r':
error.cSad.text+0x188): undefined reference to `rep_strlcpy'
collect2: error: ld returned 1 exit status

Waf: Leaving directory `/home/xbmc/kodi/tools/depends/target/samba-gplv3/aarch64-linux-gnu-debug/bin/default'
Build failed
 -> task in 'com_err' failed with exit status 1 (run with -v to display more information)
make[2]: *** [Makefile:84: aarch64-linux-gnu-debug/bin/default/source3/libsmb/libsmbclient.a] Error 1
make[2]: Leaving directory '/home/xbmc/kodi/tools/depends/target/samba-gplv3'
make[1]: *** [Makefile:173: samba-gplv3] Error 2
make[1]: Leaving directory '/home/xbmc/kodi/tools/depends/target'
make: *** [Makefile:11: target/.installed-aarch64-linux-gnu-debug] Error 2
Reply
#13
you need to find the actual error that causes the build to fail. It might be samba, but could be some dependency of it.
Run: make -c target VERBOSE=1 # (NO -j) and take note of the error when it fails
Reply
#14
(2023-01-16, 16:25)wsnipex Wrote: -c target VERBOSE=1

Hi wsnipex

Ignoring the fact that I run waf configure myself and continue the build:

cd tools/depend
make VERBOSE=1
Quote:make -C samba-gplv3
make[2]: Entering directory '/home/xbmc/kodi/tools/depends/target/samba-gplv3'
cd aarch64-linux-gnu-debug; WAF_MAKE=1 ./buildtools/bin/waf --targets=smbclient
Waf: Entering directory `/home/xbmc/kodi/tools/depends/target/samba-gplv3/aarch64-linux-gnu-debug/bin/default'
    Selected embedded Heimdal build
[ 818/2011] Linking bin/default/source4/heimdal_build/libcom_err-samba4.so
/usr/bin/ld: source4/heimdal/lib/com_err/com_err.c.129.o: in function `error_message':
com_err.cSad.text+0x9f): undefined reference to `rep_strlcpy'
/usr/bin/ld: source4/heimdal/lib/com_err/error.c.129.o: in function `com_right_r':
error.cSad.text+0x188): undefined reference to `rep_strlcpy'
collect2: error: ld returned 1 exit status

Waf: Leaving directory `/home/xbmc/kodi/tools/depends/target/samba-gplv3/aarch64-linux-gnu-debug/bin/default'
Build failed
 -> task in 'com_err' failed with exit status 1 (run with -v to display more information)
make[2]: *** [Makefile:84: aarch64-linux-gnu-debug/bin/default/source3/libsmb/libsmbclient.a] Error 1
make[2]: Leaving directory '/home/xbmc/kodi/tools/depends/target/samba-gplv3'
make[1]: *** [Makefile:173: samba-gplv3] Error 2
make[1]: Leaving directory '/home/xbmc/kodi/tools/depends/target'
make: *** [Makefile:11: target/.installed-aarch64-linux-gnu-debug] Error 2
Reply
#15
I am using going to start afresh with a new git clone and see if I can try again.

UPDATE fresh checkout worked... now on to compiling kodi itself.
Reply

Logout Mark Read Team Forum Stats Members Help
Cross compiling to aarch640