Skip to content

Commit 082b377

Browse files
committed
[Frontend] Emit the pre-stable-ABI bit when targeting older OS versions.
1 parent fbe9904 commit 082b377

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,11 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
429429
Opts.EnableSILOpaqueValues |= Args.hasArg(OPT_enable_sil_opaque_values);
430430

431431
#if SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
432-
Opts.UseDarwinPreStableABIBit = false;
432+
Opts.UseDarwinPreStableABIBit =
433+
(Target.isMacOSX() && Target.isMacOSXVersionLT(10, 14, 4)) ||
434+
(Target.isiOS() && Target.isOSVersionLT(12, 2)) ||
435+
(Target.isTvOS() && Target.isOSVersionLT(12, 2)) ||
436+
(Target.isWatchOS() && Target.isOSVersionLT(5, 2));
433437
#else
434438
Opts.UseDarwinPreStableABIBit = true;
435439
#endif

0 commit comments

Comments
 (0)