Fix Windows targets has bad addresses in stacktrace

^KT-49240 Fixed

Merge-request: KT-MR-6883
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
Vladimir Sukharev
2022-08-24 09:05:06 +00:00
committed by Space
parent 18e61315f4
commit 7f1ab29668
8 changed files with 119 additions and 21 deletions
@@ -64,6 +64,7 @@ sealed class ClangArgs(
"__ANDROID__".takeIf { target.family == Family.ANDROID },
"USE_PE_COFF_SYMBOLS=1".takeIf { target.binaryFormat() == BinaryFormat.PE_COFF },
"UNICODE".takeIf { target.family == Family.MINGW },
"USE_WINAPI_UNWIND=1".takeIf { target.supportsWinAPIUnwind() },
"USE_GCC_UNWIND=1".takeIf { target.supportsGccUnwind() }
)
val customOptions = target.customArgsForKonanSources()
@@ -72,8 +72,9 @@ fun KonanTarget.supportsCoreSymbolication(): Boolean =
KonanTarget.WATCHOS_X86, KonanTarget.WATCHOS_X64, KonanTarget.WATCHOS_SIMULATOR_ARM64
)
fun KonanTarget.supportsGccUnwind(): Boolean = family == Family.ANDROID || family == Family.LINUX || family == Family.MINGW
fun KonanTarget.supportsGccUnwind(): Boolean = family == Family.ANDROID || family == Family.LINUX || this is KonanTarget.MINGW_X86
// MINGW_X64 target does not support GCC unwind, since its sysroot contains libgcc version < 12 having misfeature, see KT-49240
fun KonanTarget.supportsWinAPIUnwind(): Boolean = this is KonanTarget.MINGW_X64
fun KonanTarget.supportsThreads(): Boolean = when(this) {
is KonanTarget.WASM32 -> false