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

WebAssembly: how to get ASYNCIFY support ?

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 6.4
    • QPA
    • None
    • WebAssembly

    Description

      Hello,

       

      I built Qt (current dev from june 1: c12065ac7811176ae3437431300ccb71d2d2419f ) like this:

      configure -release -nomake tests -nomake examples -cmake-generator Ninja -feature-thread -sse2 -feature-opengles3 -prefix /home/jcelerier/libs/qt6-wasm-install -qt-host-path /home/jcelerier/libs/qt6-host-install -platform wasm-emscripten

      which seems to work and gives me:  qtbase/src/corelib/global/qconfig.h

      #define QT_FEATURE_thread 1
      #define QT_FEATURE_future 1
      #define QT_FEATURE_concurrent 1

      My app is itself built with:

      -DCMAKE_C_FLAGS='-sASYNCIFY -pthread -O3 -msimd128 -msse -msse2 -g0'
      -DCMAKE_CXX_FLAGS='-sASYNCIFY -pthread -O3 -msimd128 -msse -msse2 -g0'

      and has, additionnally which I kinda cargo-culted from various places, including Qt's source code:

        add_link_options("SHELL:-s ASSERTIONS=0")
        add_link_options("SHELL:-s SAFE_HEAP=0")
        add_link_options("SHELL:-s USE_SDL=2")
        add_link_options("SHELL:-s STACK_OVERFLOW_CHECK=1")
        add_link_options("SHELL:-s FETCH=1")
        add_link_options("SHELL:-s WASM=1")
        add_link_options("SHELL:-s FULL_ES2=1")
        add_link_options("SHELL:-s FULL_ES3=1")
        add_link_options("SHELL:-s MAX_WEBGL_VERSION=2")
        add_link_options("SHELL:-s USE_WEBGL2=1")
        add_link_options("SHELL:-s ERROR_ON_UNDEFINED_SYMBOLS=1")
        add_link_options("SHELL:-s TOTAL_MEMORY=2000MB")
        add_link_options("SHELL:-s USE_PTHREADS=1")
        add_link_options("SHELL:-s FETCH=1")
        add_link_options("SHELL:-s WASM_BIGINT=1")
        add_link_options("SHELL:-s MODULARIZE=1")
        add_link_options("SHELL:-s WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1")
        add_link_options("SHELL:-pthread")
        add_link_options("SHELL:-s ASYNCIFY" "-s" "ASYNCIFY_IMPORTS=[qt_asyncify_suspend_js, qt_asyncify_resume_js]")
      
        add_link_options("--bind")
      
        set(CMAKE_EXECUTABLE_SUFFIX ".html")

      I build it with emscripten's qt-cmake wrapper.

      And yet, doing a right-click to show a QMenu kills both chrome and firefox (latest stable) with messages about having to rebuild my app with ASYNCIFY continuously spammed in the console

      What else am I missing ?

      Attachments

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

        Activity

          People

            lpotter Lorn Potter
            jcelerier Jean-Michaël Celerier
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes