Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Fail to build Qt in depends on ARM 32bit #18536

Closed
hebasto opened this issue Apr 6, 2020 · 10 comments · Fixed by #20641
Closed

build: Fail to build Qt in depends on ARM 32bit #18536

hebasto opened this issue Apr 6, 2020 · 10 comments · Fixed by #20641

Comments

@hebasto
Copy link
Member

hebasto commented Apr 6, 2020

Having the low-end system ODROID-HC1:

$ uname -srm
Linux 4.14.173-173 armv7l
$ lsb_release -ds
Ubuntu 18.04.4 LTS
$ /usr/bin/make --version | head -2
GNU Make 4.1
Built for arm-unknown-linux-gnueabihf

Trying to build depends:

$ make -C depends
...
Configure summary:

Build type: linux-g++ (arm, CPU features: <none>)
Configuration: enable_new_dtags largefile precompile_header silent release c++11 dbus no-qml-debug reduce_exports release_tools static stl
Build options:
  Mode ................................... release; optimized tools
  Optimize release build for size ........ no
  Building shared libraries .............. no
  Using C++ standard ..................... C++11
  Using ccache ........................... no
  Using gold linker ...................... no
  Using new DTAGS ........................ yes
  Using precompiled headers .............. yes
  Using LTCG ............................. no
  Target compiler supports:
    NEON ................................. no
  Build parts ............................ libs tools
Qt modules and options:
  Qt Concurrent .......................... no
  Qt D-Bus ............................... yes
  Qt D-Bus directly linked to libdbus .... no
  Qt Gui ................................. yes
  Qt Network ............................. yes
  Qt Sql ................................. no
  Qt Testlib ............................. yes
  Qt Widgets ............................. yes
  Qt Xml ................................. no
Support enabled for:
  Using pkg-config ....................... yes
  QML debugging .......................... no
  udev ................................... no
  Using system zlib ...................... yes
Qt Core:
  DoubleConversion ....................... yes
    Using system DoubleConversion ........ no
  GLib ................................... no
  iconv .................................. no
  ICU .................................... no
  Logging backends:
    journald ............................. no
    syslog ............................... no
    slog2 ................................ no
  Using system PCRE2 ..................... no
Qt Network:
  getaddrinfo() .......................... yes
  getifaddrs() ........................... yes
  IPv6 ifname ............................ yes
  libproxy ............................... no
  OpenSSL ................................ yes
    Qt directly linked to OpenSSL ........ yes
  SCTP ................................... no
  Use system proxies ..................... yes
Qt Gui:
  Accessibility .......................... yes
  FreeType ............................... yes
    Using system FreeType ................ yes
  HarfBuzz ............................... yes
    Using system HarfBuzz ................ no
  Fontconfig ............................. yes
  Image formats:
    GIF .................................. no
    ICO .................................. no
    JPEG ................................. no
      Using system libjpeg ............... no
    PNG .................................. yes
      Using system libpng ................ no
  EGL .................................... no
  OpenVG ................................. no
  OpenGL:
    Desktop OpenGL ....................... no
    OpenGL ES 2.0 ........................ no
    OpenGL ES 3.0 ........................ no
    OpenGL ES 3.1 ........................ no
  Session Management ..................... no
Features used by QPA backends:
  evdev .................................. yes
  libinput ............................... no
  INTEGRITY HID .......................... no
  mtdev .................................. no
  tslib .................................. no
  xkbcommon-evdev ........................ no
QPA backends:
  DirectFB ............................... no
  EGLFS .................................. no
  LinuxFB ................................ no
  VNC .................................... no
  Mir client ............................. no
  X11:
    Using system-provided XCB libraries .. no
    EGL on X11 ........................... no
    Xinput2 .............................. no
    XCB XKB .............................. yes
    XLib ................................. no
    XCB render ........................... yes
    XCB GLX .............................. no
    XCB Xlib ............................. no
    Using system-provided xkbcommon ...... no
Qt Widgets:
  GTK+ ................................... no
  Styles ................................. Fusion Windows
