Skip to content

Commit b9e622b

Browse files
authored
[Driver] Link arclite on iOS 8 and OS X 10.10. (#3123)
(macOS? OS X? How does this work for past OSs?) Noticed by inspection. Xcode doesn't use swiftc to link, and the few things that went into arclite between iOS 7 and iOS 8 weren't critical, but we should still get this right.
1 parent a33e608 commit b9e622b

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

lib/Driver/ToolChains.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,11 +996,9 @@ toolchains::Darwin::constructInvocation(const LinkJobAction &job,
996996
// we wouldn't have to replicate Clang's logic here.
997997
bool wantsObjCRuntime = false;
998998
if (Triple.isiOS())
999-
wantsObjCRuntime = Triple.isOSVersionLT(8);
1000-
else if (Triple.isWatchOS())
1001-
wantsObjCRuntime = Triple.isOSVersionLT(2);
999+
wantsObjCRuntime = Triple.isOSVersionLT(9);
10021000
else if (Triple.isMacOSX())
1003-
wantsObjCRuntime = Triple.isMacOSXVersionLT(10, 10);
1001+
wantsObjCRuntime = Triple.isMacOSXVersionLT(10, 11);
10041002

10051003
if (context.Args.hasFlag(options::OPT_link_objc_runtime,
10061004
options::OPT_no_link_objc_runtime,

test/Driver/linker.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,18 @@
3535
// RUN: FileCheck -check-prefix COMPLEX %s < %t.complex.txt
3636

3737
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 -g %s | FileCheck -check-prefix DEBUG %s
38-
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.10 %s | FileCheck -check-prefix NO_ARCLITE %s
39-
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-ios8.0 %s | FileCheck -check-prefix NO_ARCLITE %s
38+
39+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.10 %s > %t.simple-macosx10.10.txt
40+
// RUN: FileCheck %s < %t.simple-macosx10.10.txt
41+
// RUN: FileCheck -check-prefix SIMPLE %s < %t.simple-macosx10.10.txt
42+
43+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-ios8.0 %s > %t.simple-ios8.txt
44+
// RUN: FileCheck -check-prefix IOS_ARCLITE %s < %t.simple-ios8.txt
45+
46+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.11 %s | FileCheck -check-prefix NO_ARCLITE %s
47+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-ios9.0 %s | FileCheck -check-prefix NO_ARCLITE %s
48+
// RUN: %swiftc_driver -driver-print-jobs -target arm64-apple-tvos9.0 %s | FileCheck -check-prefix NO_ARCLITE %s
49+
// RUN: %swiftc_driver -driver-print-jobs -target armv7k-apple-watchos2.0 %s | FileCheck -check-prefix NO_ARCLITE %s
4050

4151
// RUN: rm -rf %t && mkdir %t
4252
// RUN: touch %t/a.o
@@ -225,6 +235,12 @@
225235
// DEBUG: linker
226236
// DEBUG: -o linker.dSYM
227237

238+
239+
240+
// IOS_ARCLITE: bin/ld{{"? }}
241+
// IOS_ARCLITE: -force_load {{[^ ]+/lib/arc/libarclite_iphonesimulator.a}}
242+
// IOS_ARCLITE: -o {{[^ ]+}}
243+
228244
// NO_ARCLITE: bin/ld{{"? }}
229245
// NO_ARCLITE-NOT: arclite
230246
// NO_ARCLITE: -o {{[^ ]+}}

0 commit comments

Comments
 (0)