[K/N] Fix KT-50970

Force generation of ARM instruction set for iosArm32 and
watchosArm32 targets for C++ code. There is no need for such
adjustments for Kotlin code because we don't specify any target
features in IrToBitcode and compiler backend infers target features
from target architecture (which is armv7* and not thumbv7).
This commit is contained in:
Sergey Bogolepov
2022-01-31 14:45:44 +03:00
committed by Space
parent a26c7ace8b
commit 34cb79fc9f
@@ -122,6 +122,14 @@ sealed class ClangArgs(
"-mfpu=vfp", "-mfloat-abi=hard"
)
KonanTarget.IOS_ARM32, KonanTarget.WATCHOS_ARM32 -> listOf(
// Force generation of ARM instruction set instead of Thumb-2.
// It allows LLVM ARM backend to encode bigger offsets in BL instruction,
// thus allowing to generate a slightly bigger binaries.
// See KT-37368.
"-marm"
)
KonanTarget.ANDROID_ARM32, KonanTarget.ANDROID_ARM64,
KonanTarget.ANDROID_X86, KonanTarget.ANDROID_X64 -> {
val clangTarget = targetTriple.withoutVendor()