Qt PrintSupport:
  CUPS ................................... no
Qt Sql:
  DB2 (IBM) .............................. no
  InterBase .............................. no
  MySql .................................. no
  OCI (Oracle) ........................... no
  ODBC ................................... no
  PostgreSQL ............................. no
  SQLite2 ................................ no
  SQLite ................................. no
    Using system provided SQLite ......... no
  TDS (Sybase) ........................... no
...
Project ERROR: Unknown module(s) in QT: xml
funcs.mk:251: recipe for target '/home/hebasto/bitcoin/depends/work/build/armv7l-unknown-linux-gnueabihf/qt/5.9.8-32c67940323/qtbase/.stamp_configured' failed

With NO_QT=1 depends are built successfully.

@fanquake
Copy link
Member

fanquake commented Apr 7, 2020

I'm pretty sure this is an issue with Qt and newer versions of make. What version are you using here?

@hebasto
Copy link
Member Author

hebasto commented Apr 7, 2020

I'm pretty sure this is an issue with Qt and newer versions of make. What version are you using here?

Qt is 5.9.8 as it is built in depends.

$ dpkg --status make | grep Version
Version: 4.1-9.1ubuntu1

It seems nothing unusual...

@fanquake
Copy link
Member

fanquake commented Apr 7, 2020

If you try and build with an older version of make, like 3.8x, I'm pretty certain it will work. I have seen this same failure before.

@fanquake fanquake removed the Bug label Apr 7, 2020
@hebasto
Copy link
Member Author

hebasto commented Apr 8, 2020

If you try and build with an older version of make, like 3.8x, I'm pretty certain it will work. I have seen this same failure before.

Built and installed the old make:

$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for armv7l-unknown-linux-gnu

but it didn't help:

