emscripten
emscripten copied to clipboard
Error while compiling static library with emscripten
Please include the following in your bug report:
Version of emscripten/emsdk: 3.1.59
I am getting following error while trying to compile a library with emscripten in windows to produce *.a files.
D:\Gits\standardLib\build>emmake make make: C:\mingw64\bin\mingw32-make.EXE [ 0%] Building CXX object CMakeFiles/standardLib.dir/src/absolute_soap/modules/main.cpp.o clang++: error: unsupported option '-march=' for target 'wasm32-unknown-emscripten' mingw32-make.EXE[2]: *** [CMakeFiles\standardLib.dir\build.make:76: CMakeFiles/standardLib.dir/src/absolute_soap/modules/main.cpp.o] Error 1 mingw32-make.EXE[1]: *** [CMakeFiles\Makefile2:120: CMakeFiles/standardLib.dir/all] Error 2 mingw32-make.EXE: *** [Makefile:145: all] Error 2 emmake: error: 'C:\mingw64\bin\mingw32-make.EXE' failed (returned 2)
Somewhere -march= is being added to the command line where it probably should not. Can you add VERBOSE=1 to your make command so we can see the full failing command?
Try using emscripten 3.1.40. In my setup 3.1.40 works but 3.1.41 and all newer versions fail with this error (I'm trying to build ffmpeg.wasm using Docker image emscripten/emsdk:3.1.40 and it fails if I try using a newer version of emscripten Docker image, error happens during build of libx265). Apparently, something was broken in 3.1.41 and hadn't been fixed ever since.
It could be that 3.1.40 was less strict about allowing the offending -march flag, but the correct fix here is to stop passing that argument. Its a sign that the build system is confused/wrong.