Fix -Xoverride-konan-properties for Apple strip

When building an optimised release dynamic framework we see a lot of local symbols in Mach-O. When calling `strip -x` this can be dramatically reduced whilst still having a usable artefact.

Current logic seems to keep symbols for DSYM extraction in debug light mode. But only strips hardcoded debug symbols (`strip -S`) afterwards.

Introduce new stripFlags for Apple compilation to allow optimization for release with DSYM builds
This commit is contained in:
Paul Idstein
2021-02-18 07:25:28 +01:00
committed by Vasily Levchenko
parent 764f7f31d2
commit 3f15774cb2
3 changed files with 13 additions and 1 deletions
@@ -98,6 +98,7 @@ interface AppleConfigurables : Configurables, ClangFlags {
val arch get() = targetString("arch")!!
val osVersionMin get() = targetString("osVersionMin")!!
val osVersionMinFlagLd get() = targetString("osVersionMinFlagLd")!!
val stripFlags get() = targetList("stripFlags")
val additionalToolsDir get() = hostString("additionalToolsDir")
val absoluteAdditionalToolsDir get() = absolute(additionalToolsDir)
}
@@ -265,7 +265,7 @@ class MacOSBasedLinker(targetProperties: AppleConfigurables)
if (debug) {
result += dsymUtilCommand(executable, outputDsymBundle)
if (optimize) {
result += Command(strip, "-S", executable)
result += Command(strip, *stripFlags.toTypedArray(), executable)
}
}