I've encountered a strange issue that I can only s...
# kotlin-native
k
I've encountered a strange issue that I can only say boils down to K/N. Static linking of SDL2 works flawlessly on macOS, however. The moment I try to statically link SDL2 on Linux it fails completely and throws out a lot of errors. HOWEVER, if the project is link with a shared lib it works fine? I have tested the same code on C++ with the static lib to ensure there's nothing wrong with the static library during compilation and it also works fine. So there must be something going on with K/N during linking process? I will post the errors in the thread as it's hefty.
Unfortunately too long to share here so its on gist: https://gist.github.com/Its-Kenta/393670cf88c69b9a2ca19892c1772b9c
a
assuming the warnings can be ignored, only one line has an error. I can find a few references to
<http://dwarf_reader.cc:1678|dwarf_reader.cc:1678>
online, and this bug report seems relevant https://sourceware.org/bugzilla/show_bug.cgi?id=27246 You might need to compile and link SDL2 with the specific version of gcc that Kotlin/Native uses, which can be done with the run_konan util.
👍 1
k
That would be hefty amount of work judging it’s using build tools to build SDL2 from source. I might just revert to using shared libs for Linux with configured rpath so that you have to provide them yourself or assume user has it… Unsure why macOS is different that it works perfectly fine, but linux fails
a
is your project open source? I can try adding my magic Gradle tasks that can compile C/C++ using Kotlin's gcc
k
I'm not really planning to make it a framework to be used by everyone, it's just a personal project but I do have it on Github. Either way I'm more than happy with Linux taking in shared libs as I managed to get rpaths working