Linker doesn't seem to regard .wasm as a library extension

37 views
Skip to first unread message

John Dallman

unread,
Sep 30, 2026, 9:18:55 AM (7 days ago) Sep 30
to emscripte...@googlegroups.com
Now I'm getting to understand this linker a little better, I have a different problem. 

Since I'm intending to supply a side module as a component, I'd like it to have a .wasm filename extension, just to make clear that it is not an ordinary .so shared library. I can link my deliverable side module, libpskernel.wasm, that way with no trouble. The problem shows when I try to link my test harness side module against it. This isn't a critical problem, but it would be very much preferable to solve it. 

Here's the error:

wasm-ld: error: unable to find library -lpskernel
em++: error: '/sdl/prairie/tools/kernel_tools/webasm/emscripten/lx86/v6.0.10/emsdk/upstream/bin/wasm-ld -o libkid_support.wasm -Bdynamic --import-memory --shared-memory --export=__wasm_call_ctors --export=_emscripten_tls_init --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=main --export-if-defined=__main_argc_argv --export-if-defined=fflush --unresolved-symbols=import-dynamic -shared --no-export-dynamic --stack-first --extra-features=extended-const clu_stubs.o aga_fix.o dummy_kid_main.o ./lsp/lisp.o ./lsp/lsp_kid_main.o -soname=libkid_support.wasm /Parasolid/lx86/v390_webasm/system/release/kid_support.a -L/u/jgd/regimes/webasm -L/Parasolid/lx86/v390_webasm/system/base/shared_object -lpskernel /Parasolid/lx86/v390_webasm/system/release/kid_support.a -L/sdl/prairie/tools/kernel_tools/webasm/emscripten/lx86/v6.0.10/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic -L/sdl/prairie/tools/kernel_tools/webasm/emscripten/lx86/v6.0.10/emsdk/upstream/emscripten/src/lib /sdl/prairie/tools/kernel_tools/webasm/emscripten/lx86/v6.0.10/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic/crtbegin-mt.o --fatal-warnings -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -mllvm -exception-model=emscripten' failed (returned 1)
Warning: Error building libkid_support.wasm
Warning: failed to make libkid_support

It can't match up -lpskernel. However, I have libpskernel.wasm in the current directory:
 
webasm[9]> ls *.wasm
libpskernel.wasm*
webasm[10]> pwd
/u/jgd/regimes/webasm

Is there documentation for the underlying linker? 

Thanks in advance, 

John

Sam Clegg

unread,
Sep 30, 2026, 2:11:07 PM (7 days ago) Sep 30
to emscripte...@googlegroups.com
I'm not sure how I feel about adding `.wasm` alongside `.so` as an extension that the linker uses when searching for shared libraries.   Maybe its a good idea?  Perhaps you could open LLVM issue to suggest this?  We can discuss it more there.  Also, we could potentially mode it a command line flag.  e.g. `--dso-ext=.wasm`

--
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 emscripten-disc...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/emscripten-discuss/CAH1xqg%3DC8ciDk%2BcSf6gjVRWMpoP2z5wWqpD9jnd7xmKuUV2Waw%40mail.gmail.com.

John Dallman

unread,
Oct 1, 2026, 7:29:28 AM (6 days ago) Oct 1
to emscripte...@googlegroups.com
Ah, so it definitely can't do it at present? 

I am not familiar with the LLVM issue setup or any Git-based development processes. Can you recommend an introductory page?

Thanks, 

John  

Sam Clegg

unread,
Oct 1, 2026, 12:43:33 PM (6 days ago) Oct 1
to emscripte...@googlegroups.com
Indeed its currently just hardcoded to `.so`: https://github.com/llvm/llvm-project/blob/a90d9d26f746d913da12adf3bbb95a6735741e05/lld/wasm/Driver.cpp#L344

I think you can just go to https://github.com/llvm/llvm-project/issues and click "New Issue".   If you describe the feature request or bug, it should get automatically tagged as a wasm-ld issue.

Leo Schubert

unread,
Oct 1, 2026, 12:48:09 PM (6 days ago) Oct 1
to emscripte...@googlegroups.com
Hi John, just to keep it simple, how about naming your wasm shared lib libkid_support.wasm.so <http://libkid_support.wasm.so/> ?
Regards, Leo

John Dallman

unread,
Oct 2, 2026, 6:06:53 AM (5 days ago) Oct 2
to emscripte...@googlegroups.com
>  how about naming your wasm shared lib libkid_support.wasm.so ? 

That's a reasonable idea. Let me think about it.

Thanks, 

John  

Reply all
Reply to author
Forward
0 new messages