llvm-project

Форк
0
/
zippered.yaml 
114 строк · 5.0 Кб
1
# REQUIRES: x86
2
# RUN: rm -rf %t; mkdir %t
3
# RUN: yaml2obj %s > %t/test.dylib
4
# RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15 -o %t/test_macos.o
5
# RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-ios13.15.0-macabi -o %t/test_maccatalyst.o
6
# RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-ios13.15.0 -o %t/test_ios.o
7

8
## Test linking against a zippered dylib.
9
# RUN: %lld -lSystem -dylib %t/test.dylib %t/test_macos.o -o /dev/null
10
# RUN: %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_maccatalyst.o -o /dev/null
11

12
# RUN: %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version mac-catalyst 13.15.0 14.0 %t/test_maccatalyst.o -o /dev/null -framework MacOnly-Indirect
13

14
# RUN: not %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version mac-catalyst 13.15.0 14.0 %t/test_maccatalyst.o -o /dev/null -framework MacOnly 2>&1 | FileCheck --check-prefix=INCOMPATIBLE %s
15
# INCOMPATIBLE: System/Library/Frameworks{{[\\/]}}MacOnly.framework{{[\\/]}}MacOnly.tbd(MacOnly.dylib) is incompatible with x86_64 (macCatalyst13.15.0)
16

17
# RUN: not %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version ios 13.15.0 14.0 %t/test.dylib %t/test_ios.o -o /dev/null 2>&1 | FileCheck %s
18
# CHECK: test.dylib has platform macOS/macCatalyst, which is different from target platform iOS
19

20
## Test creating a zippered dylib.
21
# RUN: %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version macos 12.0 13.0 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_macos.o -o %t/test_zippered.dylib
22
# RUN: llvm-otool -l %t/test_zippered.dylib | FileCheck --check-prefix=ZIPPERED %s
23
# ZIPPERED:           cmd LC_BUILD_VERSION
24
# ZIPPERED-NEXT:  cmdsize
25
# ZIPPERED-NEXT: platform 1
26
# ZIPPERED-NEXT:      sdk 13.0
27
# ZIPPERED-NEXT:    minos 12.0
28
# ZIPPERED-NEXT:   ntools 1
29
# ZIPPERED-NEXT:     tool
30
# ZIPPERED-NEXT:  version
31
# ZIPPERED-NEXT: Load command
32
# ZIPPERED-NEXT:      cmd LC_BUILD_VERSION
33
# ZIPPERED-NEXT:  cmdsize
34
# ZIPPERED-NEXT: platform 6
35
# ZIPPERED-NEXT:      sdk 14.0
36
# ZIPPERED-NEXT:    minos 13.15
37
# ZIPPERED-NEXT:   ntools 1
38
# ZIPPERED-NEXT:     tool
39
# ZIPPERED-NEXT:  version
40

41
# RUN: %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version macos 10.8 13.0 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_macos.o -o %t/test_zippered.dylib
42
# RUN: llvm-otool -l %t/test_zippered.dylib | FileCheck --check-prefix=ZIPPERED-OLD %s
43
# ZIPPERED-OLD:           cmd LC_VERSION_MIN_MACOSX
44
# ZIPPERED-OLD-NEXT:  cmdsize
45
# ZIPPERED-OLD-NEXT:  version 10.8
46
# ZIPPERED-OLD-NEXT:      sdk 13.0
47
# ZIPPERED-OLD-NEXT: Load command
48
# ZIPPERED-OLD-NEXT:      cmd LC_BUILD_VERSION
49
# ZIPPERED-OLD-NEXT:  cmdsize
50
# ZIPPERED-OLD-NEXT: platform 6
51
# ZIPPERED-OLD-NEXT:      sdk 14.0
52
# ZIPPERED-OLD-NEXT:    minos 13.15
53
# ZIPPERED-OLD-NEXT:   ntools 1
54
# ZIPPERED-OLD-NEXT:     tool
55
# ZIPPERED-OLD-NEXT:  version
56

57
# RUN: not %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -arch x86_64 -platform_version macos 10.8 13.0 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_macos.o -o %t/test_zippered.dylib 2>&1 | FileCheck --check-prefix=ZIPPERED-EXE %s
58
# ZIPPERED-EXE: writing zippered outputs only valid for -dylib and -bundle
59

60
## Reject .o files which only have the secondary platform.
61
# RUN: not %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version macos 12.0 13.0 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_maccatalyst.o -o %t/test_zippered.dylib 2>&1 | FileCheck --check-prefix=CAT %s
62
# CAT: test_maccatalyst.o has platform macCatalyst, which is different from target platform macOS
63

64
--- !mach-o
65
FileHeader:
66
  magic:           0xFEEDFACF
67
  cputype:         0x1000007
68
  cpusubtype:      0x3
69
  filetype:        0x6
70
  ncmds:           4
71
  sizeofcmds:      600
72
  flags:           0x100085
73
  reserved:        0x0
74
LoadCommands:
75
  - cmd:             LC_ID_DYLIB
76
    cmdsize:         32
77
    dylib:
78
      name:            24
79
      timestamp:       1
80
      current_version: 0
81
      compatibility_version: 0
82
    Content:         test
83
    ZeroPadBytes:    4
84
  - cmd:             LC_DYLD_INFO_ONLY
85
    cmdsize:         48
86
    rebase_off:      0
87
    rebase_size:     0
88
    bind_off:        0
89
    bind_size:       0
90
    weak_bind_off:   0
91
    weak_bind_size:  0
92
    lazy_bind_off:   0
93
    lazy_bind_size:  0
94
    export_off:      0
95
    export_size:     0
96
  - cmd:             LC_BUILD_VERSION
97
    cmdsize:         32
98
    platform:        1
99
    minos:           659200
100
    sdk:             720896
101
    ntools:          1
102
    Tools:
103
      - tool:            3
104
        version:         39913472
105
  - cmd:             LC_BUILD_VERSION
106
    cmdsize:         32
107
    platform:        6
108
    minos:           855808
109
    sdk:             917504
110
    ntools:          1
111
    Tools:
112
      - tool:            3
113
        version:         39913472
114
...
115

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.