From dcefc2cb31e3796807aa047ea7820d4820f49735 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Fri, 6 Mar 2020 21:20:50 +0300 Subject: [PATCH] Adapt to klib abi version no longer being a single int32 (cherry picked from commit 75b5a2f248caf8e1e9e919784fd017671023078d) --- .../org/jetbrains/kotlin/backend/konan/llvm/RTTIGenerator.kt | 5 ++++- runtime/src/main/cpp/TypeInfo.h | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/RTTIGenerator.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/RTTIGenerator.kt index c966152f508..bd6c266ead9 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/RTTIGenerator.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/RTTIGenerator.kt @@ -101,7 +101,10 @@ internal class RTTIGenerator(override val context: Context) : ContextUtils { extendedInfo, - Int32(KotlinAbiVersion.CURRENT.version), + // TODO: it used to be a single int32 ABI version, + // but klib abi version is not an int anymore. + // So now this field is just reserved to preserve the layout. + Int32(0), Int32(size), diff --git a/runtime/src/main/cpp/TypeInfo.h b/runtime/src/main/cpp/TypeInfo.h index 80dd2ed99f2..2bbb698e6b1 100644 --- a/runtime/src/main/cpp/TypeInfo.h +++ b/runtime/src/main/cpp/TypeInfo.h @@ -103,8 +103,8 @@ struct TypeInfo { const TypeInfo* typeInfo_; // Extended RTTI, to retain cross-version debuggability, since ABI version 5 shall always be at the second position. const ExtendedTypeInfo* extendedInfo_; - // ABI version. - uint32_t abiVersion_; + // Unused field. + uint32_t unused_; // Negative value marks array class/string, and it is negated element size. int32_t instanceSize_; // Must be pointer to Any for array classes, and null for Any.