[Linker] Move gcc linkage flags to konan.properties

This commit is contained in:
Sergey Bogolepov
2020-10-29 14:38:19 +07:00
committed by Stanislav Erokhin
parent 42d416e0e7
commit 14526e57bc
3 changed files with 4 additions and 2 deletions
+2
View File
@@ -57,6 +57,8 @@ llvm.macos_x64.user = clang-llvm-apple-8.0.0-darwin-macos
llvmInlineThreshold = 100
clangDebugFlags = -O0
linkerGccFlags = -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
llvmVersion.linux_x64 = 8.0.0
llvmVersion.mingw_x64 = 8.0.1
llvmVersion.macos_x64 = 8.0.0
@@ -81,6 +81,7 @@ interface GccConfigurables : TargetableConfigurables, ClangFlags {
val libGcc get() = targetString("libGcc")!!
val dynamicLinker get() = targetString("dynamicLinker")!!
val abiSpecificLibraries get() = targetList("abiSpecificLibraries")
val linkerGccFlags get() = targetList("linkerGccFlags")
}
interface AndroidConfigurables : TargetableConfigurables, ClangFlags
@@ -369,8 +369,7 @@ class GccBasedLinker(targetProperties: GccConfigurables)
// https://github.com/llvm/llvm-project/blob/21e270a479a24738d641e641115bce6af6ed360a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp#L930
if (needsProfileLibrary) +listOf("-u__llvm_profile_runtime", profileLibrary!!)
+linkerKonanFlags
+listOf("-lgcc", "--as-needed", "-lgcc_s", "--no-as-needed",
"-lc", "-lgcc", "--as-needed", "-lgcc_s", "--no-as-needed")
+linkerGccFlags
+if (dynamic) "$libGcc/crtendS.o" else "$libGcc/crtend.o"
+"$absoluteTargetSysRoot/$crtPrefix/crtn.o"
+libraries