[K/N] Don't perform --gc-sections when producing DLL

Due to a bug, lld-link might be a bit too aggressive.
Let's disable --gc-sections for DLL until we update LLD.
Patches:
https://reviews.llvm.org/D101522
https://reviews.llvm.org/D101615
https://reviews.llvm.org/D102138
This commit is contained in:
Sergey Bogolepov
2021-08-04 21:16:16 +07:00
committed by Space
parent 13cb3c138a
commit 4c58954967
@@ -466,7 +466,13 @@ class MingwLinker(targetProperties: MingwConfigurables)
// --gc-sections flag may affect profiling.
// See https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#drawbacks-and-limitations.
// TODO: switching to lld may help.
if (optimize && !needsProfileLibrary) +linkerOptimizationFlags
if (optimize && !needsProfileLibrary) {
// TODO: Can be removed after LLD update.
// See KT-48085.
if (!dynamic) {
+linkerOptimizationFlags
}
}
if (!debug) +linkerNoDebugFlags
if (dynamic) +linkerDynamicFlags
+libraries