gc compiler has -buildmode=c-shared.
With LLVM, this should be possible, no?
Yes, this is certainly possible. It's just that no one has asked for it yet.
It will need the extra -buildmode flag and some extra hooks, like an extra -static flag to the linker and an extra hook to let the compiler emit PIC code instead of static code:
This would be a great addition.
I am calling a Go library from Rust and would love to see it compiled with TinyGo instead.
Looking forward to this implementation :)
Most helpful comment
Yes, this is certainly possible. It's just that no one has asked for it yet.
It will need the extra
-buildmodeflag and some extra hooks, like an extra-staticflag to the linker and an extra hook to let the compiler emit PIC code instead of static code:https://github.com/tinygo-org/tinygo/blob/5569cd1b6b3aff8f52052d5ff1028d9bb87fba24/compiler/compiler.go#L105