$ make qt -C depends
...
Project ERROR: Unknown module(s) in QT: xml
make: *** [/home/hebasto/bitcoin/depends/work/build/armv7l-unknown-linux-gnueabihf/qt/5.9.8-52a02fcd47f/qtbase/.stamp_configured] Error 3
make: Leaving directory `/home/hebasto/bitcoin/depends'

And the log does not mention funcs.mk:251: ... now.

@fanquake
Copy link
Member

fanquake commented Apr 8, 2020

Right, so I guess it's only on macOS where using an older make fixes the issue. In any case, this seems like something that should be taken upstream to Qts bug tracker. I don't think we need an issue open for it here.

@hebasto hebasto closed this as completed Apr 9, 2020
@hebasto
Copy link
Member Author

hebasto commented Jul 6, 2020

I've managed to build Qt in depends on Armbian Focal (on the same ODROID-HC1) with the following diff:

diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk
index 631851855..545f4068e 100644
--- a/depends/packages/qt.mk
+++ b/depends/packages/qt.mk
@@ -110,7 +110,6 @@ $(package)_config_opts += -no-feature-undostack
 $(package)_config_opts += -no-feature-undoview
 $(package)_config_opts += -no-feature-vnc
 $(package)_config_opts += -no-feature-wizard
-$(package)_config_opts += -no-feature-xml
 
 $(package)_config_opts_darwin = -no-dbus
 $(package)_config_opts_darwin += -no-opengl

Also the build system didn't find zconf.h header in the depends/armv7l-unknown-linux-gnueabihf/include directory.
So the following was required:

$ sudo apt install zlib1g-dev

Eventually,

$ make qt -C depends

@fanquake
Copy link
Member

Is this fixed after #21376 ?

@hebasto
Copy link
Member Author

hebasto commented Mar 16, 2021

@fanquake

Is this fixed after #21376 ?

No.

$ head -n 4 /etc/armbian.txt
--------------------------------------------------------------------------------
Title:			Armbian 21.02.2 Odroidxu4 Ubuntu focal legacy
Kernel:			Linux 
Build date:		14.02.2021
$
$ git clean -xdff
$ git rev-parse HEAD
5ef16038a1a8adc25438d77f60d83b2c01738fcf
$
$ make -C depends qt_configured
...
Project ERROR: Unknown module(s) in QT: xml
make: *** [funcs.mk:276: /home/hebasto/bitcoin/depends/work/build/armv7l-unknown-linux-gnueabihf/qt/5.12.10-6a06b2c1f18/./.stamp_configured] Error 3
make: Leaving directory '/home/hebasto/bitcoin/depends'

@hebasto
Copy link
Member Author

hebasto commented Mar 16, 2021

FWIW, the following patch did not help:

--- a/depends/packages/qt.mk
+++ b/depends/packages/qt.mk
@@ -135,6 +135,7 @@ $(package)_config_opts_linux += -no-opengl
 $(package)_config_opts_linux += -no-feature-vulkan
 $(package)_config_opts_linux += -dbus-runtime
 $(package)_config_opts_arm_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
+$(package)_config_opts_armv7l_linux += -platform linux-arm-gnueabihf-g++
 $(package)_config_opts_i686_linux  = -xplatform linux-g++-32
 $(package)_config_opts_x86_64_linux = -xplatform linux-g++-64
 $(package)_config_opts_aarch64_linux = -xplatform linux-aarch64-gnu-g++
@@ -233,6 +234,8 @@ define $(package)_preprocess_cmds
   cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
   cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \
   sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
+  cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/linux-arm-gnueabihf-g++ && \
+  sed -i.old "s/arm-linux-gnueabi-/arm-linux-gnueabihf-/g" qtbase/mkspecs/linux-arm-gnueabihf-g++/qmake.conf && \
   echo "!host_build: QMAKE_CFLAGS     += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
   echo "!host_build: QMAKE_CXXFLAGS   += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
   echo "!host_build: QMAKE_LFLAGS     += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \

@hebasto
Copy link
Member Author

hebasto commented May 6, 2021

Should be fixed in Qt 5.15.x (#21589 (comment)).

sidhujag pushed a commit to syscoin/syscoin that referenced this issue Jul 23, 2021
1155978 build, qt: Do not install *.prl files (Hennadii Stepanov)
763793b build, qt: Fix wrong cross-compiling detection on macOS (Hennadii Stepanov)
3098272 build, qt: Force bootstrap while building linguist tools (Hennadii Stepanov)
689320e build, qt: Drop translations.pro hack (Hennadii Stepanov)
6a1f98f build, qt: Drop lrelease dependency patch (Hennadii Stepanov)
39e561e build, qt: Add linguist_tools list (Hennadii Stepanov)
27d3def build: Use Qt top-level build facilities (Hennadii Stepanov)

Pull request description:

  This PR:
  - uses Qt top-level build facilities without the need to download all-in-one archive
  - is based on **BlockMechanic**'s [idea](bitcoin#20600), and is an alternative to bitcoin#20600
  - makes it easy to integrate [new modules](bitcoin#16883) into static builds
  - has the minimal diff
  - makes the qt package build process streamlined by dropping some patches and hacks (an alternative to  bitcoin#21420 and bitcoin#20642)

  Fixes bitcoin#18536 (a non-intrusive alternative to bitcoin#21589 and bitcoin#19785).

  Fixes bitcoin#14648.

  Fixes bitcoin#21588 (a non-intrusive alternative to bitcoin#21591).

  Required for adding [Wayland support](bitcoin#19950) on Linux.

  ---

  **Note for reviewers**: With 9046de8 from bitcoin#21995 it is easy to verify that there are no changes in the resulted `qt` package archive on the per commit basis. For example, for `HOST=i686-pc-linux-gnu` no commit in this PR introduces any changes.

ACKs for top commit:
  fanquake:
    ACK 1155978

Tree-SHA512: 667b06b72cb7ff26d68b9b88e8dddb51084783ca9e3d80b3392710794c1dc7fd77bbcc3ccf4ccece9919d33b9bf8fce13c5059502bd228021dc7c93fdb87ca7a
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.