[KLIB] Use -Xmetadata-klib to produce metadata KLIBs

With this change a new `-Xmetadata-klib` CLI flag becomes the
preferable way to instruct K2MetadataCompiler to produce metadata
KLIBs. The old `-Xexpect-actual-linker` flag still works for
K2MetadataCompiler, but that would last just for a short transition
period until the necessary changes are made in the Gradle plugin.

The K2NativeCompiler does not work anymore with `-Xexpect-actual-linker`
and respects only the `-Xmetadata-klib` flag. This is not an
issue since the Gradle plugin anyway supplies both flags for Native
metadata compilations.

^KT-61136
This commit is contained in:
Dmitriy Dolovov
2023-09-15 19:29:44 +02:00
committed by Space Team
parent 848c88b1a5
commit 38a67f3d30
4 changed files with 15 additions and 11 deletions
@@ -686,14 +686,14 @@ abstract class AbstractCompileKotlinAgainstCustomBinariesTest : AbstractKotlinCo
fun testAnonymousObjectTypeMetadataKlib() {
val klibLibrary = compileCommonLibrary(
libraryName = "library",
listOf("-Xexpect-actual-linker"),
listOf("-Xmetadata-klib"),
)
compileKotlin(
"anonymousObjectTypeMetadata.kt",
tmpdir,
listOf(klibLibrary),
K2MetadataCompiler(),
listOf("-Xexpect-actual-linker")
listOf("-Xmetadata-klib")
)
}