[Interest] Qt 6.2.2 Webassembly - sign conversion errors

Axel Spoerl axel at spoerls.net
Mon Dec 27 12:56:23 CET 2021


I can narrow down the issue as follows:

The problem at hand occurs on a compile server, compiling desktop executables for Qt 
5.15.2 (with GCC-7), Qt 6.2.2 (with GCC-9). To make both configurations work, 
QMAKE_CXX=g++-7 / QMAKE_CXX=g++-9 arguments are added in the respective Qt 
Creator build steps (which is necessary for Qt 6.2.2 even if g++-9 is specified as compiler in 
the kit itself).

Emscripten (intended as a 3rd compile target) has been installed according to https://
doc.qt.io/qt-6/wasm.html[1]  and https://emscripten.org/docs/getting_started/
index.html[2] 
The emscripten installation is able to compile the latest openssl pulled from github.

No matter which GCC version is chosen in /etc/alternatives and no matter which 
emscripten version is activated (3.0.1 or 2.0.14):  .../upstream/emscripten/cache/sysroot/
include/c++ only contains the v1 directory.
The server's /usr/include/c++ contains v1, 7 and 9 according to the GCC versions installed. 
This is where my emscripten knowledge ends and I can only experiment (e.g. by manually 
linking the 9 directory into the emscripten cache, which is being ignored).

Compiling basic C++ code with #include <cmath> works for GCC 7 and produces the errors 
mentioned earlier for GCC 9 (i.e. Qt 6.2.2).

Makefiles are generated by qmake out of a single .pro file. The .pro file contains a WASM 
specific section to link against its own libcrypto and libssl. Apart from the compilers used, 
all Makefiles look almost identical.

=> It appears to me as if emscripten uses a default GCC version, which in case of GCC 9 
being expected is the wrong one. This leads to the lib incompatibility as described by 
Thiago. I have not found options for em++, 'emsdk install' or 'emsdk activate', that provide 
a GCC selection. That may well be attributable to a lack of knowledge on my side.

> Well, Qt is a bit relevant if the qt-cmake of the Qt 6.2.2 WASM installation
> results in broken make files.
> 
> So the question is perhaps: Axel, assuming that you installed emscripten
> following the instruction and that you can verify that you can compile
> basic C++ code as Thiago suggested, how do you then generate your make
> files?
> 
> Volker
> 

--------
[1] https://doc.qt.io/qt-6/wasm.html
[2] https://emscripten.org/docs/getting_started/index.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20211227/c435a15f/attachment.html>


More information about the Interest mailing list