@@ -928,7 +928,7 @@ linkerDynamicFlags.mingw_x86 = -shared
|
||||
linkerKonanFlags.mingw_x86 = -static-libgcc -static-libstdc++ \
|
||||
-Wl,--dynamicbase \
|
||||
-Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive,-Bdynamic \
|
||||
-Wl,--defsym,__cxa_demangle=Konan_cxa_demangle
|
||||
-Wl,--defsym,__cxa_demangle=_Konan_cxa_demangle
|
||||
mimallocLinkerDependencies.mingw_x86 = -lbcrypt
|
||||
linkerOptimizationFlags.mingw_x86 = -Wl,--gc-sections
|
||||
runtimeDefinitions.mingw_x86 = USE_GCC_UNWIND=1 USE_PE_COFF_SYMBOLS=1 KONAN_WINDOWS=1 \
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user