Cross compile QT5.15 with xcb

Started by Alessio, February 25, 2022, 03:12:56 PM

Previous topic - Next topic

Alessio

Hello,
I am trying to compile the QT 5.15 fro cross compile for my board A20-SOM204-EVB but I have a problem.
In my board I have installed the last image for the A20 given from Olimex, Debian bullseye.
For compile i use a Virtual Machine with Ubuntu 20.04.
In the Virtual Machine I have download the last Linaro Toolchain from this link: https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz.
After i have created the directory a20 in /mnt and i have done the following command for create my sysroot:
sshfs -o allow_other -o debug olimex@192.168.1.61:/ /mnt/a20/
After I have downloaded the cross-compile-tools.git and i have execute this command for set all the symlink:
./fixQualifiedLibraryPaths /mnt/a20/ /home/olimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
Where in /mnt/a20 there is my sysroot and in /home/olimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf there is my toolchain.
After I have downloaded the source code of the qt 5.15 with this command:
wget https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz
I have created the directory linux-a20olimex-g++ in qtbase/mkspecs/devices/ and with this command I have coped this file in my new directory:
cp qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf qtbase/mkspecs/devices/linux-a20olimex-g++/
cp qtbase/mkspecs/devices/linux-beagleboard-g++/qplatformdefs.h qtbase/mkspecs/devices/linux-a20olimex-g++/

I have modify the qmake.conf coping the following text:


MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)


# modifications to g++.conf
QMAKE_CC                = /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
QMAKE_CXX               = /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
QMAKE_LINK              = /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-objcopy
QMAKE_NM                = /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-nm -P
QMAKE_STRIP             = /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip

QMAKE_LIBS_X11 = -lxcb -lX11 -lXau -lXext -lSM -lICE -lfreetype -lXrandr /mnt/a20/usr/lib/arm-linux-gnueabihf/libxcb-xkb.so.1 /mnt/a20/usr/lib/arm-linux-gnueabihf/libxcb.so.1 /mnt/a20/usr/lib/arm-linux-gnueabihf/libX11.so.6 /mnt/a20/usr/lib/arm-linux-gnueabihf/libXau.so.6 /mnt/a20/usr/lib/arm-linux-gnueabihf/libXext.so.6 /mnt/a20/usr/lib/arm-linux-gnueabihf/libXrender.so.1 /mnt/a20/usr/lib/arm-linux-gnueabihf/libz.so.1 -lXrandr -lXrender -lxcb-damage -lxcb-composite -lxcb-randr -lxcb-xv -lxcb-xvmc -lxcb-xtest -lxcb-xfixes -lxcb-xinerama -lxcb-xf86dri -lxcb-shape -lxcb-shm -lxcb-sync -lxcb-render -lxcb-res -lxcb-screensaver -lxcb-dpms -lxcb-record -lxcb-glx -lXfixes -lXext -lX11-xcb -lX11 -lxcb -lXau -lXdmcp -lfontconfig -lfreetype -lexpat -lm -lz -lstdc++ -lglib-2.0

PKG_CONFIG_LIBDIR = /mnt/a20/usr

load(qt_config)


After I have create a directory for the build, the qt-build, and inside this directory I have execute this command:
sudo ~/qt-everywhere-src-5.15.2/configure  -device linux-a20olimex-g++ -prefix /opt/QT -sysroot /mnt/a20 -opensource -confirm-license -optimized-qmake -release -make libs -prefix /opt/qt5.3.2olim2 -no-pch -nomake examples -nomake tests -xcb -v

But it give me this error:
ERROR: Feature 'xcb' was enabled, but the pre-condition 'features.thread && libs.xcb && tests.xcb_syslibs && features.xkbcommon-x11' failed.

ERROR: The OpenGL functionality tests failed!
You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.


In the config.log i can see this error relative to the xcb plugins:

looking for library xcb
Trying source 0 (type pkgConfig) of library xcb ...
+ PKG_CONFIG_SYSROOT_DIR=/mnt/a20 PKG_CONFIG_LIBDIR=/mnt/a20/usr/lib/pkgconfig:/mnt/a20/usr/share/pkgconfig:/mnt/a20/usr/lib/arm-linux-gnueabihf/pkgconfig /usr/bin/pkg-config --exists --silence-errors xcb '>=' 1.11
pkg-config did not find package.
  => source produced no result.
