Closed vault-thirteen closed 7 months ago
Well, it looks like the author of the library decided to throw an error in the preprocessing stage at that line 42. https://github.com/vault-thirteen/argon2/blob/main/src/bench.c#L42
For some reason, CMake started via Emscripten thinks that the CPU is neither Intel x86 nor AMD64. How can it be ? I am using an Intel x86-64 CPU. And a normal CMake produced a DLL for it.
Emscripten is a cross compiler that targets WebAsssembly, which is a virtual ISA and is neither x86 nor AMD64. Any code that is architecture-specific would need to be modified to build for WebAssembly.
The function in question looks like it trying to access a high frequency timer. On the web and with emscripten the closest thing you have to do would be something like the emscripten_get_now
function. But remember this will be a lot more expensive than single assembly instruction since it has to call out the JavaScript to get this number.
@sbc100 thank you very much ! WASM is a separate universe for me.
I am having trouble with building a project with Emscripten.
I have a working scenario for MinGW in MSYS2 MINGW64 on Windows O.S. The following code is working and producing a DLL file in Windows O.S.
Note that all this happens inside the
MSYS2 MINGW64
terminal, so usual Windows slashes in path are changed to MSYS2-styled Unix slashes.When I try to convert this scenario into Emscripten, I see errors.
What do I do.
I start the
MSYS2 MINGW64
terminal,cd
to the folder with Emscripten's SDK, and run a script which sets environment variables:I see the new value of
PATH
variable. Check.Then I
cd
to a project source code directory and do theemconfigure ./configure
from the manual located here: https://emscripten.org/docs/compiling/Building-Projects.html It says to use another command, so I change it accordingly.emcmake cmake . -B "_BUILD_" -G "MinGW Makefiles"
-- Configuring done (0.7s) -- Generating done (0.0s) -- Build files have been written to: D:/Temp/2/BUILD
configure: cmake --build BUILD -DCMAKE_TOOLCHAIN_FILE=D:\Temp\1\emsdk\upstream\emscripten\cmake\Modules\Platform\Emscripten.cm ake -DCMAKE_CROSSCOMPILING_EMULATOR=D:/Temp/1/emsdk/node/16.20.0_64bit/bin/node.exe -G "MinGW Makefiles" Unknown argument -DCMAKE_TOOLCHAIN_FILE=D:\Temp\1\emsdk\upstream\emscripten\cmake\Modules\Platform\Emscripten.cmake Usage: cmake --build