Compilation hangs early when building 5.12 with WebAssembly support



  • The installation hangs pretty early after running the following commands:

    $ ~/opt/Qt/5.12.1/Src/configure -xplatform wasm-emscripten -nomake examples -prefix $PWD/qtbase
    + cd qtbase
    + /home/user/opt/Qt/5.12.1/Src/qtbase/configure -top-level -xplatform wasm-emscripten -nomake examples -prefix /home/user/opt/Qt/5.12.1/Src/qtbase
    Creating qmake...
    .Done.
    
    Selecting Qt Edition.
    
    Type 'c' if you want to use the Commercial Edition.
    Type 'o' if you want to use the Open Source Edition.
    
    Which edition of Qt do you want to use? o
    
    This is the Qt Open Source Edition.
     
    You are licensed to use this software under the terms of
    the GNU General Public License (GPL) version 3.
     
    Type 'G' to view the GNU General Public License version 3 (GPLv3).
    Type 'y' to accept this license offer.
    Type 'n' to decline this license offer.
     
    Do you accept the terms of the license? y
    
    
    Running configuration tests...
    Checking for valid makespec...
    

    It never gets past that. My CPU is mostly idle. How do I debug this?


  • Qt Champions 2018

    @ivarec Add -v parameter to configure call - it will be more verbose then. This could give some hints on where exactly it is hanging.



  • @jsulm Thanks! For I got less information than what I was hoping for:

    Running configuration tests...
    Checking for valid makespec... 
    + cd /home/user/opt/Qt/5.12.1/Src/config.tests/verifyspec && /home/user/opt/Qt/5.12.1/Src/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" -early "CONFIG += cross_compile" /home/user/opt/Qt/5.12.1/Src/qtbase/config.tests/verifyspec
    + cd /home/user/opt/Qt/5.12.1/Src/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
    


  • Running the commands shown in -v manually, I get more output:

    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 -o ./verifyspec.js verifyspec.o      
    WARNING  root: Assigning a non-existent settings attribute "WASM"
    WARNING  root:  - did you mean one of ASM_JS?
    WARNING  root:  - perhaps a typo in emcc's  -s X=Y  notation?
    WARNING  root:  - (see src/settings.js for valid values)
    WARNING  root: Assigning a non-existent settings attribute "USE_WEBGL2"
    WARNING  root:  - perhaps a typo in emcc's  -s X=Y  notation?
    WARNING  root:  - (see src/settings.js for valid values)
    WARNING  root: Assigning a non-existent settings attribute "BINARYEN_METHOD"
    WARNING  root:  - perhaps a typo in emcc's  -s X=Y  notation?
    WARNING  root:  - (see src/settings.js for valid values)
    WARNING  root: Assigning a non-existent settings attribute "BINARYEN_TRAP_MODE"
    WARNING  root:  - did you mean one of BINARYEN_METHOD?
    WARNING  root:  - perhaps a typo in emcc's  -s X=Y  notation?
    WARNING  root:  - (see src/settings.js for valid values)
    WARNING  root: Disabling asm.js validation for memory growth (memory can grow, but you lose some amount of speed)
    Exception in thread Thread-3:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
        self.run()
      File "/usr/lib/python2.7/threading.py", line 754, in run
        self.__target(*self.__args, **self.__kwargs)
      File "/usr/lib/python2.7/multiprocessing/pool.py", line 392, in _handle_results
        task = get()
    TypeError: __init__() takes at least 3 arguments (1 given)
    

    I suspect that my Emscripten's version is too old:

    emcc (Emscripten GCC-like replacement) 1.22.1 ()
    

    Will update and try again.



  • After installing Emscript 1.38.25, the error message changes:

    Running configuration tests...
    Checking for valid makespec... 
    + cd /home/user/opt/Qt/5.12.1/Src/config.tests/verifyspec && /home/user/opt/Qt/5.12.1/Src/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" -early "CONFIG += cross_compile" /home/user/opt/Qt/5.12.1/Src/qtbase/config.tests/verifyspec
    + cd /home/user/opt/Qt/5.12.1/Src/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
    > rm -f verifyspec.o
    > rm -f *~ core *.core
    > em++ -c -pipe -O3 -w  -I/home/user/opt/Qt/5.12.1/Src/qtbase/config.tests/verifyspec -I. -I/home/user/.emscripten_ports/openssl/include -I/home/user/opt/Qt/5.12.1/Src/qtbase/mkspecs/wasm-emscripten -o verifyspec.o /home/user/opt/Qt/5.12.1/Src/qtbase/config.tests/verifyspec/verifyspec.cpp
    > emscripten:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/home/user/.emscripten_cache/is_vanilla.txt" for subsequent builds)
    > emscripten:INFO:  - ok
    > shared:INFO: (Emscripten: Running sanity checks)
    > sed -e s/APPNAME/verifyspec/g /home/user/opt/Qt/5.12.1/Src/qtbase/mkspecs/features/wasm/../../../src/plugins/platforms/wasm/wasm_shell.html > /home/user/opt/Qt/5.12.1/Src/config.tests/verifyspec/verifyspec.html
    > cp -f /home/user/opt/Qt/5.12.1/Src/qtbase/mkspecs/features/wasm/../../../src/plugins/platforms/wasm/qtloader.js /home/user/opt/Qt/5.12.1/Src/config.tests/verifyspec
    > cp -f /home/user/opt/Qt/5.12.1/Src/qtbase/mkspecs/features/wasm/../../../src/plugins/platforms/wasm/qtlogo.svg /home/user/opt/Qt/5.12.1/Src/config.tests/verifyspec
    > 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 -o ./verifyspec.js verifyspec.o      
    > shared:ERROR: Assigning a non-existent settings attribute "BINARYEN_METHOD"
    > shared:ERROR:  - did you mean one of BINARYEN_TRAP_MODE, BINARYEN_ROOT, BINARYEN_PASSES?
    > shared:ERROR:  - perhaps a typo in emcc's  -s X=Y  notation?
    > shared:ERROR:  - (see src/settings.js for valid values)
    > Makefile:68: recipe for target 'verifyspec.js' failed
    > make: *** [verifyspec.js] Error 1
    Note: Also available for Linux: linux-clang linux-icc
    
    ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
    

    I guess that it might still be a version problem, but I don't know how to debug this. When I get some more time, I will follow through.



  • Oops! It worked in my last attempt, although it look a long time. So, my problem was Emscripten's version after all. Here is the version that worked:

    emscripten-1.37.1
    

    Note: I've used emsdk to install Emscripten and I had to install a matching LLVM/CLang version:

    clang-e1.37.1-64bit