yugr / Implib.so

POSIX equivalent of Windows DLL import libraries
MIT License
229 stars 33 forks source link

Question about LLVM #32

Closed EmperorPenguin18 closed 1 year ago

EmperorPenguin18 commented 1 year ago

My understanding is LLVM has its own assembly language it supports, that is also supported by emcc. Is that a supported target of this project? Is LLVM assembly just the same as something else that's common?

yugr commented 1 year ago

I should point out that I'm in no way an Emscripten or WebAssembly expert. Also sorry for late reply, I was away from my laptop

LLVM assembler is just an intermediate stage between source code and final target assembly. My (very basic) understanding of Emscripten is that it is a compiler from C/C++ to WebAssembly target which happens to use LLVM as intermediate step.

Implib.so is more related to linking than compilation so I'm not sure how it's related to emcc. Do you suggest to support WebAssembly shared libraries in Implib.so?

EmperorPenguin18 commented 1 year ago

What I was thinking was that instead of x86 assembly for example, the output would be in the LLVM assembly format, so it's portable to any system that supports clang.

yugr commented 1 year ago

Ah, I see your point now.

Unfortunately each target platform has some low-level details which are impossible to express in high-level assembly like LLVM. For example we need to store platform-specific callee-saved registers in save_regs_and_resolve callback.

In addition low-level assembly allows us to get the fastest code possible which is important to reduce overheads.

EmperorPenguin18 commented 1 year ago

Okay that answers my question thank you.