Skip to content

feat: binary options #4974

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

feat: binary options #4974

wants to merge 4 commits into from

Conversation

danil-pavlov
Copy link
Contributor

No description provided.


```kotlin
kotlin {
iosX64("ios") {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we using renaming here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, thank you! I simplified the example

@danil-pavlov danil-pavlov force-pushed the native-binary-options branch from e510793 to ee0c924 Compare August 5, 2025 12:01
@danil-pavlov danil-pavlov marked this pull request as ready for review August 5, 2025 12:57
@danil-pavlov danil-pavlov requested a review from a team as a code owner August 5, 2025 12:57
@sbogolepov sbogolepov self-requested a review August 5, 2025 13:02
for example:

```bash
kotlinc-native main.kt -Xbinary=enableSafepointSignposts=true tracking-pauses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess tracking-pauses should be removed?

kotlin {
iosArm64 {
binaries {
executable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: framework makes more sense.

@@ -0,0 +1,301 @@
[//]: # (title: Kotlin/Native binary options)

This page lists helpful Kotlin/Native binary options that you can use to configure Kotlin/Native projects and the ways
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: we can add a warning that the list of binary options might not be exhaustive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, added a note before the table

@@ -0,0 +1,301 @@
[//]: # (title: Kotlin/Native binary options)

This page lists helpful Kotlin/Native binary options that you can use to configure Kotlin/Native projects and the ways
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to configure Kotlin/Native projects

to configure Kotlin/Native final binaries? https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-build-native-binaries.html

<td>
<list>
<li><code>libbacktrace</code></li>
<li><code>coresymbolication</code></li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coresymbolication is enabled by default for macOS and Apple simulators in debug mode. Don't know how to put it shortly :/

<li><code>noop</code> (default)</li>
</list>
</td>
<td>Controls stack trace generation. <code>libbacktrace</code> enables better stack traces with file locations and line numbers.</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to put it like this:

libbacktrace and coresymbolication add file locations and line numbers to exception stack traces. coresymbolication is available only for apple targets.

<li><code>disabled</code> (default)</li>
</list>
</td>
<td>Controls timer-based invocation of the garbage collector. When <code>enabled</code>, GC is called only when memory consumption becomes too high.</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns off a timer-based invocation of the garbage collector when the application is in the background, so GC is called only when memory consumption becomes too high.

Background part is important here.

<list>
<li><a href="native-memory-manager.md" anchor="optimize-gc-performance"><code>cms</code></a></li>
<li><a href="native-memory-manager.md" anchor="disable-garbage-collection"><code>noop</code></a></li>
<li><code>stms</code> (default)</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No such thing as stms. There are:

  • stwms - plain and simple Stop the World Mark and Sweep.
  • pmcs (default) — Parallel Mark Concurrent Sweep.

<tr>
<td><code>preCodegenInlineThreshold</code></td>
<td><code>UInt</code></td>
<td>Configures the inlining optimization pass, which comes before the actual code generation phase. The recommended number of tokens is 40.</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configures the inlining optimization pass, which comes before the actual code generation phase.

Configures Kotlin IR inline optimization pass.

Also worth noting that it is disabled by default.

@sbogolepov
Copy link
Contributor

Thank you, overall looks good to me!

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

Successfully merging this pull request may close these issues.

3 participants