[K/N] Fix mingw_x86 compilation

It was broken in 9ed97a27f1.
This commit is contained in:
Sergey Bogolepov
2021-07-12 13:45:26 +07:00
committed by Space
parent 447900c3f2
commit 118889add5
2 changed files with 7 additions and 2 deletions
@@ -480,11 +480,16 @@ class MingwLinker(targetProperties: MingwConfigurables)
if (HostManager.hostIsMingw) {
lldCompatibilityChecker?.let { checkLldCompatibiity ->
// -### flag allows to avoid actual linkage process.
val konanCxaDemangleSymbol = when (target) {
KonanTarget.MINGW_X64 -> "Konan_cxa_demangle"
KonanTarget.MINGW_X86 -> "_Konan_cxa_demangle"
else -> error("Unexpected target: $target")
}
val lldCommand = Command(linker).constructLinkerArguments(
// Add -fuse-ld to the end of the list to override previous appearances.
additionalArguments = listOf("-fuse-ld=$absoluteLldLocation", "-Wl,-###"),
// LLD doesn't support defsym.
skipDefaultArguments = listOf("-Wl,--defsym,__cxa_demangle=Konan_cxa_demangle")
skipDefaultArguments = listOf("-Wl,--defsym,__cxa_demangle=$konanCxaDemangleSymbol")
)
checkLldCompatibiity(lldCommand)
}