Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-97186

Ozone link error missing libX11 when cross compiling for arm

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.2.0
    • WebEngine
    • None
    • Debian 11
    • Linux/Other display system

    Description

      I am cross-compiling Qt 6.2.0 for an Embedded Linux arm device (OpenGL ES 2) running Debian 11.

      QtWebEngine built successfully. But i received an undefined reference to "XkbGetState" linker error for QtWebEngineCore.so:

       

      Linking CXX shared library qtbase/lib/libQt6WebEngineCore.so.6.2.0
      FAILED: qtbase/lib/libQt6WebEngineCore.so.6.2.0 qtwebengine/src/core/api/WebEngineCore.version /build/target/qtwebengine/src/core/api/WebEngineCore.version
      cd /qtsrc/qt-everywhere-src-6.2.0/qtwebengine/src/core/api && /usr/bin/perl /qtsrc/qt-everywhere-src-6.2.0/qtbase/mkspecs/features/data/unix/findclasslist.pl < /build/target/qtwebengine/src/core/api
      /WebEngineCore.version.in > /build/target/qtwebengine/src/core/api/WebEngineCore.version && cd /build/target && /usr/bin/arm-linux-gnueabihf-g++ -fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon -DLI
      NUX=1 -DEGL_API_FB=1 -mfloat-abi=hard -g -DNDEBUG -O2  -Wl,--version-script,/build/target/qtwebengine/src/core/api/WebEngineCore.version -Wl,--no-undefined @/build/target/qtwebengine/src/core/RelWit
      hDebInfo/arm/QtWebEngineCore_objects.rsp -Wl,--enable-new-dtags -shared -Wl,-soname,libQt6WebEngineCore.so.6 -o qtbase/lib/libQt6WebEngineCore.so.6.2.0 qtwebengine/src/core/api/CMakeFiles/WebEngineC
      ore.dir/WebEngineCore_autogen/mocs_compilation.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qtwebenginecoreglobal.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebengin
      ecertificateerror.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebengineclientcertificateselection.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebengineclientcertifi
      catestore.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginecontextmenurequest.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginecookiestore.cpp.o qtwebengine
      /src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginedownloadrequest.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginefindtextresult.cpp.o qtwebengine/src/core/api/CMakeFiles/We
      bEngineCore.dir/qwebenginefullscreenrequest.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginehistory.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginehttpre
      quest.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebengineloadinginfo.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginemessagepumpscheduler.cpp.o qtwebengine/s
      rc/core/api/CMakeFiles/WebEngineCore.dir/qwebenginenavigationrequest.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginenewwindowrequest.cpp.o qtwebengine/src/core/api/CMakeFiles/
      WebEngineCore.dir/qwebenginenotification.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginepage.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebengineprofile.cpp.
      o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginequotarequest.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebengineregisterprotocolhandlerrequest.cpp.o qtwebengine/
      src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginescript.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebenginescriptcollection.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineC
      ore.dir/qwebenginesettings.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebengineurlrequestinfo.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebengineurlrequestjob.cp
      p.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebengineurlscheme.cpp.o qtwebengine/src/core/api/CMakeFiles/WebEngineCore.dir/qwebengineurlschemehandler.cpp.o  -Wl,-rpath,/build/target/q
      tbase/lib:  qtbase/lib/libQt6WebChannel.so.6.2.0  qtbase/lib/libQt6Positioning.so.6.2.0  -Wl,--start-group @/build/target/qtwebengine/src/core/RelWithDebInfo/arm/QtWebEngineCore_archives.rsp -Wl,--e
      nd-group  -Wl,--no-fatal-warnings @/build/target/qtwebengine/src/core/RelWithDebInfo/arm/QtWebEngineCore_libs.rsp -Wl,--no-fatal-warnings  qtbase/lib/libQt6Quick.so.6.2.0  qtbase/lib/libQt6OpenGL.so
      .6.2.0  qtbase/lib/libQt6Gui.so.6.2.0  /usr/lib/arm-linux-gnueabihf/libGLESv2.so  /usr/lib/arm-linux-gnueabihf/libEGL.so  //usr/lib/arm-linux-gnueabihf/libxkbcommon.so  qtbase/lib/libQt6QmlModels.so
      .6.2.0  qtbase/lib/libQt6Qml.so.6.2.0  qtbase/lib/libQt6Network.so.6.2.0  qtbase/lib/libQt6Core.so.6.2.0  -lpthread  -Wl,-rpath-link,/build/target/qtbase/lib && :
      /usr/lib/gcc-cross/arm-linux-gnueabihf/10/../../../../arm-linux-gnueabihf/bin/ld: /build/target/qtwebengine/src/core/RelWithDebInfo/arm/obj/ABS_PATH/qtsrc/qt-everywhere-src-6.2.0/qtwebengine/src/cor
      e/ozone/qt/ozone_platform_qt.o: in function `ui::(anonymous namespace)::OzonePlatformQt::InitializeUI(ui::OzonePlatform::InitParams const&)':
      /qtsrc/qt-everywhere-src-6.2.0/qtwebengine/src/core/ozone/ozone_platform_qt.cpp:164: undefined reference to `XkbGetState'
      collect2: error: ld returned 1 exit status
      

      After checking the source i saw that the section is guarded with a xkbcommon build flag. So i got it fixed by also linking libX11 in "qtwebengine/src/core/ozone/BUILD.gn" (see the attached diff/patch).

      But i don't know if this is the correct way to solve this or if i missed something in the first place?

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            raven-worx raven-worx
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes