diff --git a/include/swift/Runtime/Config.h b/include/swift/Runtime/Config.h index 2930a94824e46..f0acbb841e578 100644 --- a/include/swift/Runtime/Config.h +++ b/include/swift/Runtime/Config.h @@ -252,7 +252,7 @@ extern uintptr_t __COMPATIBILITY_LIBRARIES_CANNOT_CHECK_THE_IS_SWIFT_BIT_DIRECTL // differs from the standard calling convention. Currently this is only used for // swift_retain, swift_release, and some internal helper functions that they // call. -#if defined(__aarch64__) +#if defined(__aarch64__) && !SWIFT_RUNTIME_EMBEDDED #define SWIFT_REFCOUNT_CC SWIFT_CC_PreserveMost #define SWIFT_REFCOUNT_CC_PRESERVEMOST 1 #else diff --git a/include/swift/Runtime/CustomRRABI.h b/include/swift/Runtime/CustomRRABI.h index d391b225db682..d8d8f6a245547 100644 --- a/include/swift/Runtime/CustomRRABI.h +++ b/include/swift/Runtime/CustomRRABI.h @@ -59,8 +59,10 @@ namespace swift { template Param returnTypeHelper(Ret (*)(Param)) {} +#if SWIFT_REFCOUNT_CC_PRESERVEMOST template Param returnTypeHelper(SWIFT_REFCOUNT_CC Ret (*)(Param)) {} +#endif #if defined(__LP64__) || defined(_LP64) #define REGISTER_SUBSTITUTION_PREFIX ""