diff --git a/HACKING.md b/HACKING.md index f10f4ae7bbe..6174ff8b405 100644 --- a/HACKING.md +++ b/HACKING.md @@ -95,7 +95,7 @@ To update the blackbox compiler tests set TeamCity build number in `gradle.prope ./gradlew -Ptest_verbose :backend.native:tests:mpp_optional_expectation * **-Ptest_two_stage** enables two-stage compilation of tests. If two-stage compilation is enabled, test sources are compiled into a klibrary -and then a final native binary is produced from this klibrary using the -Xsource-library compiler flag. +and then a final native binary is produced from this klibrary using the -Xinclude compiler flag. ./gradlew -Ptest_two_stage backend.native:tests:array0 diff --git a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt index 05c6d026578..818fe628276 100644 --- a/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt +++ b/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt @@ -160,8 +160,7 @@ class K2NativeCompilerArguments : CommonCompilerArguments() { @Argument( value = SOURCE_LIBRARY_ARG, valueDescription = "", - description = "A library to be processed in the same manner as source files.\n" + - "Must be one of libraries passed with '-library'" + description = "A path to an intermediate library that should be processed in the same manner as source files.\n" ) var sourceLibraries: Array? = null @@ -217,4 +216,4 @@ class K2NativeCompilerArguments : CommonCompilerArguments() { const val EMBED_BITCODE_FLAG = "-Xembed-bitcode" const val EMBED_BITCODE_MARKER_FLAG = "-Xembed-bitcode-marker" const val STATIC_FRAMEWORK_FLAG = "-Xstatic-framework" -const val SOURCE_LIBRARY_ARG = "-Xsource-library" +const val SOURCE_LIBRARY_ARG = "-Xinclude" diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/FeaturedLibraries.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/FeaturedLibraries.kt index c6d1d914454..f8435696181 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/FeaturedLibraries.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/FeaturedLibraries.kt @@ -114,7 +114,7 @@ private sealed class FeaturedLibrariesReporter { "$kind library $libraryName can't be used as a source library" override fun notIncludedLibraryMessageTitle(): String = - "Following libraries are declared as source libraries with -Xsource-library, but not included to the build:" + "Following libraries are declared as source libraries with -Xinclude, but not included to the build:" } private class CoveredLibraryReporter(configuration: CompilerConfiguration): BaseReporter(configuration) { diff --git a/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 3d888227d54..79e8c8e75d8 100644 --- a/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -622,7 +622,7 @@ fun runTest() { // Two-stage compilation. def klibPath = "${exePath}.klib" runCompiler(compileList, klibPath, flags + ["-p", "library"]) - runCompiler([], exePath, flags + ["-l", klibPath, "-Xsource-library=$klibPath"]) + runCompiler([], exePath, flags + ["-l", klibPath, "-Xinclude=$klibPath"]) } else { // Regular compilation. runCompiler(compileList, exePath, flags) diff --git a/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt b/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt index 3ebfde67199..d371ce77572 100644 --- a/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt +++ b/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt @@ -184,7 +184,7 @@ abstract class KonanCompileTask: KonanBuildingTask(), KonanCompileSpec { addAll(secondStageExtraOpts()) addArg("-l", klibPath) - add("-Xsource-library=${klibPath}") + add("-Xinclude=${klibPath}") } /** Args passed to the compiler at both stages of the two-stage compilation and during the singe-stage compilation. */