Use clang codegen for android, linux, mingw.
This commit is contained in:
committed by
Sergey Bogolepov
parent
a85b474fd0
commit
970f2a98f9
+39
-37
@@ -32,7 +32,7 @@ downloadingAttempts = 10
|
||||
downloadingAttemptIntervalMs = 3000
|
||||
homeDependencyCache = .konan/cache
|
||||
|
||||
llvmDebugOptFlags = -O1
|
||||
clangDebugFlags = -O0
|
||||
llvmVersion = 6.0.1
|
||||
|
||||
# Mac OS X.
|
||||
@@ -183,17 +183,17 @@ quadruple.linux_x64 = x86_64-unknown-linux-gnu
|
||||
targetSysRoot.linux_x64 = target-gcc-toolchain-3-linux-x86-64/x86_64-unknown-linux-gnu/sysroot
|
||||
# targetSysroot-relative.
|
||||
libGcc.linux_x64 = ../../lib/gcc/x86_64-unknown-linux-gnu/4.8.5
|
||||
llvmLtoFlags.linux_x64 = -mcpu=x86-64
|
||||
llvmLtoOptFlags.linux_x64 = -O3 -function-sections
|
||||
llvmLtoNooptFlags.linux_x64 = -O1
|
||||
llvmLtoDynamicFlags.linux_x64 = -relocation-model=pic
|
||||
llvmLlcFlags.linux_x64 = -march=x86-64
|
||||
clangFlags.linux_x64 = -cc1 -target-cpu x86-64 -emit-obj -disable-llvm-optzns -x ir
|
||||
clangNooptFlags.linux_x64 = -O1
|
||||
clangOptFlags.linux_x64 = -O3 -ffunction-sections
|
||||
clangDebugFlags.linux_x64 = -O0
|
||||
clangDynamicFlags.linux_x64 = -mrelocation-model pic
|
||||
linkerKonanFlags.linux_x64 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread \
|
||||
--defsym __cxa_demangle=Konan_cxa_demangle --no-threads
|
||||
linkerOptimizationFlags.linux_x64 = --gc-sections
|
||||
linkerNoDebugFlags.linux_x64 = -S
|
||||
linkerDynamicFlags.linux_x64 = -shared
|
||||
pluginOptimizationFlags.linux_x64 = -plugin-opt=mcpu=x86-64 -plugin-opt=O3
|
||||
pluginOptimizationFlags.linux_x64 = -plugin-opt=target-cpu x86-64 -plugin-opt=O3
|
||||
dynamicLinker.linux_x64 = /lib64/ld-linux-x86-64.so.2
|
||||
entrySelector.linux_x64 = --defsym main=Konan_main
|
||||
# targetSysRoot relative
|
||||
@@ -230,10 +230,11 @@ linkerKonanFlags.linux_arm32_hfp = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthrea
|
||||
--defsym __cxa_demangle=Konan_cxa_demangle --no-threads
|
||||
# targetSysroot-relative.
|
||||
libGcc.linux_arm32_hfp = lib/gcc/arm-linux-gnueabihf/4.8.3
|
||||
llvmLtoFlags.linux_arm32_hfp = -float-abi=hard -mcpu=arm1136jf-s
|
||||
llvmLtoOptFlags.linux_arm32_hfp = -O3 -function-sections
|
||||
llvmLtoNooptFlags.linux_arm32_hfp = -O1
|
||||
llvmLtoDynamicFlags.linux_arm32_hfp = -relocation-model=pic
|
||||
clangFlags.linux_arm32_hfp = -cc1 -target-cpu arm1136jf-s -mfloat-abi hard -emit-obj -disable-llvm-optzns -x ir
|
||||
clangNooptFlags.linux_arm32_hfp = -O1
|
||||
clangOptFlags.linux_arm32_hfp = -O3 -ffunction-sections
|
||||
clangDebugFlags.linux_arm32_hfp = -O0
|
||||
clangDynamicFlags.linux_arm32_hfp = -mrelocation-model pic
|
||||
dynamicLinker.linux_arm32_hfp = /lib/ld-linux-armhf.so.3
|
||||
# targetSysRoot relative
|
||||
abiSpecificLibraries.linux_arm32_hfp = \
|
||||
@@ -273,10 +274,11 @@ linkerKonanFlags.linux_arm64 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread \
|
||||
--defsym __cxa_demangle=Konan_cxa_demangle --no-threads
|
||||
# targetSysroot-relative.
|
||||
libGcc.linux_arm64 = usr/lib
|
||||
llvmLtoFlags.linux_arm64 = -mcpu=cortex-a57
|
||||
llvmLtoOptFlags.linux_arm64 = -O3 -function-sections
|
||||
llvmLtoNooptFlags.linux_arm64 = -O1
|
||||
llvmLtoDynamicFlags.linux_arm64 = -relocation-model=pic
|
||||
clangFlags.linux_arm64 = -cc1 -target-cpu cortex-a57 -emit-obj -disable-llvm-optzns -x ir
|
||||
clangNooptFlags.linux_arm64 = -O1
|
||||
clangOptFlags.linux_arm64 = -O3 -ffunction-sections
|
||||
clangDebugFlags.linux_arm64 = -O0
|
||||
clangDynamicFlags.linux_arm64 = -mrelocation-model pic
|
||||
dynamicLinker.linux_arm64 = /lib/ld-linux-aarch64.so.1
|
||||
# targetSysRoot relative
|
||||
abiSpecificLibraries.linux_arm64 = \
|
||||
@@ -302,10 +304,11 @@ linkerKonanFlags.linux_mips32 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread \
|
||||
--defsym __cxa_demangle=Konan_cxa_demangle -z notext
|
||||
# targetSysroot-relative.
|
||||
libGcc.linux_mips32 = lib/gcc/mips-unknown-linux-gnu/4.9.4
|
||||
llvmLtoFlags.linux_mips32 =
|
||||
llvmLtoOptFlags.linux_mips32 = -O3 -function-sections
|
||||
llvmLtoNooptFlags.linux_mips32 = -O1
|
||||
llvmLtoDynamicFlags.linux_mips32 = -relocation-model=pic
|
||||
clangFlags.linux_mips32 = -cc1 -emit-obj -disable-llvm-optzns -x ir -target-cpu mips32r2
|
||||
clangNooptFlags.linux_mips32 = -O1
|
||||
clangOptFlags.linux_mips32 = -O3 -ffunction-sections
|
||||
clangDebugFlags.linux_mips32 = -O0
|
||||
clangDynamicFlags.linux_mips32 = -mrelocation-model pic
|
||||
dynamicLinker.linux_mips32 = /lib/ld.so.1
|
||||
# targetSysRoot relative
|
||||
abiSpecificLibraries.linux_mips32 =
|
||||
@@ -328,10 +331,11 @@ linkerKonanFlags.linux_mipsel32 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread
|
||||
--defsym __cxa_demangle=Konan_cxa_demangle -z notext
|
||||
# targetSysroot-relative.
|
||||
libGcc.linux_mipsel32 = lib/gcc/mipsel-unknown-linux-gnu/4.9.4
|
||||
llvmLtoFlags.linux_mipsel32 =
|
||||
llvmLtoOptFlags.linux_mipsel32 = -O3 -function-sections
|
||||
llvmLtoNooptFlags.linux_mipsel32 = -O1
|
||||
llvmLtoDynamicFlags.linux_mipsel32 = -relocation-model=pic
|
||||
clangFlags.linux_mipsel32 = -cc1 -emit-obj -disable-llvm-optzns -x ir -target-cpu mips32r2
|
||||
clangNooptFlags.linux_mipsel32 = -O1
|
||||
clangOptFlags.linux_mipsel32 = -O3 -ffunction-sections
|
||||
clangDebugFlags.linux_mipsel32 = -O0
|
||||
clangDynamicFlags.linux_mipsel32 = -mrelocation-model pic
|
||||
dynamicLinker.linux_mipsel32 = /lib/ld.so.1
|
||||
# targetSysRoot relative
|
||||
abiSpecificLibraries.linux_mipsel32 =
|
||||
@@ -359,10 +363,10 @@ dependencies.mingw_x64-android_arm32 = \
|
||||
|
||||
quadruple.android_arm32 = arm-linux-androideabi
|
||||
entrySelector.android_arm32 = -Wl,--defsym -Wl,main=Konan_main
|
||||
llvmLtoFlags.android_arm32 = -emulated-tls -relocation-model=pic
|
||||
llvmLtoOptFlags.android_arm32 = -O3 -function-sections
|
||||
clangFlags.android_arm32 = -cc1 -emit-obj -disable-llvm-optzns -x ir -femulated-tls -mrelocation-model pic
|
||||
clangOptFlags.android_arm32 = -O3 -ffunction-sections
|
||||
linkerNoDebugFlags.android_arm32 = -Wl,-S
|
||||
llvmLtoNooptFlags.android_arm32 = -O1
|
||||
clangNooptFlags.android_arm32 = -O1
|
||||
targetSysRoot.android_arm32 = target-sysroot-21-android_arm32
|
||||
linkerKonanFlags.android_arm32 = -lm -latomic -lstdc++ -landroid
|
||||
|
||||
@@ -389,7 +393,7 @@ dependencies.mingw_x64-android_arm64 = \
|
||||
|
||||
quadruple.android_arm64 = aarch64-linux-android
|
||||
entrySelector.android_arm64 = -Wl,--defsym -Wl,main=Konan_main
|
||||
llvmLtoFlags.android_arm64 = -emulated-tls -relocation-model=pic
|
||||
clangFlags.android_arm64 = -cc1 -emit-obj -disable-llvm-passes -x ir -femulated-tls -mrelocation-model pic
|
||||
targetSysRoot.android_arm64 = target-sysroot-21-android_arm64
|
||||
linkerKonanFlags.android_arm64 = -lm -latomic -lstdc++ -landroid
|
||||
linkerNoDebugFlags.android_arm64 = -Wl,-S
|
||||
@@ -418,9 +422,9 @@ targetSysRoot.mingw_x64 = msys2-mingw-w64-x86_64-gcc-7.3.0-clang-llvm-lld-6.0.1-
|
||||
# For using with Universal Windows Platform (UWP) we need to use this slower option.
|
||||
# See https://youtrack.jetbrains.com/issue/KT-27654.
|
||||
# TODO: remove, once fixed in mingw, check with the bug testcase.
|
||||
llvmLtoFlags.mingw_x64 = -emulated-tls
|
||||
llvmLtoOptFlags.mingw_x64 = -O3 -function-sections
|
||||
llvmLtoNooptFlags.mingw_x64 = -O1
|
||||
clangFlags.mingw_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir -femulated-tls -target-cpu x86-64
|
||||
clangOptFlags.mingw_x64 = -O3 -ffunction-sections
|
||||
clangNooptFlags.mingw_x64 = -O1
|
||||
linkerNoDebugFlags.mingw_x64 = -Wl,-S
|
||||
linkerDynamicFlags.mingw_x64 = -shared
|
||||
linkerKonanFlags.mingw_x64 =-static-libgcc -static-libstdc++ \
|
||||
@@ -452,13 +456,13 @@ targetSysRoot.mingw_x86 = msys2-mingw-w64-i686-gcc-7.4.0-clang-llvm-6.0.1
|
||||
# For using with Universal Windows Platform (UWP) we need to use slower -emulated-tls option.
|
||||
# See https://youtrack.jetbrains.com/issue/KT-27654.
|
||||
# TODO: remove, once fixed in mingw, check with the bug testcase.
|
||||
# -mcpu=pentium4 makes sure that cogenerator knows which CPU flavour to emit code for.
|
||||
# -target-cpu pentium4 makes sure that cogenerator knows which CPU flavour to emit code for.
|
||||
# Can be seen on optimized build and FP tests, where value is passed in coprocessor registers
|
||||
# by Kotlin and taken from SSE registers by C code.
|
||||
# TODO: once this information is available in function attributes, we can remove this flag.
|
||||
llvmLtoFlags.mingw_x86 = -emulated-tls -mcpu=pentium4
|
||||
llvmLtoOptFlags.mingw_x86 = -O3 -function-sections
|
||||
llvmLtoNooptFlags.mingw_x86 = -O1
|
||||
clangFlags.mingw_x86 = -cc1 -emit-obj -disable-llvm-passes -x ir -femulated-tls -target-cpu pentium4
|
||||
clangOptFlags.mingw_x86 = -O3 -ffunction-sections
|
||||
clangNooptFlags.mingw_x86 = -O1
|
||||
linkerNoDebugFlags.mingw_x86 = -Wl,-S
|
||||
linkerDynamicFlags.mingw_x86 = -shared
|
||||
linkerKonanFlags.mingw_x86 = -static-libgcc -static-libstdc++ \
|
||||
@@ -491,7 +495,6 @@ dependencies.mingw_x64-wasm32 = \
|
||||
target-toolchain-2-mingw-wasm
|
||||
|
||||
quadruple.wasm32 = wasm32-unknown-unknown
|
||||
llvmLtoFlags.wasm32 =
|
||||
targetSysRoot.wasm32 = target-sysroot-2-wasm
|
||||
optFlags.wasm32 = -internalize -globaldce -mtriple=wasm32-unknown-unknown-wasm
|
||||
optNooptFlags.wasm32 = -O1
|
||||
@@ -502,5 +505,4 @@ llcNooptFlags.wasm32 = -O1
|
||||
llcOptFlags.wasm32 = -O3
|
||||
llcDebugFlags.wasm32 = -O0
|
||||
# TODO: make explicit list of external symbols
|
||||
lld.wasm32 = --allow-undefined --no-entry --global-base=0 --no-threads
|
||||
|
||||
lld.wasm32 = --allow-undefined --no-entry --global-base=0 --no-threads
|
||||
Reference in New Issue
Block a user