Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Kotlin/Native #6227

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

broadwaylamb
Copy link

@broadwaylamb broadwaylamb commented Mar 7, 2024

This is mostly working, but has a few issues:

  • DCE in Kotlin/Native eliminates all public functions unless they are directly or indirectly referenced from the main function. I'd like to fix this before this PR is merged, hence the draft status.
  • The assembly and IR output in the -opt mode is huge, because the Kotlin/Native compiler compiles all its runtime into a single binary. There's not much can be done about that right now. We could manually filter it, but I believe that would defeat the purpose of Compiler Explorer — to see what the compiler generates as is.

This MR is partially based on #2738, with a few improvements. Namely, we now use compiler caches for compiling in non-optimized mode. This significantly reduces the size of the generated asm, as well as drastically speeds up compilation. We also extract the assembly directly from the Clang invocation that the Kotlin compiler performs, instead of decompiling the resulting binary.

I plan to make the Kotlin/Native CLI much friendlier for CE, but in the meantime we work with what we have.

(Fixes #692)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kotlin/Native support
1 participant