Commit 01aa10c
authored
Rollup merge of #98418 - topjohnwu:macos-dylib, r=jyn514
Allow macOS to build LLVM as shared library
Inspired by how [homebrew](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/llvm.rb) builds and distributes llvm, here we manually create a symlink with a versioned dylib path to make `llvm-config` work properly. Note, the resulting `rustc` executable and `librustc_driver-<hash>.dylib` still links to the un-versioned `libLLVM.dylib` as expected when distributed in the final output. I have confirmed this by checking `otool -L` on both binaries.
After the change, enabling `llvm.link-shared` and `llvm.thin-lto` will be possible on macOS.2 files changed
+41
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | 115 | | |
120 | 116 | | |
121 | 117 | | |
| |||
1460 | 1456 | | |
1461 | 1457 | | |
1462 | 1458 | | |
1463 | | - | |
| 1459 | + | |
1464 | 1460 | | |
1465 | 1461 | | |
1466 | 1462 | | |
| |||
1585 | 1581 | | |
1586 | 1582 | | |
1587 | 1583 | | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
1588 | 1592 | | |
1589 | 1593 | | |
1590 | 1594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
256 | | - | |
| 254 | + | |
257 | 255 | | |
258 | 256 | | |
259 | 257 | | |
| |||
359 | 357 | | |
360 | 358 | | |
361 | 359 | | |
362 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
441 | | - | |
| 441 | + | |
442 | 442 | | |
443 | | - | |
444 | | - | |
445 | | - | |
| 443 | + | |
446 | 444 | | |
447 | 445 | | |
448 | 446 | | |
449 | 447 | | |
450 | | - | |
| 448 | + | |
451 | 449 | | |
452 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
481 | 502 | | |
482 | 503 | | |
483 | 504 | | |
| |||
0 commit comments