Link OpenSSL to webassembly works in 5.13.2 but not in 5.15.2 ?
Mixlu last edited by
For context, I am trying to make a minimalist webassembly application using OpenSSL encryption for a proof of concept, just to be sure it's possible.
I have correctly handled this for an Qt 5.13.2 application like this :
Build OpenSSL 1.1.1k on a Linux VM
- Install Emscripten 1.38.30
./emsdk install sdk-fastcomp-1.38.30-64bit ./emsdk activate sdk-fastcomp-1.38.30-64bit source ./emsdk_env.sh
- Compile OpenSSL
emmake ./config -no-asm emmake make
Build Qt app (on Windows)
- Link OpenSSL in the .pro
INCLUDEPATH += "C:/***/openssl-wasm/include" LIBS += "C:/***/openssl-wasm/libcrypto.a" "C:/***/openssl-wasm/libssl.a"
- Compile in Webassembly
mkdir build-wasm cd build-wasm emsdk activate sdk-fastcomp-1.38.30-64bit emsdk_env C:\Qt\5.13.2\wasm_32\bin\qmake.exe .. C:\Qt\Tools\mingw730_64\bin\mingw32-make.exe
After these steps, I have a working webassembly app that can use OpenSSL encryption.
Problem comes when I tried to compile the same minimalist app but for Qt 5.15.2 :
-I compiled OpenSSL with
-Static link OpenSSL (as before in the .pro)
-Compiled in webassembly with emscripten 1.39.7 (make with mingw 810_64)
But the compilation give me this error :
I also tried with emscripten 1.39.8, but with the same error.
I guess it should be possible to link OpenSSL with Qt 5.15.2. Am I missing something here ? Any hints would be really helpful and appreciated.
lorn.potter last edited by
I haven't tested ssl support for a while now. Off the top of my head, you my need to play with build arguments of openssl. It looks like openssl might be using pthreads, which Qt WebAssembly does not use by default.
What version of openssl are you using?
In the meantime, if you could report this bug to Qt, that would be great!
Mixlu last edited by Mixlu
@lorn-potter hi and thanks for you reply
openssl might be using pthreads, which Qt WebAssembly does not use by default
Does that mean that I should build qt from source and enable thread support with the "-feature-thread" flag ? As the binary packages do not support multithreading.
I am trying to link OpenSSL 1.1.1k, but if you know and other known good version I am interested.
From the OpenSSL wiki, I see the
no-threadsoption, I'll try and let you know.
I think I will search a bit deeper before submitting a bug.
Mixlu last edited by
Building OpenSSL with the
no-threadsoption solve the problem in my case.
I don't really search deeper what is the consequences of that build option but maybe it can help someone ;)