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

Integrity linker can't cope with duplicate object files on command line

    XMLWordPrintable

Details

    • Integrity
    • 7e794d71c0bf0f6e812aa1c7794b709889f202fd (qt/qtbase/dev) 2ad29c0a3ae1252c6c30eaca2aa06c131a67f819 (qt/qtbase/6.2) 887f2d5451efffde1a9f80733ea435088e6c1888 (qt/qtbase/6.2.0)

    Description

      When building a Qt Quick qtdeclarative/examples/quick/animation example with CMake targeting Integrity, the linker fails with

      [100%] Linking CXX executable animation
      [elxr] (error #539) symbol __sti___40_QEglFSEmulatorIntegrationPlugin_init_cpp_11acedbd multiply defined in:
      /home/tatiana/work/qt6/staticbuilds/6.2branch/targetbuild/qtbase/plugins/egldeviceintegrations/objects-Release/QEglFSEmulatorIntegrationPlugin_init/QEglFSEmulatorIntegrationPlugin_init.cpp.o
       /home/tatiana/work/qt6/staticbuilds/6.2branch/targetbuild/qtbase/./plugins/egldeviceintegrations/objects-Release/QEglFSEmulatorIntegrationPlugin_init/QEglFSEmulatorIntegrationPlugin_init.cpp.o
      [elxr] (error #539) symbol __sti___32_QEglFSIntegrationPlugin_init_cpp_11acedbd multiply defined in:
      /home/tatiana/work/qt6/staticbuilds/6.2branch/targetbuild/qtbase/plugins/platforms/objects-Release/QEglFSIntegrationPlugin_init/QEglFSIntegrationPlugin_init.cpp.o
       /home/tatiana/work/qt6/staticbuilds/6.2branch/targetbuild/qtbase/./plugins/platforms/objects-Release/QEglFSIntegrationPlugin_init/QEglFSIntegrationPlugin_init.cpp.o
      [elxr] (error #539) symbol __sti___39_QEglFSOpenWFDIntegrationPlugin_init_cpp_11acedbd multiply defined in:
      /home/tatiana/work/qt6/staticbuilds/6.2branch/targetbuild/qtbase/plugins/egldeviceintegrations/objects-Release/QEglFSOpenWFDIntegrationPlugin_init/QEglFSOpenWFDIntegrationPlugin_init.cpp.o
       /home/tatiana/work/qt6/staticbuilds/6.2branch/targetbuild/qtbase/./plugins/egldeviceintegrations/objects-Release/QEglFSOpenWFDIntegrationPlugin_init/QEglFSOpenWFDIntegrationPlugin_init.cpp.o
      [elxr] (error #539) symbol __sti___19_QGifPlugin_init_cpp_11acedbd multiply defined in:
      /home/tatiana/work/qt6/staticbuilds/6.2branch/targetbuild/qtbase/plugins/imageformats/objects-Release/QGifPlugin_init/QGifPlugin_init.cpp.o
       /home/tatiana/work/qt6/staticbuilds/6.2branch/targetbuild/qtbase/./plugins/imageformats/objects-Release/QGifPlugin_init/QGifPlugin_init.cpp.o
      
      

      The same object file ends up being passed to the linker with slightly different paths:
      One with

      /qtbase/./plugins
      /qtbase/plugins
      

      Note the missing dot.

      Even when manually editing the link line to remove the ./ part, so the same object file is duplicated twice with the exact same file path, the linker still can't deduplicate it and causes an error when linking.

      We need to figure out why CMake is passing the same object file twice to the link line and remove the duplication.

      Note Qt was configured and built with following commands:

      cmake ../qt5/ -DQT_HOST_PATH=/home/tatiana/work/qt6/staticbuilds/hostbuild/qtbase -DCMAKE_TOOLCHAIN_FILE=/home/tatiana/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/toolchain_custom.cmake -DQT_QMAKE_TARGET_MKSPEC=devices/integrity-armv8-SA8155P  -DBUILD_qtdoc=OFF -DBUILD_qttranslations=OFF -DFEATURE_printdialog=OFF --debug-trycompile -DFEATURE_dbus=OFF -GNinja -DUNIX=ON -DEGL_LIBRARY=/home/tatiana/sa8155/es7/es7_dev_env/hlos_dev_boot/libeglmegapack.a -DEGL_INCLUDE_DIR=/home/tatiana/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp/AMSS/multimedia/graphics/include/public -DFEATURE_dnslookup=OFF -DFEATURE_glib=OFF -DFEATURE_system_pcre2=OFF -DFEATURE_sql_mysql=OFF
      
      
      cmake --build . --parallel 8
      
      cmake --install .

       

      An alternative workaround I proposed is to modify the Integrity CMake toolchain file to use https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_LINKER_LAUNCHER.html to set a shell script wrapper that would filter out duplicate object files and then pass that on to the linker.

      Attachments

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

        Activity

          People

            semlanik Alexey Edelev
            alexandru.croitor Alexandru Croitor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes