emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

emscons does not change shared library outfile file suffix

Open LordOfDragons opened this issue 10 months ago • 5 comments

Version of emscripten/emsdk: emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.6 (1ddaae4d2d6dfbb678ecc193bc988820d1fc4633) clang version 21.0.0git (https:/github.com/llvm/llvm-project 4775e6d9099467df9363e1a3cd5950cc3d2fde05) Target: wasm32-unknown-emscripten Thread model: posix

Failing command line in full: emscons scons dragengine

Compiling a shared library (side module) works but the output is still named "libdragengine.so.1.26.0" instead of "libdragengine.js" or similar. In the upstream/emscripten/tools/scons/site_scons/site_tools/emscripten/emscripten.py file it can be seen that

  env.Replace(PROGSUFFIX='.js')

is set but LIBSUFFIX and LIBSUFFIXES are not set.

LordOfDragons avatar Apr 12 '25 15:04 LordOfDragons

Side modules are actually just .wasm files so I would recommend using .wasm or just leave them as .so. Is there some reason why .so doesn't work for you?

sbc100 avatar Apr 14 '25 18:04 sbc100

For me it would not be a problem but for anybody else seeing a "*.so" file he would assume it's a shared library file which could result in various problems. If this has the correct file extension it is immediately clear what the file contains.

LordOfDragons avatar Apr 14 '25 19:04 LordOfDragons

I mean, technically it is a shared library, just one that contains wasm bits. .so files for different architectures, or even different executable file formats are still called .so. With an .so file you normally need to look inside the file to find out what it really is.

sbc100 avatar Apr 14 '25 20:04 sbc100

Same with .o. Object files for wasm are still called .o, in general.

sbc100 avatar Apr 14 '25 20:04 sbc100

Makes sense.

LordOfDragons avatar Apr 14 '25 20:04 LordOfDragons