File: maccatalyst_load_commands.swift

package info (click to toggle)
swiftlang 6.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,532 kB
  • sloc: cpp: 9,901,743; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (74 lines) | stat: -rw-r--r-- 3,372 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// REQUIRES: OS=maccatalyst || OS=macosx
// REQUIRES: maccatalyst_support
// REQUIRES: CPU=x86_64


// Zippered libraries

// RUN: %otool-classic -l %test-resource-dir/macosx/libswiftCore.dylib | %FileCheck %s --check-prefix=CHECK-ZIPPERED
// RUN: %otool-classic -l %test-resource-dir/macosx/libswiftDarwin.dylib | %FileCheck %s --check-prefix=CHECK-ZIPPERED
// RUN: %otool-classic -l %test-resource-dir/macosx/libswiftSwiftOnoneSupport.dylib | %FileCheck %s --check-prefix=CHECK-ZIPPERED
// RUN: %otool-classic -l %test-resource-dir/macosx/libswiftCompatibility51.a | %FileCheck %s --check-prefix=CHECK-ZIPPERED


// macCatalyst-only libraries
//   (None)

// Unzippered twins (separate iosMac-only and macOS-only libraries)
//   (None)

// For zippered dylibs we expect two load commands:
// one for macos and one for maccatalyst.
//
// Note: For dylibs with deployment targets earlier than 10.14 we
// should see an LC_VERSION_MIN_MACOSX load command followed by a
// LC_BUILD_VERSION command. This enables the dylib to be back
// deployed to versions of the OS don't support macCatalyst.
//
// For dylibs targetting 10.14 and later, we should see two
// LC_BUILD_VERSION commands.
//
// CHECK-ZIPPERED:       cmd {{LC_BUILD_VERSION|LC_VERSION_MIN_MACOSX}}
// CHECK-ZIPPERED-NEXT:  cmdsize
// CHECK-ZIPPERED-NEXT:  {{platform 1|version}}
// CHECK-ZIPPERED-NEXT:  {{minos|sdk}}

// CHECK-ZIPPERED:       cmd LC_BUILD_VERSION
// CHECK-ZIPPERED-NEXT:  cmdsize
// CHECK-ZIPPERED-NEXT:  platform 6
// CHECK-ZIPPERED-NEXT:  minos

// For macCatalyst-only dylibs we expect a maccatalyst load command and no macos load command
// CHECK-MACCATALYST-NOT:   platform macos
// CHECK-MACCATALYST:       cmd LC_BUILD_VERSION
// CHECK-MACCATALYST-NEXT:  cmdsize
// CHECK-MACCATALYST-NEXT:  platform 6
// CHECK-MACCATALYST-NEXT:  minos
// CHECK-MACCATALYST-NOT:   platform macos


// For Mac-only dylibs we expect a macos load command and no maccatalyst load command
// Similar to the zippered case, when the deployment target is 10.14 and later
// we should expect a *single* LC_BUILD_VERSION command and when it is earlier
// we should expect only a LC_VERSION_MIN_MACOSX command.
// CHECK-MAC-NOT:   platform 6
// CHECK-MAC:       cmd LC_VERSION_MIN_MACOSX
// CHECK-MAC-NEXT:  cmdsize
// CHECK-MAC-NEXT:  version
// CHECK-MAC-NOT:   platform 6

// Check to make sure that when passing -target-variant the .o file is zippered.
func foo() { }

// RUN: %swiftc_driver -target x86_64-apple-macosx10.15 -target-variant x86_64-apple-ios13.1-macabi -emit-object %s -o %t.o
// RUN: %otool-classic -l %t.o | %FileCheck %s --check-prefix=CHECK-ZIPPERED

// With -target and -target variant reversed
// RUN: %swiftc_driver -target x86_64-apple-ios13.1-macabi -target-variant x86_64-apple-macosx10.15 -emit-object %s -o %t.reversed.o
// RUN: %otool-classic -l %t.reversed.o | %FileCheck %s --check-prefix=CHECK-ZIPPERED

// RUN: %swiftc_driver -target x86_64-apple-macosx10.15 -target-variant x86_64-apple-ios13.1-macabi -emit-library -module-name foo %s -o %t.dylib
// RUN: %otool-classic -l %t.dylib | %FileCheck %s --check-prefix=CHECK-ZIPPERED

// RUN: %swiftc_driver -target x86_64-apple-ios13.1-macabi -target-variant x86_64-apple-macosx10.15 -emit-library -module-name foo %s -o %t.reversed.dylib
// RUN: %otool-classic -l %t.reversed.dylib | %FileCheck %s --check-prefix=CHECK-ZIPPERED