QT cross compile to ARM #13495

issue Sjors openend this issue on June 18, 2018
  1. Sjors commented at 1:34 pm on June 18, 2018: member

    There are ARM devices out there with HDMI and full desktop linux support. I was able to compile and use QT on an Orange Pi Plus2E running Lubuntu 16.04. Compilation on the device itself takes several hours and QT spends a few minutes loading stuff, but otherwise the UI is pretty snappy.

    Gitian builds currently don’t include binaries for ARM. Cross compilation (for Gitian) was added in #8188, but QT was intentionally left out. Does anyone remember why?

    I’ve been trying to get this to work on Ubuntu Bionic, but no success so far.

    The first step to enabling this (for 32 bit) is to add qt_arm_linux_packages:=$(qt_x86_64_linux_packages) to depends/packages.mk. That prevents it from skipping QT. This however will result in an error:

     0make HOST=arm-linux-gnueabihf
     1
     2Configuring qt...
     3
     4[...]
     5
     6   The specified system/compiler is not supported:
     7
     8      [...]/bitcoin/depends/work/build/arm-linux-gnueabihf/qt/5.7.1-c292d7b0435/qtbase/mkspecs/arm-linux-gnueabihf
     9
    10   Please see the README file for a complete list.
    11
    12funcs.mk:242: recipe for target '[...]/bitcoin/depends/work/build/arm-linux-gnueabihf/qt/5.7.1-c292d7b0435/qtbase/.stamp_con
    

    I tried replacing $(package)_config_opts_arm_linux = $(host) with = -platform linux-g++ -xplatform linux-arm-gnueabi-g++, which seems to result in something being built. But configure isn’t happy:

     0./configure --prefix=$PWD/depends/arm-linux-gnueabihf --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++ --disable-tests --disable-bench --with-qrencode --with-gui=qt5
     1[...]
     2checking for QT5... yes
     3checking for QT_TEST... yes
     4checking for QT_DBUS... yes
     5checking for static Qt... yes
     6checking for QTPLATFORM... yes
     7checking for X11XCB... yes
     8checking for QTXCBQPA... yes
     9checking for Qt < 5.4... no
    10checking for static Qt plugins: -lqminimal... no
    11configure: error: Could not resolve: -lqminimal
    

    I tried building the depends with #12971 with QT_59=1, but this fails with:

    0Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing.
    1
    2ERROR: Feature 'system-zlib' was enabled, but the pre-condition 'libs.zlib' failed.
    3funcs.mk:242: recipe for target '[...]/bitcoin/depends/work/build/arm-linux-gnueabihf/qt/5.9.5-28b90c3bee9/qtbase/.stamp_configured' failed
    4make: *** [[...]/bitcoin/depends/work/build/arm-linux-gnueabihf/qt/5.9.5-28b90c3bee9/qtbase/.stamp_configured] Error 3
    

    Hopefully someone who actually understands the depends system and cross compilation has more luck…

  2. laanwj added the label GUI on Jun 18, 2018
  3. Sjors commented at 6:17 pm on June 18, 2018: member

    I’m able to build Bitcoin-QT using Armbian using these steps: https://github.com/Sjors/armbian-bitcoin-core (somewhat messy first draft).

    It doesn’t use cross-compile yet; that only works for bitcoind. Armbian uses some sort of virtualization (?) that when run on an Ubuntu 18.04 VM somehow produces the right build for ARM without having to do anything special. It is however rather slow compared to cross-compilation.

    It also doesn’t use the depends system (yet).

    Nonetheless it’s much faster than compiling on the device itself, in case anyone needs a workaround.

  4. Sjors commented at 2:00 pm on June 28, 2018: member
  5. MarcoFalke commented at 5:34 pm on June 28, 2018: member
    I believe it uses Canonicals infrastructure to compile
  6. TheCharlatan commented at 4:57 pm on July 5, 2018: member
    I seemed to be successful now with a arm qt depends build. Checkout my branch here: https://github.com/TheCharlatan/bitcoin/tree/Qt59arm .
  7. TheCharlatan commented at 2:51 pm on July 6, 2018: member
    The compilation for aarch64 fails with xextproto . This is a package that is required for libXext , which in turn is one the dependencies required for the qt build. xextproto saw its last update in 2013, so it is probably unmaintained now and never had support for the aarch64 architecture. Maybe @theuni knows whether it can be replaced by something, or if we should put some effort into patching it.
  8. Fuzzbawls commented at 8:00 am on July 12, 2018: contributor

    @TheCharlatan a patch for xextproto is indeed needed for doing a cross-build for aarch64 you can reference this commit: https://github.com/PIVX-Project/PIVX/commit/5bd2a86a91344fa96268451af15ce339088299b3

    We’ve been doing gitian builds to supply Qt binaries for arm/aarch64 for a while now, i’ve just never had much time to bring the work here. :)

    Edit: do note, however, that trusty’s aarch64 cross compiler has an ICE that makes this not possible. we use Xenial specifically for aarch64 gitian builds because of this. Given that the plan here is to migrate to Bionic soon for gitian builds, it may end up working out just fine after that (haven’t tested this on Bionic myself)

  9. MarcoFalke closed this on Aug 5, 2018

  10. MarcoFalke referenced this in commit 2ab72080ad on Aug 5, 2018
  11. PastaPastaPasta referenced this in commit a9651e5e70 on Jul 29, 2020
  12. PastaPastaPasta referenced this in commit cd3248d3fd on Jul 29, 2020
  13. PastaPastaPasta referenced this in commit bd8f48820e on Jul 29, 2020
  14. CryptoCentric referenced this in commit 2aa44c5021 on Jul 2, 2021
  15. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-03 07:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me