Are KN binaries statically linked by default? Or is it standard practice to provide linkerOptions in the gradle DSL? I tried to run a binary in a scratch container but it was no bueno š
Charlie Tapping
05/09/2023, 5:21 PM
To answer my own question, no its not at all. You can check for yourself by running:
objdump -p ./program.kexe | grep NEEDED
In my case I found that the following libs are dyn linked:
This is quite odd considering Iām running println(āHello worldā) that it would need anything else but libc
l
Landry Norris
05/09/2023, 6:45 PM
The K/N runtime library needs those. The way it's designed right now, you get the full runtime, regardless of what parts you need.
c
Charlie Tapping
05/10/2023, 8:39 AM
Interesting thank you! I guess having a true statically linked binary is out of the question for kotlin native given the dependency on glibc in there ?
@Landry Norris