Closed sungaila closed 1 year ago
@jerbob92, can you shed some light on this?
@sungaila You might be able to link with libpdfium.a
that's in the pdfium/out/obj
folder, normally a .wasm
file (that this project produces) isn't used for linking into other WebAssembly builds directly (which it seems like ASP.NET Core Blazor WebAssembly
is trying to do here), for that you would rather use .a and .o files.
In that case you should not need to make any changes to the emcc flags, just making a build and using the libpdfium.a
could be enough.
@jerbob92 Thank you so much! Using the libpdfium.a
file worked perfectly.
@bblanchon I opened PR #123 to modify your GitHub workflow and nuspec files such that referencing bblanchon.PDFium.WebAssembly will work automagically for my use case.
PR #123 merged!
I tried to make use of the PDFium WASM module in my ASP.NET Core Blazor WebAssembly project following these steps. However, the static linking during the build fails with the message
pdfium.wasm: not a relocatable wasm file
(reported by wasm-ld, a WebAssembly lld port).Searching for a solution I found that
emcc
needs the compiler flag-s SIDE_MODULE=1
or-s RELOCATABLE=1
to build relocatable pdfium WASM binaries. But simply adding this in my fork was not enough.Now the workflow build fails with the message
relocation X cannot be used against symbol Y; recompile with -fPIC
.I have no knowledge in C++/WebAssembly linking and don't know how to proceed. Is this issue related to the standalone WASM builds #103?