This may be due to an out of date LLVM. You say you got LLVM from the emsdk - did you get "latest-upstream"? The upstream version in the fastcomp build is not new enough, in particular, only very recent LLVM from upstream master will work (with emscripten incoming).
Regarding that symbol, I think __EMSCRIPTEN__ is defined automatically. It's possible fastcomp also defined it without underscores - if so, we should probably either support both, or document this better. On Mon, May 20, 2019 at 4:16 PM Soeren Balko <[email protected]> wrote: > I have some trouble getting the LLVM backend to work. My FFmpeg build > links a couple of libraries, which works fine with the "fastcomp" backend. > However, for some of the linked-in libraries (eg., libvpx, libopus), > llvm-nm fails with: > > llvm-nm failed on file libvpx.bc: return code 1, error: > emsdk/upstream/6308/bin/llvm-nm: error: libvpx.bc Relocations not in offset > order > > This causes wasm-ld to fail subsequently when linking the entire build. > Other libraries (eg., libavfilter from the FFmpeg build) do not seem to > exhibit this problem. > > My build settings are this: > > -s USE_OGG=1 \ > -s USE_VORBIS=1 \ > -s USE_ZLIB=1 \ > -s PRECISE_F32=2 \ > -s DOUBLE_MODE=0 \ > -s ASSERTIONS=0 \ > -s INVOKE_RUN=0 \ > -s NODEJS_CATCH_EXIT=0 \ > --memory-init-file 0 > > Not sure what causes this and how to fix it. As a side note, I've used > Emscripten from its incoming branch (commit id is > 3a9424299cdda8157e0ccf38ebef951a1b7b5fe4), whereas LLVM is retrieved by > means of emsdk. I normally build the "fastcomp" backend myself, cloning the > emscripten-fastcomp and emscripten-fastcomp-clang repos and keeping them in > lockstep with emscripten. However, I could not find the instructions on how > to compile emscripten-fastcomp to include the LLVM backend (I tried adding > "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly") to the cmake command, > but that does not seem to generate the "wasm-ld" command (I get this: emcc: > WASM_BACKEND selected but could not find lld (wasm-ld): > /home/balko/dev/libav.js/emscripten-fastcomp/build/bin/wasm-ld). > > Other than that, I had to manually add a "-DEMSCRIPTEN=1" compiler define > in order to make the "EMSCRIPTEN" symbol known throughout the code, which I > found surprising. > > Any clues on how to get this to work from anyone who has successfully used > the LLVM backend in a similar setting would be greatly appreciated. > > Thanks, > Soeren > > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/f3247662-0409-4d67-bdfc-d187fd659fbb%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/f3247662-0409-4d67-bdfc-d187fd659fbb%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpREW9NWXpPp07DmH7J85C3dM0tHrORAd28fgaGDUPkAbQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
