When I recompile the shared library as a static one, it can pass without errors but some linker inputs are missing (e.g. some .bc files), which is not expected. And I think that the relocation errors are caused by dynamic linking, when I use shared library. So I am trying to use static linking instead. For now, I am not sure whether emscripten can help me to ignore dynamic linking and link dynamic libraries as static libraries. Because I find the* Dynamic linking *section in the documentation ( https://emscripten.org/docs/compiling/Building-Projects.html ) mentioned that "Dynamic libraries that you specify in the final build stage (when generating JavaScript or HTML) are linked in as static libraries." Thank you!
On Friday, April 19, 2019 at 9:29:04 PM UTC+8, Alon Zakai wrote: > > We should file a bug on that, then - can you provide a testcase? > > Note sure what you mean by "static linking on shared libraries"? Can you > recompile the shared library as a static one and link it normally? > > On Thu, Apr 18, 2019 at 11:07 PM Chuck H <[email protected] <javascript:>> > wrote: > >> After updating to the latest version, I still get the same error. So What >> is the possible reason of causing relocation error? Another question is >> that is there any option in the emscripten to do static linking on shared >> libraries? Thank you! >> >> On Wednesday, April 17, 2019 at 1:55:00 AM UTC+8, Alon Zakai wrote: >>> >>> Please try with latest LLVM trunk - that may have been fixed recently. >>> >>> >>> On Monday, April 15, 2019 at 2:55:00 AM UTC-7, Chuck H wrote: >>>> >>>> Hi, >>>> >>>> I am using emscripten 1.38.30 with LLVM WebAssembly Backend (LLVM >>>> 9.0.0) and I meet the following error: >>>> >>>> wasm-ld: error: Bad relocation function index >>>> >>>> I cannot find any reference about this error, so what is the possible >>>> reason for it and how to fix it? Thanks! >>>> >>> -- >> 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] <javascript:>. >> 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]. For more options, visit https://groups.google.com/d/optout.
