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

building with cmake 3.31 gives ODR violation warnings on webassembly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.8.1, 6.9
    • None
    • WebAssembly

    Description

      I setup a ci pipeline that tests building qt for webassembly with several cmake versions. it works fine with cmake 3.29 and 3.30, but gives the following warning when using cmake 3.31:

      [10/81] Generating .rcc/qmlcache/galleryexample_qmlcache_loader.cpp

      [11/81] Automatic QML type registration for target galleryexample

      Warning: qquickforeignutils_p.h:107: Multiple C++ types called QEventPointDerived found!

      (other occurrence in : qquickforeignutils_p.h : 107 )

      This violates the One Definition Rule!

      Warning: qquickforeignutils_p.h:107: Multiple C++ types called QEventPointDerived found!

      (other occurrence in : qquickforeignutils_p.h : 107 )

      This violates the One Definition Rule!

      Warning: qqmldelegatecomponent_p.h:70: Multiple C++ types called QQmlDelegateChooser found!

      (other occurrence in : qqmldelegatecomponent_p.h : 70 )

      This violates the One Definition Rule!

      ... many more similar warnings follow

      there are additional warnings when building the wasm version of qt:

      CMake Warning (dev) at qtbase/cmake/QtPublicSbomGenerationHelpers.cmake:57 (cmake_parse_arguments):
      The LICENSE keyword was followed by an empty string or no value at all.
      Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
      arg_LICENSE variable rather than setting it to an empty string.
      Call Stack (most recent call first):
      qtbase/cmake/QtPublicSbomHelpers.cmake:178 (_qt_internal_sbom_begin_project_generate)
      qtbase/cmake/QtBuildRepoHelpers.cmake:354 (_qt_internal_sbom_begin_project)
      qtbase/cmake/QtBaseHelpers.cmake:154 (qt_build_repo_begin)
      qtbase/CMakeLists.txt:32 (qt_internal_qtbase_build_repo)
      This warning is for project developers. Use -Wno-dev to suppress it.

      CMake Warning (dev) at qtbase/cmake/QtPublicSbomGenerationHelpers.cmake:986 (cmake_parse_arguments):
      The CHECK keyword was followed by an empty string or no value at all.
      Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
      arg_CHECK variable rather than setting it to an empty string.
      Call Stack (most recent call first):
      qtbase/cmake/QtPublicSbomGenerationHelpers.cmake:943 (_qt_internal_sbom_get_and_check_spdx_id)
      qtbase/cmake/QtPublicSbomHelpers.cmake:1658 (_qt_internal_sbom_generate_add_license)
      qtbase/cmake/QtPublicSbomHelpers.cmake:217 (_qt_internal_sbom_add_license)
      qtbase/cmake/QtBuildRepoHelpers.cmake:354 (_qt_internal_sbom_begin_project)
      qtbase/cmake/QtBaseHelpers.cmake:154 (qt_build_repo_begin)
      qtbase/CMakeLists.txt:32 (qt_internal_qtbase_build_repo)
      This warning is for project developers. Use -Wno-dev to suppress it.
      ... many more similar warnings follow

      I'm using the following commands for building:
      git clone --branch ${{matrix.qtversion git://code.qt.io/qt/qt5.git qt_src}}
      QT_SRC_CONFIGURE=$(pwd)/qt_src/configure
      QT_WASM_ROOT_DIR=$(pwd)/wasmqt_install
      BUILD_DIR=$(pwd)/build
      mkdir qt_wasm_build
      cd qt_wasm_build
      $QT_SRC_CONFIGURE -qt-host-path $QT_ROOT_DIR -platform wasm-emscripten -init-submodules -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats
      $QT_SRC_CONFIGURE -qt-host-path $QT_ROOT_DIR -platform wasm-emscripten -release -optimize-size -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats -make libs -gui -no-feature-thread -prefix "${QT_WASM_ROOT_DIR}/"
      cmake --build . --parallel && cmake --install .
      cd ..
      ${QT_WASM_ROOT_DIR}/bin/qt-cmake -G Ninja -B $BUILD_DIR -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=install -S .
      cmake --build $BUILD_DIR --target install 2>&1 | tee build_output.log
      if grep -q "One Definition Rule" build_output.log; then
         echo "Error: Found 'One Definition Rule' in build output."
         exit 1
      fi

      here is my repo demonstrating the issue (with the gallery example app):

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            adamce Adam
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes