Linking fmodstudio.bc to Emscripten Build

Hi, I’m having a problem linking fmodstudio.bc to my emscripten build. It seems like the .bc file may have been targeted for a different architecture than what is required by the latest emcc compiler (v. 1.39.5). I keep getting an error message from the wasm-ld that says -
“Error: fmodstudio.bc: machine type must be wasm32”.

This has happened both in the HTML5 api versions 2.00.06 and 2.00.07. Is there a way to get this working?

Thanks!

The .bc files are LLVM bitcode which should not rely on an emscripten version, you may be using the wrong linker option or something similar.

If you are running emscripten on your own c code and are trying to combine your bitcode with fmod’s bitcode, there are a bunch of flags that you will need to add, assuming WASM.

For a clue, here is how the fmodstudio.js and .wasm are made from fmod’s bitcode files.

emcc --bind -Os -s EXPORT_NAME="‘FMODModule’" -s MODULARIZE=1 -s FORCE_FILESYSTEM=1 -s EXTRA_EXPORTED_RUNTIME_METHODS="[‘cwrap’,‘setValue’,‘getValue’]" -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -o fmodstudio.js fmodstudio.bc fmod_reduced.bc

This is getting inserted into the next point release of the docs amongst other info.