Trying source 1 (type inline) of library xcb ...
+ cd /home/ollimex/qt-build/config.tests/xcb && PKG_CONFIG_SYSROOT_DIR=/mnt/a20 PKG_CONFIG_LIBDIR=/mnt/a20/usr/lib/pkgconfig:/mnt/a20/usr/share/pkgconfig:/mnt/a20/usr/lib/arm-linux-gnueabihf/pkgconfig /home/ollimex/qt-build/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/mnt/a20" "QMAKE_CXXFLAGS += --sysroot=/mnt/a20" "QMAKE_LFLAGS += --sysroot=/mnt/a20" -early "CONFIG += cross_compile" 'QMAKE_USE += xcb' 'QMAKE_LIBS_XCB = -lxcb' /home/ollimex/qt-build/config.tests/xcb
+ cd /home/ollimex/qt-build/config.tests/xcb && MAKEFLAGS= /usr/bin/make
> /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe --sysroot=/mnt/a20 --sysroot=/mnt/a20 -O2 -w -fPIC  -I. -I/home/ollimex/qt-everywhere-src-5.15.2/qtbase/mkspecs/devices/linux-a20olimex-g++ -o main.o main.cpp
> /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ --sysroot=/mnt/a20 --sysroot=/mnt/a20 -Wl,-O1 -o xcb main.o   -lxcb   
> /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libXau.so.6, needed by /mnt/a20/lib/arm-linux-gnueabihf/libxcb.so, not found (try using -rpath or -rpath-link)
> /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libXdmcp.so.6, needed by /mnt/a20/lib/arm-linux-gnueabihf/libxcb.so, not found (try using -rpath or -rpath-link)
> /mnt/a20/lib/arm-linux-gnueabihf/libxcb.so: undefined reference to `XauDisposeAuth'
> /mnt/a20/lib/arm-linux-gnueabihf/libxcb.so: undefined reference to `XdmcpWrap'
> /mnt/a20/lib/arm-linux-gnueabihf/libxcb.so: undefined reference to `XauGetBestAuthByAddr'
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:67: xcb] Error 1
 => source failed verification.
test config.qtbase_gui.libraries.xcb FAILED


and this:

> /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libxcb.so.1, needed by /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so, not found (try using -rpath or -rpath-link)
> /home/ollimex/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libxcb-xkb.so.1, needed by /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so, not found (try using -rpath or -rpath-link)
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_get_atom_name'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_sym_map_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_sym_map_syms'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_type_map_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_state_reply'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_key_names_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_reply'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_compat_map_si_rtrn_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_modmap_rtrn_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_alias_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_syms_rtrn_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_modmap_rtrn_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_key_aliases_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_vmodmap_rtrn_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_id'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_virtual_mod_names'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_state'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_get_extension_data'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_indicator_map'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_explicit_rtrn_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_type_preserve_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_indicator_map_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_reply'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_vmods_rtrn'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_types_rtrn_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_n_levels_per_type'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_action_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_type_map_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_compat_map_si_rtrn_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_compat_map_reply'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_syms_rtrn_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_type_preserve_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_n_levels_per_type_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_acts_rtrn_count'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_acts_rtrn_acts_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_v_mod_map_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_type_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_vmodmap_rtrn_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_set_explicit_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_type_names_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_controls'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_device_info'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_key_names_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_kt_map_entry_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_get_atom_name_name'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_use_extension'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_compat_map'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_sym_interpret_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_indicator_map_reply'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_indicator_map_maps_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_groups_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_key_aliases_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_use_extension_reply'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_explicit_rtrn_iterator'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_mod_def_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_get_atom_name_name_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_device_info_reply'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_unpack'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_mod_map_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_type_names'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_get_atom_name_reply'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_indicator_names'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_types_rtrn_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_kt_level_names'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_map_map_acts_rtrn_count_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_sym_map_syms_length'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_unpack'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_key_name_next'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_discard_reply'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_names_value_list_groups'
> /mnt/a20/lib/arm-linux-gnueabihf/libxkbcommon-x11.so: undefined reference to `xcb_xkb_get_controls_reply'
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:67: xkbcommon_x11] Error 1
 => source failed verification.
test config.qtbase_gui.libraries.xkbcommon_x11 FAILED


Someone can give me an advice for resolve this problem?
Thanks.