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

Error building application for WebAssembly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 5.12.0
    • Build System
    • None
    • WebAssembly
    • ceb0e377b11c6d1b5cf3961901c8bb72d2020d91

    Description

      Build Qt for WebAssembly with following script:

      # Setup Emscripten
      git clone https://github.com/juj/emsdk.git
      cd emsdk
      git pull
      ./emsdk install latest
      ./emsdk activate latest
      source ./emsdk_env.sh
      cd ..
      
      # Setup Qt
      git clone ssh://alekseyka@codereview.qt-project.org:29418/qt/qt5
      cd qt5
      git pull
      ./init-repository
      ./configure -xplatform wasm-emscripten -nomake examples -prefix $PWD/qtbase
      make -j8 module-qtbase module-qtdeclarative module-qtquickcontrols2 module-qtwebsockets module-qtmqtt module-qtsvg module-qtcharts module-qml module-quick module-qtscripts
      

      After that run just

       make -j8

      as previous script has built only qtbase module - no quick or qml.

       Then building my app running commands: 

      .../repos/qt5/qtbase/bin/qmake ../qml-online/qml-online.pro
      make -j8

      Got error:

      > make
      ...
      
      sed -e s/APPNAME/qmlonline/g .../repos/qt5/qtbase/mkspecs/features/wasm/../../../src/plugins/platforms/wasm/wasm_shell.html > .../preview/build-qml-online-WebAssembly-Debug/qmlonline.html
      cp -f .../repos/qt5/qtbase/mkspecs/features/wasm/../../../src/plugins/platforms/wasm/qtloader.js .../preview/build-qml-online-WebAssembly-Debug
      cp -f .../repos/qt5/qtbase/mkspecs/features/wasm/../../../src/plugins/platforms/wasm/qtlogo.svg .../preview/build-qml-online-WebAssembly-Debug
      em++ -s WASM=1 -s FULL_ES2=1 -s ALLOW_MEMORY_GROWTH=1 -s USE_WEBGL2=1 -s NO_EXIT_RUNTIME=0 -s ERROR_ON_UNDEFINED_SYMBOLS=1 --bind -s "BINARYEN_METHOD='native-wasm'" -s "BINARYEN_TRAP_MODE='clamp'" -O3 .../repos/qt5/qtbase/lib/libqtfreetype.a .../repos/qt5/qtbase/lib/libqtlibpng.a -o ./qmlonline.js sio_client.o sio_socket.o sio_client_impl.o sio_packet.o main.o options.o previewer.o qmlonlineapplication.o qmlonlineconnection.o qmlonline.js_plugin_import.o qmlonline.js_qml_plugin_import.o qrc_qml-online.o moc_diagnosticglcontextcreationlistener.o moc_previewer.o moc_qmlonlineapplication.o moc_qmlonlineconnection.o -L.../preview/qml-online/3rdparty/libs/wasm -lboost_random -lboost_system -lboost_date_time -lssl -lcrypto -L.../repos/qt5/qtbase/plugins/platforms -lqwasm -L.../repos/qt5/qtbase/lib -L.../repos/qt5/qtbase/plugins/imageformats -lqgif -lqicns -lqico -lqjpeg -lqtga -lqtiff -lqwbmp -lqwebp -L.../repos/qt5/qtbase/plugins/egldeviceintegrations -lqeglfs-emu-integration -lQt5EglFSDeviceIntegration -lQt5EventDispatcherSupport -lQt5ServiceSupport -lQt5ThemeSupport -lQt5FontDatabaseSupport .../repos/qt5/qtbase/lib/libqtfreetype.a -lQt5FbSupport -lQt5EglSupport -lQt5PlatformCompositorSupport -lQt5DeviceDiscoverySupport -L.../repos/qt5/qtbase/qml/QtQuick.2 -lqtquick2plugin -L.../repos/qt5/qtbase/qml/QtQuick/Window.2 -lwindowplugin -L.../repos/qt5/qtbase/qml/QtWebView -ldeclarative_webview -lQt5WebView -L.../repos/qt5/qtbase/qml/QtCanvas3D -lqtcanvas3d -lQt5OpenGLExtensions -L.../repos/qt5/qtbase/qml/QtTest -lqmltestplugin -lQt5QuickTest -lQt5Test -L.../repos/qt5/qtbase/qml/QtNfc -ldeclarative_nfc -lQt5Nfc -L.../repos/qt5/qtbase/qml/QtScxml -ldeclarative_scxml -lQt5Scxml -L.../repos/qt5/qtbase/qml/QtWebChannel -ldeclarative_webchannel -lQt5WebChannel -L.../repos/qt5/qtbase/qml/QtCharts -lqtchartsqml2 -lQt5Charts -L.../repos/qt5/qtbase/qml/QtPurchasing -ldeclarative_purchasing -lQt5Purchasing -L.../repos/qt5/qtbase/qml/QtGraphicalEffects -lqtgraphicaleffectsplugin -L.../repos/qt5/qtbase/qml/QtSensors -ldeclarative_sensors -lQt5Sensors -L.../repos/qt5/qtbase/qml/Qt/labs/calendar -lqtlabscalendarplugin -L.../repos/qt5/qtbase/qml/Qt/labs/settings -lqmlsettingsplugin -L.../repos/qt5/qtbase/qml/Qt/labs/platform -lqtlabsplatformplugin -L.../repos/qt5/qtbase/qml/QtWebSockets -ldeclarative_qmlwebsockets -lQt5WebSockets -L.../repos/qt5/qtbase/qml/QtQuick/Extras -lqtquickextrasplugin -L.../repos/qt5/qtbase/qml/QtQuick/Templates.2 -lqtquicktemplates2plugin -L.../repos/qt5/qtbase/qml/QtQuick/Controls -lqtquickcontrolsplugin -L.../repos/qt5/qtbase/qml/QtQuick/XmlListModel -lqmlxmllistmodelplugin -lQt5XmlPatterns -L.../repos/qt5/qtbase/qml/QtQuick/Dialogs -ldialogplugin -L.../repos/qt5/qtbase/qml/QtQuick/Particles.2 -lparticlesplugin -lQt5QuickParticles -L.../repos/qt5/qtbase/qml/QtQuick/Layouts -lqquicklayoutsplugin -L.../repos/qt5/qtbase/qml/QtQuick/Controls.2 -lqtquickcontrols2plugin -L.../repos/qt5/qtbase/qml/QtQuick/Controls.2/Material -lqtquickcontrols2materialstyleplugin -L.../repos/qt5/qtbase/qml/QtQuick/Controls.2/Fusion -lqtquickcontrols2fusionstyleplugin -L.../repos/qt5/qtbase/qml/QtQuick/Controls.2/Universal -lqtquickcontrols2universalstyleplugin -L.../repos/qt5/qtbase/qml/QtQuick/Controls.2/Imagine -lqtquickcontrols2imaginestyleplugin -lQt5QuickControls2 -lQt5QuickTemplates2 -L.../repos/qt5/qtbase/qml/QtDataVisualization -ldatavisualizationqml2 -lQt5DataVisualization -L.../repos/qt5/qtbase/qml/QtGamepad -ldeclarative_gamepad -lQt5Gamepad -L.../repos/qt5/qtbase/qml/QtBluetooth -ldeclarative_bluetooth -lQt5Bluetooth -L.../repos/qt5/qtbase/qml/QtMultimedia -ldeclarative_multimedia -lQt5MultimediaQuick -lQt5Multimedia -L.../repos/qt5/qtbase/qml/QtQml/StateMachine -lqtqmlstatemachine -L.../repos/qt5/qtbase/qml/QtQml/RemoteObjects -lqtqmlremoteobjects -lQt5RemoteObjects -L.../repos/qt5/qtbase/qml/QtQml/Models.2 -lmodelsplugin -L.../repos/qt5/qtbase/qml/QtGraphicalEffects/private -lqtgraphicaleffectsprivate -L.../repos/qt5/qtbase/qml/QtQuick/Dialogs/Private -ldialogsprivateplugin -L.../repos/qt5/qtbase/qml/QtQuick/PrivateWidgets -lwidgetsplugin -lQt5Quick -lQt5Widgets -lQt5Gui .../repos/qt5/qtbase/lib/libqtlibpng.a .../repos/qt5/qtbase/lib/libqtharfbuzz.a -lQt5Qml -lQt5Network -lQt5Core .../repos/qt5/qtbase/lib/libqtpcre2.a
      emcc: warning: cannot represent a NaN literal '0x1c137ad0' with custom bit pattern in NaN-canonicalizing JS engines (e.g. Firefox and Safari) without erasing bits!
       in ret double 0x7FF4000000000000 in _ZL7qt_snanv()
      emcc: warning: cannot represent a NaN literal '0x1c137ad0' with custom bit pattern in NaN-canonicalizing JS engines (e.g. Firefox and Safari) without erasing bits!
       in ret double 0x7FF4000000000000 in _ZL7qt_snanv.71907()
      error: undefined symbol: ENGINE_cleanup
      warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
      error: undefined symbol: _ZN7QThread4exitEi
      Error: Aborting compilation due to previous errors
      shared:ERROR: '.../repos/emsdk/node/8.9.1_64bit/bin/node .../repos/emsdk/emscripten/1.38.22/src/compiler.js /tmp/tmp3vMpsu.txt .../repos/emsdk/emscripten/1.38.22/src/embind/emval.js .../repos/emsdk/emscripten/1.38.22/src/embind/embind.js .../repos/emsdk/emscripten/1.38.22/src/library_pthread_stub.js' failed (1)
      make: *** [Makefile:280: qmlonline.js] Error 1
      

      What is it: Qt bug or I do something wrong, some module missed?

       

       

       

      Attachments

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

        Activity

          People

            lpotter Lorn Potter
            jirauser39314 user-45b5b (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes