[K/N] Require small binaries for all watchos targets
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#define RUNTIME_WEAK __attribute__((weak))
|
||||
#define RUNTIME_NODEBUG __attribute__((nodebug))
|
||||
|
||||
#if KONAN_NEAD_SMALL_BINARY
|
||||
#if KONAN_NEED_SMALL_BINARY
|
||||
// On the one hand, ALWAYS_INLINE forces many performance-critical function to be, well,
|
||||
// inlined. Which is good for performance, of course.
|
||||
// On the other hand, 32-bit Mach-O object files can't be really big.
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "PointerBits.h"
|
||||
#include "Utils.hpp"
|
||||
|
||||
#if KONAN_NEAD_SMALL_BINARY
|
||||
#if KONAN_NEED_SMALL_BINARY
|
||||
// Currently, codegen places a lot of unnecessary calls to MM functions.
|
||||
// By forcing NO_INLINE on these functions we keep binaries from growing too big.
|
||||
#define CODEGEN_INLINE_POLICY NO_INLINE
|
||||
|
||||
@@ -54,7 +54,7 @@ sealed class ClangArgs(
|
||||
"HAS_FOUNDATION_FRAMEWORK".takeIf { target.hasFoundationFramework() },
|
||||
"HAS_UIKIT_FRAMEWORK".takeIf { target.hasUIKitFramework() },
|
||||
"REPORT_BACKTRACE_TO_IOS_CRASH_LOG".takeIf { target.supportsIosCrashLog() },
|
||||
"NEAD_SMALL_BINARY".takeIf { target.needSmallBinary() },
|
||||
"NEED_SMALL_BINARY".takeIf { target.needSmallBinary() },
|
||||
"TARGET_HAS_ADDRESS_DEPENDENCY".takeIf { target.hasAddressDependencyInMemoryModel() },
|
||||
).map { "KONAN_$it=1" }
|
||||
val otherOptions = listOfNotNull(
|
||||
|
||||
+5
-1
@@ -143,7 +143,11 @@ fun KonanTarget.supportsUnalignedAccess(): Boolean = when (architecture) {
|
||||
Architecture.X86, Architecture.ARM64, Architecture.X64 -> true
|
||||
} && this != KonanTarget.WATCHOS_ARM64
|
||||
|
||||
fun KonanTarget.needSmallBinary() = (architecture == Architecture.ARM32 && family.isAppleFamily)
|
||||
fun KonanTarget.needSmallBinary() = when {
|
||||
family == Family.WATCHOS -> true
|
||||
family.isAppleFamily -> architecture == Architecture.ARM32
|
||||
else -> false
|
||||
}
|
||||
|
||||
fun KonanTarget.supportedSanitizers(): List<SanitizerKind> =
|
||||
when(this) {
|
||||
|
||||
Reference in New Issue
Block a user