664 lines · plain
1; RUN: rm -rf %t2; RUN: split-file %s %t3; RUN: yaml2obj %t/RPath.yaml -o %t/RPath4 5; RUN: clang-installapi --filetype=tbd-v5 \6; RUN: -target arm64-apple-macos13.0 -target x86_64-apple-macos13.0 \7; RUN: -install_name @rpath/Frameworks/RPath.framework/Versions/A/RPath \8; RUN: -current_version 1 -compatibility_version 1 \9; RUN: --extra-public-header=%t/public.h \10; RUN: -o %t/RPath_warnings.tbd \11; RUN: --verify-against=%t/RPath \12; RUN: --verify-mode=Pedantic 2>&1 | FileCheck %s --check-prefix=MISSING13; RUN: llvm-readtapi --compare %t/RPath_warnings.tbd %t/expected_no_rpaths.tbd14 15; MISSING-DAG: warning: runpath search paths missing from installAPI option: '@loader_path/../../../SharedFrameworks/ [ x86_64 arm64 ]'16; MISSING-DAG: warning: runpath search paths missing from installAPI option: '@loader_path/../../PrivateFrameworks/ [ x86_64 arm64 ]'17 18; RUN: clang-installapi --filetype=tbd-v5 \19; RUN: -target arm64-apple-macos13.0 -target x86_64-apple-macos13.0 \20; RUN: -install_name @rpath/Frameworks/RPath.framework/Versions/A/RPath \21; RUN: -current_version 1 -compatibility_version 1 \22; RUN: --extra-public-header=%t/public.h \23; RUN: -Xarch_arm64 -rpath @loader_path/../../../SharedFrameworks/ \24; RUN: -o %t/RPath_Xarch.tbd \25; RUN: --verify-against=%t/RPath \26; RUN: --verify-mode=Pedantic 2>&1 | FileCheck %s --check-prefix=XARCH27; RUN: llvm-readtapi --compare %t/RPath_Xarch.tbd %t/expected_xarch_rpaths.tbd28 29; XARCH: warning: runpath search paths do not match: '@loader_path/../../../SharedFrameworks/ [ arm64 ]' (provided) vs '@loader_path/../../../SharedFrameworks/ [ x86_64 arm64 ]'30; XARCH: warning: runpath search paths missing from installAPI option: '@loader_path/../../PrivateFrameworks/ [ x86_64 arm64 ]'31 32; RUN: clang-installapi --filetype=tbd-v5 \33; RUN: -target arm64-apple-macos13.0 -target x86_64-apple-macos13.0 \34; RUN: -install_name @rpath/Frameworks/RPath.framework/Versions/A/RPath \35; RUN: -current_version 1 -compatibility_version 1 \36; RUN: --extra-public-header=%t/public.h \37; RUN: -rpath @loader_path/../../../SharedFrameworks/ \38; RUN: -rpath @loader_path/../../PrivateFrameworks/ \39; RUN: --verify-against=%t/RPath --verify-mode=Pedantic \40; RUN: -o %t/RPath.tbd 2>&1 | FileCheck -allow-empty %s 41; RUN: llvm-readtapi --compare %t/RPath.tbd %t/expected.tbd42 43CHECK-NOT: error44CHECK-NOT: warning45 46;--- public.h47extern int publicGlobalVariable; 48 49;--- expected.tbd50{51 "main_library": {52 "exported_symbols": [53 {54 "data": {55 "global": [56 "_publicGlobalVariable"57 ]58 }59 }60 ],61 "flags": [62 {63 "attributes": [64 "not_app_extension_safe"65 ]66 }67 ],68 "install_names": [69 {70 "name": "@rpath/Frameworks/RPath.framework/Versions/A/RPath"71 }72 ],73 "rpaths": [74 {75 "paths": [76 "@loader_path/../../../SharedFrameworks/",77 "@loader_path/../../PrivateFrameworks/"78 ]79 }80 ],81 "target_info": [82 {83 "min_deployment": "13.0",84 "target": "x86_64-macos"85 },86 {87 "min_deployment": "13.0",88 "target": "arm64-macos"89 }90 ]91 },92 "tapi_tbd_version": 593}94 95;--- expected_no_rpaths.tbd96{97 "main_library": {98 "exported_symbols": [99 {100 "data": {101 "global": [102 "_publicGlobalVariable"103 ]104 }105 }106 ],107 "flags": [108 {109 "attributes": [110 "not_app_extension_safe"111 ]112 }113 ],114 "install_names": [115 {116 "name": "@rpath/Frameworks/RPath.framework/Versions/A/RPath"117 }118 ],119 "target_info": [120 {121 "min_deployment": "13.0",122 "target": "x86_64-macos"123 },124 {125 "min_deployment": "13.0",126 "target": "arm64-macos"127 }128 ]129 },130 "tapi_tbd_version": 5131}132 133;--- expected_xarch_rpaths.tbd134{135 "main_library": {136 "exported_symbols": [137 {138 "data": {139 "global": [140 "_publicGlobalVariable"141 ]142 }143 }144 ],145 "flags": [146 {147 "attributes": [148 "not_app_extension_safe"149 ]150 }151 ],152 "install_names": [153 {154 "name": "@rpath/Frameworks/RPath.framework/Versions/A/RPath"155 }156 ],157 "rpaths": [158 {159 "paths": [160 "@loader_path/../../../SharedFrameworks/"161 ],162 "targets": [163 "arm64-macos"164 ]165 }166 ],167 "target_info": [168 {169 "min_deployment": "13.0",170 "target": "x86_64-macos"171 },172 {173 "min_deployment": "13.0",174 "target": "arm64-macos"175 }176 ]177 },178 "tapi_tbd_version": 5179}180 181;--- RPath.yaml182--- !fat-mach-o183FatHeader:184 magic: 0xCAFEBABE185 nfat_arch: 2186FatArchs:187 - cputype: 0x1000007188 cpusubtype: 0x3189 offset: 0x1000190 size: 12408191 align: 12192 - cputype: 0x100000C193 cpusubtype: 0x0194 offset: 0x8000195 size: 33312196 align: 14197Slices:198 - !mach-o199 FileHeader:200 magic: 0xFEEDFACF201 cputype: 0x1000007202 cpusubtype: 0x3203 filetype: 0x6204 ncmds: 16205 sizeofcmds: 1072206 flags: 0x100085207 reserved: 0x0208 LoadCommands:209 - cmd: LC_SEGMENT_64210 cmdsize: 152211 segname: __TEXT212 vmaddr: 0213 vmsize: 8192214 fileoff: 0215 filesize: 8192216 maxprot: 5217 initprot: 5218 nsects: 1219 flags: 0220 Sections:221 - sectname: __text222 segname: __TEXT223 addr: 0x1050224 size: 0225 offset: 0x1050226 align: 0227 reloff: 0x0228 nreloc: 0229 flags: 0x80000000230 reserved1: 0x0231 reserved2: 0x0232 reserved3: 0x0233 content: ''234 - cmd: LC_SEGMENT_64235 cmdsize: 152236 segname: __DATA_CONST237 vmaddr: 8192238 vmsize: 4096239 fileoff: 8192240 filesize: 4096241 maxprot: 3242 initprot: 3243 nsects: 1244 flags: 16245 Sections:246 - sectname: __objc_imageinfo247 segname: __DATA_CONST248 addr: 0x2000249 size: 8250 offset: 0x2000251 align: 0252 reloff: 0x0253 nreloc: 0254 flags: 0x0255 reserved1: 0x0256 reserved2: 0x0257 reserved3: 0x0258 content: '0000000040000000'259 - cmd: LC_SEGMENT_64260 cmdsize: 152261 segname: __DATA262 vmaddr: 12288263 vmsize: 4096264 fileoff: 12288265 filesize: 0266 maxprot: 3267 initprot: 3268 nsects: 1269 flags: 0270 Sections:271 - sectname: __common272 segname: __DATA273 addr: 0x3000274 size: 4275 offset: 0x0276 align: 2277 reloff: 0x0278 nreloc: 0279 flags: 0x1280 reserved1: 0x0281 reserved2: 0x0282 reserved3: 0x0283 - cmd: LC_SEGMENT_64284 cmdsize: 72285 segname: __LINKEDIT286 vmaddr: 16384287 vmsize: 120288 fileoff: 12288289 filesize: 120290 maxprot: 1291 initprot: 1292 nsects: 0293 flags: 0294 - cmd: LC_DYLD_INFO_ONLY295 cmdsize: 48296 rebase_off: 0297 rebase_size: 0298 bind_off: 0299 bind_size: 0300 weak_bind_off: 0301 weak_bind_size: 0302 lazy_bind_off: 0303 lazy_bind_size: 0304 export_off: 12288305 export_size: 32306 - cmd: LC_SYMTAB307 cmdsize: 24308 symoff: 12328309 nsyms: 2310 stroff: 12360311 strsize: 48312 - cmd: LC_DYSYMTAB313 cmdsize: 80314 ilocalsym: 0315 nlocalsym: 0316 iextdefsym: 0317 nextdefsym: 1318 iundefsym: 1319 nundefsym: 1320 tocoff: 0321 ntoc: 0322 modtaboff: 0323 nmodtab: 0324 extrefsymoff: 0325 nextrefsyms: 0326 indirectsymoff: 0327 nindirectsyms: 0328 extreloff: 0329 nextrel: 0330 locreloff: 0331 nlocrel: 0332 - cmd: LC_RPATH333 cmdsize: 56334 path: 12335 Content: '@loader_path/../../../SharedFrameworks/'336 ZeroPadBytes: 5337 - cmd: LC_RPATH338 cmdsize: 56339 path: 12340 Content: '@loader_path/../../PrivateFrameworks/'341 ZeroPadBytes: 7342 - cmd: LC_ID_DYLIB343 cmdsize: 80344 dylib:345 name: 24346 timestamp: 0347 current_version: 65536348 compatibility_version: 65536349 Content: '@rpath/Frameworks/RPath.framework/Versions/A/RPath'350 ZeroPadBytes: 6351 - cmd: LC_UUID352 cmdsize: 24353 uuid: 4C4C4489-5555-3144-A1D1-28C8EA66FB24354 - cmd: LC_BUILD_VERSION355 cmdsize: 32356 platform: 1357 minos: 851968358 sdk: 983040359 ntools: 1360 Tools:361 - tool: 4362 version: 1245184363 - cmd: LC_LOAD_DYLIB364 cmdsize: 56365 dylib:366 name: 24367 timestamp: 0368 current_version: 14942208369 compatibility_version: 65536370 Content: '/usr/lib/libobjc.A.dylib'371 ZeroPadBytes: 8372 - cmd: LC_LOAD_DYLIB373 cmdsize: 56374 dylib:375 name: 24376 timestamp: 0377 current_version: 88539136378 compatibility_version: 65536379 Content: '/usr/lib/libSystem.B.dylib'380 ZeroPadBytes: 6381 - cmd: LC_FUNCTION_STARTS382 cmdsize: 16383 dataoff: 12320384 datasize: 8385 - cmd: LC_DATA_IN_CODE386 cmdsize: 16387 dataoff: 12328388 datasize: 0389 LinkEditData:390 ExportTrie:391 TerminalSize: 0392 NodeOffset: 0393 Name: ''394 Flags: 0x0395 Address: 0x0396 Other: 0x0397 ImportName: ''398 Children:399 - TerminalSize: 3400 NodeOffset: 25401 Name: _publicGlobalVariable402 Flags: 0x0403 Address: 0x3000404 Other: 0x0405 ImportName: ''406 NameList:407 - n_strx: 2408 n_type: 0xF409 n_sect: 3410 n_desc: 0411 n_value: 12288412 - n_strx: 24413 n_type: 0x1414 n_sect: 0415 n_desc: 512416 n_value: 0417 StringTable:418 - ' '419 - _publicGlobalVariable420 - dyld_stub_binder421 - ''422 - ''423 - ''424 - ''425 - ''426 - ''427 - ''428 - !mach-o429 FileHeader:430 magic: 0xFEEDFACF431 cputype: 0x100000C432 cpusubtype: 0x0433 filetype: 0x6434 ncmds: 17435 sizeofcmds: 1088436 flags: 0x100085437 reserved: 0x0438 LoadCommands:439 - cmd: LC_SEGMENT_64440 cmdsize: 152441 segname: __TEXT442 vmaddr: 0443 vmsize: 16384444 fileoff: 0445 filesize: 16384446 maxprot: 5447 initprot: 5448 nsects: 1449 flags: 0450 Sections:451 - sectname: __text452 segname: __TEXT453 addr: 0x1060454 size: 0455 offset: 0x1060456 align: 0457 reloff: 0x0458 nreloc: 0459 flags: 0x80000000460 reserved1: 0x0461 reserved2: 0x0462 reserved3: 0x0463 content: ''464 - cmd: LC_SEGMENT_64465 cmdsize: 152466 segname: __DATA_CONST467 vmaddr: 16384468 vmsize: 16384469 fileoff: 16384470 filesize: 16384471 maxprot: 3472 initprot: 3473 nsects: 1474 flags: 16475 Sections:476 - sectname: __objc_imageinfo477 segname: __DATA_CONST478 addr: 0x4000479 size: 8480 offset: 0x4000481 align: 0482 reloff: 0x0483 nreloc: 0484 flags: 0x0485 reserved1: 0x0486 reserved2: 0x0487 reserved3: 0x0488 content: '0000000040000000'489 - cmd: LC_SEGMENT_64490 cmdsize: 152491 segname: __DATA492 vmaddr: 32768493 vmsize: 16384494 fileoff: 32768495 filesize: 0496 maxprot: 3497 initprot: 3498 nsects: 1499 flags: 0500 Sections:501 - sectname: __common502 segname: __DATA503 addr: 0x8000504 size: 4505 offset: 0x0506 align: 2507 reloff: 0x0508 nreloc: 0509 flags: 0x1510 reserved1: 0x0511 reserved2: 0x0512 reserved3: 0x0513 - cmd: LC_SEGMENT_64514 cmdsize: 72515 segname: __LINKEDIT516 vmaddr: 49152517 vmsize: 544518 fileoff: 32768519 filesize: 544520 maxprot: 1521 initprot: 1522 nsects: 0523 flags: 0524 - cmd: LC_DYLD_INFO_ONLY525 cmdsize: 48526 rebase_off: 0527 rebase_size: 0528 bind_off: 0529 bind_size: 0530 weak_bind_off: 0531 weak_bind_size: 0532 lazy_bind_off: 0533 lazy_bind_size: 0534 export_off: 32768535 export_size: 32536 - cmd: LC_SYMTAB537 cmdsize: 24538 symoff: 32808539 nsyms: 2540 stroff: 32840541 strsize: 48542 - cmd: LC_DYSYMTAB543 cmdsize: 80544 ilocalsym: 0545 nlocalsym: 0546 iextdefsym: 0547 nextdefsym: 1548 iundefsym: 1549 nundefsym: 1550 tocoff: 0551 ntoc: 0552 modtaboff: 0553 nmodtab: 0554 extrefsymoff: 0555 nextrefsyms: 0556 indirectsymoff: 0557 nindirectsyms: 0558 extreloff: 0559 nextrel: 0560 locreloff: 0561 nlocrel: 0562 - cmd: LC_RPATH563 cmdsize: 56564 path: 12565 Content: '@loader_path/../../../SharedFrameworks/'566 ZeroPadBytes: 5567 - cmd: LC_RPATH568 cmdsize: 56569 path: 12570 Content: '@loader_path/../../PrivateFrameworks/'571 ZeroPadBytes: 7572 - cmd: LC_ID_DYLIB573 cmdsize: 80574 dylib:575 name: 24576 timestamp: 0577 current_version: 65536578 compatibility_version: 65536579 Content: '@rpath/Frameworks/RPath.framework/Versions/A/RPath'580 ZeroPadBytes: 6581 - cmd: LC_UUID582 cmdsize: 24583 uuid: 4C4C440D-5555-3144-A18B-DB67A0A12202584 - cmd: LC_BUILD_VERSION585 cmdsize: 32586 platform: 1587 minos: 851968588 sdk: 983040589 ntools: 1590 Tools:591 - tool: 4592 version: 1245184593 - cmd: LC_LOAD_DYLIB594 cmdsize: 56595 dylib:596 name: 24597 timestamp: 0598 current_version: 14942208599 compatibility_version: 65536600 Content: '/usr/lib/libobjc.A.dylib'601 ZeroPadBytes: 8602 - cmd: LC_LOAD_DYLIB603 cmdsize: 56604 dylib:605 name: 24606 timestamp: 0607 current_version: 88539136608 compatibility_version: 65536609 Content: '/usr/lib/libSystem.B.dylib'610 ZeroPadBytes: 6611 - cmd: LC_FUNCTION_STARTS612 cmdsize: 16613 dataoff: 32800614 datasize: 8615 - cmd: LC_DATA_IN_CODE616 cmdsize: 16617 dataoff: 32808618 datasize: 0619 - cmd: LC_CODE_SIGNATURE620 cmdsize: 16621 dataoff: 32896622 datasize: 416623 LinkEditData:624 ExportTrie:625 TerminalSize: 0626 NodeOffset: 0627 Name: ''628 Flags: 0x0629 Address: 0x0630 Other: 0x0631 ImportName: ''632 Children:633 - TerminalSize: 4634 NodeOffset: 25635 Name: _publicGlobalVariable636 Flags: 0x0637 Address: 0x8000638 Other: 0x0639 ImportName: ''640 NameList:641 - n_strx: 2642 n_type: 0xF643 n_sect: 3644 n_desc: 0645 n_value: 32768646 - n_strx: 24647 n_type: 0x1648 n_sect: 0649 n_desc: 512650 n_value: 0651 StringTable:652 - ' '653 - _publicGlobalVariable654 - dyld_stub_binder655 - ''656 - ''657 - ''658 - ''659 - ''660 - ''661 - ''662 FunctionStarts: [ 0x1060 ]663...664