Qt5 QPA Plugin for linuxfb depends on X11 libs



  • Hi, I would like to build a minimal Qt version with only linux framebuffer QPA support from source. So I removed all other QPA plugins in configure.

    I used the following configure parameter:

    configure -prefix /opt/qt-embedded-5.4.0 -release -commercial -c++11 -shared -largefile -no-sql-mysql -no-sql-sqlite -no-qml-debug -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-pkg-config -qt-zlib -no-mtdev -no-journald -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -no-openssl -qt-pcre -system-xcb -qt-xkbcommon -no-xinput2 -no-xcb-xlib -no-glib -no-pulseaudio -no-alsa -no-gtkstyle -rpath -silent -no-nis -no-cups -no-iconv -no-evdev -no-icu -no-fontconfig -strip -no-pch -no-dbus -no-use-gold-linker -no-xcb -no-eglfs -no-kms -no-directfb -linuxfb -qpa linuxfb -no-opengl -no-system-proxies
    

    The library builds fine. When I call ldd on an example binary (examples/gui/analogclock) I get the following dependencies:

    ldd analogclock 
    
            linux-gate.so.1 (0xb77a5000)
            libQt5Gui.so.5 => /opt/qt-embedded-5.4.0/lib/libQt5Gui.so.5 (0xb7314000)
            libQt5Core.so.5 => /opt/qt-embedded-5.4.0/lib/libQt5Core.so.5 (0xb6d75000)
            libpthread.so.0 => /lib/libpthread.so.0 (0xb6d35000)
            libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6c48000)
            libm.so.6 => /lib/libm.so.6 (0xb6c01000)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6be4000)
            libc.so.6 => /lib/libc.so.6 (0xb6a38000)
            libdl.so.2 => /lib/libdl.so.2 (0xb6a33000)
            librt.so.1 => /lib/librt.so.1 (0xb6a2a000)
            /lib/ld-linux.so.2 (0xb77a8000)
    

    This looks fine. Then I wanted to run the example on my embedded device, but it did not run, because the linuxfb QPA plugin was not loaded successfully. I activated QT_DEBUG_PLUGINS environment variable and found out that the plugin libqlinuxfb.so, which was created with the Qt library, needs X11 libraries:

    ldd libqlinuxfb.so
    
            linux-gate.so.1 (0xb77ce000)
            libudev.so.1 => /usr/lib/libudev.so.1 (0xb76fb000)
            libEGL.so.1 => /usr/lib/libEGL.so.1 (0xb76d3000)
            libQt5Gui.so.5 => /opt/qt-embedded-5.4.0/lib/libQt5Gui.so.5 (0xb7243000)
            libQt5Core.so.5 => /opt/qt-embedded-5.4.0/lib/libQt5Core.so.5 (0xb6ca4000)
            libpthread.so.0 => /lib/libpthread.so.0 (0xb6c87000)
            libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6b9a000)
            libm.so.6 => /lib/libm.so.6 (0xb6b54000)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6b37000)
            libc.so.6 => /lib/libc.so.6 (0xb698b000)
            librt.so.1 => /lib/librt.so.1 (0xb6982000)
            /lib/ld-linux.so.2 (0xb77d1000)
            libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0xb697e000)
            libxcb-dri2.so.0 => /usr/lib/libxcb-dri2.so.0 (0xb6978000)
            libxcb-xfixes.so.0 => /usr/lib/libxcb-xfixes.so.0 (0xb6970000)
            libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb694d000)
            libgbm.so.1 => /usr/lib/libgbm.so.1 (0xb693f000)
            libwayland-client.so.0 => /usr/lib/libwayland-client.so.0 (0xb6932000)
            libwayland-server.so.0 => /usr/lib/libwayland-server.so.0 (0xb6922000)
            libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb68f9000)
            libdl.so.2 => /lib/libdl.so.2 (0xb68f4000)
            libdrm.so.2 => /usr/lib/libdrm.so.2 (0xb68e6000)
            libXau.so.6 => /usr/lib/libXau.so.6 (0xb68e1000)
            libffi.so.4 => /usr/lib/libffi.so.4 (0xb68da000)
    

    X11 libraries are not available on my embedded device. Why does the framebuffer plugin need the X11 dependencies??? Does anyone know how to fix this?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Might be the -system-xcb and/or the -qt-xkbcomon options.

    Out of curiosity, what is the target system ? You don't seem to cross-compile so your system libraries are likely to get picked.



  • Thanks for the reply!

    In the configure documentation of version 5.4.0 (which I'm using) I only found -qt-xcb or -system-xcb and -qt-xkbcommon or -system-xkbcommon but no way to deactivate these. I switched from -system-xcb to -qt-xcb but nothing changed.

    There is also the option -no-xcb. Maybe that interferes with -qt-xcb or -system-xcb? So I tried it only with -no-xcb and also removed -qt-xkbcommon. But no change at all.

    I want to use the Qt build on an AMD Geode LX board. It is x86 like my workstation with openSUSE 13.2 (32bit) where I compile the library. So I thought that I don't need to cross compile. Would cross compiling be a better solution?


  • Lifetime Qt Champion

    Indeed, you don't need to cross-compile, however, like I said before this means that whatever you have on your workstation available will get picked by the configure process.

    If you don't want x11 support then use -no-xcb and disable everything that is xcb related.

    What does the configure summary tells you ?

    Also one thing to take into account, when you change a configure option, you have to redo the build, you can't just call configure again on a already built Qt.



  • I used the following configure script and disabled all x11 options I found:

    #!/bin/bash
    ./configure \
    -prefix /opt/qt-embedded-5.4.0 \
    -release \
    -commercial \
    -c++11 \
    -shared \
    -largefile \
    -no-sql-mysql \
    -no-sql-sqlite \
    -no-qml-debug \
    -no-sse2 \
    -no-sse3 \
    -no-ssse3 \
    -no-sse4.1 \
    -no-sse4.2 \
    -no-avx \
    -no-avx2 \
    -no-pkg-config \
    -qt-zlib \
    -no-mtdev \
    -no-journald \
    -qt-libpng \
    -qt-libjpeg \
    -qt-freetype \
    -qt-harfbuzz \
    -no-openssl \
    -qt-pcre \
    -no-xinput2 \
    -no-xcb-xlib \
    -no-glib \
    -no-pulseaudio \
    -no-alsa \
    -no-gtkstyle \
    -rpath \
    -silent \
    -no-nis \
    -no-cups \
    -no-iconv \
    -no-evdev \
    -no-icu \
    -no-fontconfig \
    -strip \
    -no-pch \
    -no-dbus \
    -no-use-gold-linker \
    -no-xcb \
    -no-eglfs \
    -no-kms \
    -no-directfb \
    -linuxfb \
    -qpa linuxfb \
    -no-opengl \
    -no-system-proxies
    

    The configure summary is the following:

    Build type:    linux-g++ (i386, CPU features: none detected)
    Platform notes:
    
                - Also available for Linux: linux-kcc linux-icc linux-cxx
            
    Build options:
      Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent egl egl_x11 eventfd freetype full-config getaddrinfo getifaddrs harfbuzz inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap no-pkg-config pcre png posix_fallocate qpa qpa reduce_exports reduce_relocations release rpath shared silent small-config xlib xrender zlib 
      Build parts ............ libs tools examples
      Mode ................... release
      Using C++11 ............ yes
      Using gold linker....... no
      Using PCH .............. no
      Target compiler supports:
        SSE2/SSE3/SSSE3 ...... no/no/no
        SSE4.1/SSE4.2 ........ no/no
        AVX/AVX2 ............. no/no
    
    Qt modules and options:
      Qt D-Bus ............... no
      Qt Concurrent .......... yes
      Qt GUI ................. yes
      Qt Widgets ............. yes
      Large File ............. yes
      QML debugging .......... no
      Use system proxies ..... no
    
    Support enabled for:
      Accessibility .......... yes
      ALSA ................... no
      CUPS ................... no
      Evdev .................. no
      FontConfig ............. no
      FreeType ............... qt
      Glib ................... no
      GTK theme .............. no
      HarfBuzz ............... yes (bundled copy)
      Iconv .................. no
      ICU .................... no
      Image formats: 
        GIF .................. yes (plugin, using bundled copy)
        JPEG ................. yes (plugin, using bundled copy)
        PNG .................. yes (in QtGui, using bundled copy)
      journald ............... no
      mtdev .................. no
      Networking: 
        getaddrinfo .......... yes
        getifaddrs ........... yes
        IPv6 ifname .......... yes
        OpenSSL .............. no
      NIS .................... no
      OpenGL / OpenVG: 
        EGL .................. yes
        OpenGL ............... no
        OpenVG ............... no
      PCRE ................... yes (bundled copy)
      pkg-config ............. no 
      PulseAudio ............. no
      QPA backends: 
        DirectFB ............. no
        EGLFS ................ no
        KMS .................. no
        LinuxFB .............. yes
        XCB .................. no
      Session management ..... yes
      SQL drivers: 
        DB2 .................. no
        InterBase ............ no
        MySQL ................ no
        OCI .................. no
        ODBC ................. no
        PostgreSQL ........... no
        SQLite 2 ............. no
        SQLite ............... no
        TDS .................. no
      udev ................... yes
      xkbcommon .............. no
      zlib ................... yes (bundled copy)
    
    

    What I'm wondering about is that under OpenGL/OpenVG it says EGL yes although the parameter -no-opengl ist set???

    I recompiled everything, but the error is still the same. Only the platform plugin libqlinuxfb.so depends on x11 libs (and wayland). All other stuff not. Could I compile the platform plugin manual to fix the problem.


  • Lifetime Qt Champion

    EGL with -no-opengl is indeed surprising.

    When you say recompile everything, do you mean from a clean state ?

    By the way, are you locked to 5.4 ? 5.6.1 is just around the corner if you need LTS.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.