From c363732eb5f2afddb41e02cc8f418378831c46ef Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Tue, 12 Sep 2017 15:50:23 +0300 Subject: [PATCH] Report an explicit error when linker invocation fails. In addition ir makes exit code 1, rather than 0 if it was the only problem during compilation. --- .../src/org/jetbrains/kotlin/backend/konan/LinkStage.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/LinkStage.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/LinkStage.kt index f604a72dc1f..d3c1ca31dfb 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/LinkStage.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/LinkStage.kt @@ -305,6 +305,7 @@ internal class LinkStage(val context: Context) { try { runTool(*linkCommand.toTypedArray()) } catch (e: KonanExternalToolFailure) { + context.reportCompilationError("linker invocation reported errors") return null } if (platform is MacOSBasedPlatform && context.shouldContainDebugInfo()) {