WASM=0 Has No Effect?

44 views
Skip to first unread message

Eric Brisco

unread,
Nov 22, 2020, 11:11:30 AM11/22/20
to emscripten-discuss
Hello,

I am trying to build ffmpeg using the build setup https://github.com/Kagami/ffmpeg.js which uses Emscripten. It is supposed to target JavaScript, not Web Assembly, and uses -s WASM=0 to make that switch. However, eventually the make script encounters this error:

$ make ffmpeg-webm.js
emcc build/ffmpeg-webm/ffmpeg.bc build/opus/dist/lib/libopus.so build/libvpx/dist/lib/libvpx.so \
        --post-js build/post-sync.js \
        -O3 --closure 1 --memory-init-file 0 -s WASM=0 -s WASM_ASYNC_COMPILATION=0 -s ASSERTIONS=0 -s EXIT_RUNTIME=1 -s NODEJS_CATCH_EXIT=0 -s NODEJS_CATCH_REJECTION=0 -s TOTAL_MEMORY=67108864 -lnodefs.js -lworkerfs.js --pre-js build/pre.js -o ffmpeg-webm.js
wasm-ld: error: unknown file type: build/ffmpeg-webm/ffmpeg.bc
emcc: error: '/mnt/c/Users/erisco/Documents/cpp/emsdk/upstream/bin/wasm-ld -o ffmpeg-webm.wasm build/ffmpeg-webm/ffmpeg.bc build/opus/dist/lib/libopus.so build/libvpx/dist/lib/libvpx.so -L/mnt/c/Users/erisco/Documents/cpp/emsdk/upstream/emscripten/cache/wasm /mnt/c/Users/erisco/Documents/cpp/emsdk/upstream/emscripten/cache/wasm/libc.a /mnt/c/Users/erisco/Documents/cpp/emsdk/upstream/emscripten/cache/wasm/libcompiler_rt.a /mnt/c/Users/erisco/Documents/cpp/emsdk/upstream/emscripten/cache/wasm/libc++-noexcept.a /mnt/c/Users/erisco/Documents/cpp/emsdk/upstream/emscripten/cache/wasm/libc++abi-noexcept.a /mnt/c/Users/erisco/Documents/cpp/emsdk/upstream/emscripten/cache/wasm/libdlmalloc.a /mnt/c/Users/erisco/Documents/cpp/emsdk/upstream/emscripten/cache/wasm/libpthread_stub.a /mnt/c/Users/erisco/Documents/cpp/emsdk/upstream/emscripten/cache/wasm/libc_rt_wasm.a /mnt/c/Users/erisco/Documents/cpp/emsdk/upstream/emscripten/cache/wasm/libsockets.a -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --allow-undefined --import-memory --strip-debug --export-table --export main --export stackSave --export stackRestore --export stackAlloc --export __wasm_call_ctors --export fflush --export __errno_location --export malloc --export free --export setThrew --export realloc --export testSetjmp --export saveSetjmp -z stack-size=5242880 --initial-memory=67108864 --no-entry --max-memory=67108864 --global-base=1024' failed (1)
Makefile:233: recipe for target 'ffmpeg-webm.js' failed
make: *** [ffmpeg-webm.js] Error 1

It seems as though -s WASM=0 is having no effect because I would not expect wasm-ld to be called at all, and definitely not on ffmpeg.bc (which is a JavaScript file).

Anyone have some advice for this?

Thanks,
Eric

P.S. I also have this issue open on the ffmpeg.js tracker, as perhaps it is a problem with the build script:

Alon Zakai

unread,
Nov 23, 2020, 12:14:25 PM11/23/20
to emscripte...@googlegroups.com
WASM=0 still runs the normal compilation pipeline to wasm. It just then converts the WASM into JavaScript at the very end. (Older versions of emscripten, that still used fastcomp, used to do things differently.)

What is actually making lld error there? What type of file is ffmpeg.bc? (running "file ffmpeg.bc" can help) If it's LLVM bitcode, of an older version, then it needs to be recompiled for the current version.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/f47027af-5c39-4730-befc-93ea9c13a797n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages