GoogleChromeLabs / web-audio-samples

Web Audio API samples by Chrome Web Audio Team
https://bit.ly/web-audio-samples
Apache License 2.0
686 stars 197 forks source link

Running make on wasm or wasm-ring-buffer returns Error #186

Closed cheesymoo closed 5 years ago

cheesymoo commented 5 years ago

When I try to build the wasm or wasm-ring-buffer using make I get the following error:

tools.shared.Py2CalledProcessError: Command '['/dev/emsdk/fastcomp/fastcomp/bin/llvm-ar', 'xo', '/.emscripten_cache/asmjs/libc++-noexcept.a']' returned non-zero exit status -9 make: *** [build] Error 1

Stack-trace:

emcc:WARNING: WASM_ASYNC_COMPILATION disabled due to user options. This will reduce performance and compatibility (some browsers limit synchronous compilation), see http://kripken.github.io/emscripten-site/docs/compiling/WebAssembly.html#codegen-effects Traceback (most recent call last): File "~/dev/emsdk/fastcomp/emscripten/emcc.py", line 3448, in sys.exit(run(sys.argv)) File "~/dev/emsdk/fastcomp/emscripten/emcc.py", line 1937, in run final = shared.Building.link(linker_inputs, DEFAULT_FINAL, force_archive_contents=force_archive_contents, just_calculate=just_calculate) File "~/dev/emsdk/fastcomp/emscripten/tools/shared.py", line 1981, in link Building.read_link_inputs([x for x in files if not x.startswith('-')]) File "~/dev/emsdk/fastcomp/emscripten/tools/shared.py", line 1760, in read_link_inputs object_names_in_archives = pool.map(extract_archive_contents, archive_names) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 253, in map return self.map_async(func, iterable, chunksize).get() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 572, in get raise self._value tools.shared.Py2CalledProcessError: Command '['~/dev/emsdk/fastcomp/fastcomp/bin/llvm-ar', 'xo', '~/.emscripten_cache/asmjs/libc++-noexcept.a']' returned non-zero exit status -9 make: *** [build] Error 1

I have installed emcc following its tutorial, and emcc -v successfully completes a sanity check. I can also build other simple wasm projects with emcc.

System info: OS X.12.6 Python v 2.7.16 emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.38.38 clang version 6.0.1 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-emscripten--core-emscripten--fastcomp--clang 98df4be387dde3e3918fa5bbb5fc43e1a0e1daac) (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-emscripten--core-emscripten--fastcomp 1b4148f39a69c7fc62edadd85e4122b68694dfb7) (emscripten 1.38.31 : 1.38.31) Target: x86_64-apple-darwin16.7.0

Here is the additional output when I run the command with EMCC_DEBUG=1

shared:DEBUG: EM_CONFIG is located in ~/.emscripten shared:DEBUG: TEMP_DIR not defined in ~/.emscripten, using /tmp shared:DEBUG: PYTHON not defined in ~/.emscripten, using "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python" shared:DEBUG: JAVA not defined in ~/.emscripten, using "java" cache:DEBUG: PID 43369 acquiring multiprocess file lock to Emscripten cache at ~/.emscripten_cache cache:DEBUG: done cache:DEBUG: PID 43369 released multiprocess file lock to Emscripten cache at ~/.emscripten_cache shared:DEBUG: check tells us to use asm.js backend emcc:WARNING: invocation: ~/dev/emsdk/fastcomp/emscripten/emcc.py --bind -O1 -s WASM=1 -s BINARYEN_ASYNC_COMPILATION=0 -s SINGLE_FILE=1 SimpleKernel.cc -o simple-kernel.wasmmodule.js --post-js ../lib/em-es6-module.js (in ~/dev/web-audio-samples/audio-worklet/design-pattern/wasm) shared:DEBUG: successfully executed ~/dev/emsdk/fastcomp/fastcomp/bin/clang++ --version root:DEBUG: Checking JS engine ['~/dev/emsdk/node/8.9.1_64bit/bin/node'] shared:DEBUG: successfully executed ~/dev/emsdk/node/8.9.1_64bit/bin/node --version shared:DEBUG: successfully executed ~/dev/emsdk/fastcomp/fastcomp/bin/llc --version shared:INFO: (Emscripten: Running sanity checks) shared:DEBUG: successfully executed java -version shared:DEBUG: Option -s BINARYEN_ASYNC_COMPILATION=0 has been removed from the codebase. (setting renamed to WASM_ASYNC_COMPILATION) emcc:WARNING: WASM_ASYNC_COMPILATION disabled due to user options. This will reduce performance and compatibility (some browsers limit synchronous compilation), see http://kripken.github.io/emscripten-site/docs/compiling/WebAssembly.html#codegen-effects emcc:DEBUG: compiling to bitcode emcc:DEBUG: emcc step "parse arguments and setup" took 0.19 seconds cache:DEBUG: PID 43369 acquiring multiprocess file lock to Emscripten cache at ~/.emscripten_cache/asmjs cache:DEBUG: done emcc:DEBUG: compiling source file: SimpleKernel.cc emcc:DEBUG: running: ~/dev/emsdk/fastcomp/fastcomp/bin/clang++ -target asmjs-unknown-emscripten -DEMSCRIPTEN_major=1 -DEMSCRIPTEN_minor=38 -DEMSCRIPTEN_tiny__=38 -D_LIBCPP_ABI_VERSION=2 -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem~/dev/emsdk/fastcomp/emscripten/system/include/libcxx -Xclang -isystem~/dev/emsdk/fastcomp/emscripten/system/lib/libcxxabi/include -Xclang -isystem~/dev/emsdk/fastcomp/emscripten/system/include/compat -Xclang -isystem~/dev/emsdk/fastcomp/emscripten/system/include -Xclang -isystem~/dev/emsdk/fastcomp/emscripten/system/include/libc -Xclang -isystem~/dev/emsdk/fastcomp/emscripten/system/lib/libc/musl/arch/emscripten -Xclang -isystem~/dev/emsdk/fastcomp/emscripten/system/local/include -DEMSCRIPTEN -O1 -std=c++11 -mllvm -disable-llvm-optzns SimpleKernel.cc -Xclang -disable-O0-optnone -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/SDL -c -o /tmp/emscripten_temp/SimpleKernel_0.o -emit-llvm shared:DEBUG: executed ~/dev/emsdk/fastcomp/fastcomp/bin/clang++ -target asmjs-unknown-emscripten -DEMSCRIPTEN_major=1 -DEMSCRIPTEN_minor=38 -DEMSCRIPTEN_tiny=38 -D_LIBCPP_ABI_VERSION=2 -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/libcxx -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/lib/libcxxabi/include -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/compat -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/libc -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/lib/libc/musl/arch/emscripten -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/local/include -DEMSCRIPTEN -O1 -std=c++11 -mllvm -disable-llvm-optzns SimpleKernel.cc -Xclang -disable-O0-optnone -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/SDL -c -o /tmp/emscripten_temp/SimpleKernel_0.o -emit-llvm emcc:DEBUG: compiling source file: /~/dev/emsdk/fastcomp/emscripten/system/lib/embind/bind.cpp emcc:DEBUG: running: /~/dev/emsdk/fastcomp/fastcomp/bin/clang++ -target asmjs-unknown-emscripten -D__EMSCRIPTEN_major=1 -DEMSCRIPTEN_minor=38 -DEMSCRIPTEN_tiny=38 -D_LIBCPP_ABI_VERSION=2 -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/libcxx -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/lib/libcxxabi/include -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/compat -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/libc -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/lib/libc/musl/arch/emscripten -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/local/include -DEMSCRIPTEN -O1 -std=c++11 -mllvm -disable-llvm-optzns /~/dev/emsdk/fastcomp/emscripten/system/lib/embind/bind.cpp -Xclang -disable-O0-optnone -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/SDL -c -o /tmp/emscripten_temp/bind_1.o -emit-llvm shared:DEBUG: executed /~/dev/emsdk/fastcomp/fastcomp/bin/clang++ -target asmjs-unknown-emscripten -DEMSCRIPTEN_major=1 -DEMSCRIPTEN_minor=38 -D__EMSCRIPTEN_tiny__=38 -D_LIBCPP_ABI_VERSION=2 -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/libcxx -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/lib/libcxxabi/include -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/compat -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/libc -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/lib/libc/musl/arch/emscripten -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/local/include -DEMSCRIPTEN -O1 -std=c++11 -mllvm -disable-llvm-optzns /~/dev/emsdk/fastcomp/emscripten/system/lib/embind/bind.cpp -Xclang -disable-O0-optnone -Xclang -isystem/~/dev/emsdk/fastcomp/emscripten/system/include/SDL -c -o /tmp/emscripten_temp/bind_1.o -emit-llvm emcc:DEBUG: emcc step "bitcodeize inputs" took 0.86 seconds emcc:DEBUG: optimizing SimpleKernel.cc shared:DEBUG: successfully executed /~/dev/emsdk/fastcomp/fastcomp/bin/opt /tmp/emscripten_temp/SimpleKernel_0.o -O1 -lower-non-em-intrinsics -disable-loop-vectorization -disable-slp-vectorization -vectorize-loops=false -vectorize-slp=false -o /tmp/emscripten_temp/SimpleKernel_0_2.o emcc:DEBUG: optimizing /~/dev/emsdk/fastcomp/emscripten/system/lib/embind/bind.cpp shared:DEBUG: successfully executed /~/dev/emsdk/fastcomp/fastcomp/bin/opt /tmp/emscripten_temp/bind_1.o -O1 -lower-non-em-intrinsics -disable-loop-vectorization -disable-slp-vectorization -vectorize-loops=false -vectorize-slp=false -o /tmp/emscripten_temp/bind_1_3.o emcc:DEBUG: emcc step "process inputs" took 0.13 seconds emcc:DEBUG: will generate JavaScript root:DEBUG: binaryen root already set to /~/dev/emsdk/fastcomp shared:DEBUG: executed /~/dev/emsdk/fastcomp/fastcomp/bin/llvm-nm /tmp/emscripten_temp/SimpleKernel_0_2.o shared:DEBUG: executed /~/dev/emsdk/fastcomp/fastcomp/bin/llvm-nm /tmp/emscripten_temp/bind_1_3.o system_libs:DEBUG: including libc (libc.bc) system_libs:DEBUG: including libcompiler_rt (libcompiler_rt.bc) system_libs:DEBUG: including libc-wasm (libc-wasm.bc) system_libs:DEBUG: including libc++ (libc++-noexcept.a) system_libs:DEBUG: including libc++abi (libc++abi.bc) system_libs:DEBUG: including libmalloc (libdlmalloc.bc) system_libs:DEBUG: including libpthreads (libpthreads_stub.bc) emcc:DEBUG: emcc step "calculate system libraries" took 0.04 seconds emcc:DEBUG: linking: ['/tmp/emscripten_temp/SimpleKernel_0_2.o', '/tmp/emscripten_temp/bind_1_3.o', '/~/.emscripten_cache/asmjs/libc.bc', '/~/.emscripten_cache/asmjs/libcompiler_rt.bc', '/~/.emscripten_cache/asmjs/libc-wasm.bc', '/~/.emscripten_cache/asmjs/libdlmalloc.bc', '/~/.emscripten_cache/asmjs/libpthreads_stub.bc', '/~/.emscripten_cache/asmjs/libc++-noexcept.a', '/~/.emscripten_cache/asmjs/libc++abi.bc'] shared:DEBUG: successfully executed /~/dev/emsdk/fastcomp/fastcomp/bin/llvm-ar t /~/.emscripten_cache/asmjs/libc++-noexcept.a cache:DEBUG: PID 43369 released multiprocess file lock to Emscripten cache at /~/.emscripten_cache/asmjs

I'm going to attempt to get this working in a Docker image to remove any system specific concerns.

Any clue as to what might be going wrong here?

Thanks

cheesymoo commented 5 years ago

I think this is actually related to this open issue on emscripten-core:

linker error #8819

https://github.com/emscripten-core/emscripten/issues/8819