Repository navigation
Commit 58c344e
authored
Rollup merge of #164134 - danieljhkim:fix-rust-objcopy-rpath, r=Kobzol
bootstrap: add an rpath to LLVM library for LLVM tools
Closes [#164063](#164063) by adding rpath to the LLVM tool executables on both Linux and macOS, using the same approach as Lld::run.
This PR is now written by a human, resubmitting [#164064](#164064) which was diagnosed and written by Claude.
**Validation:**
macOS
```bash
❯ otool -l ~/workspace/repos/rust/build/aarch64-apple-darwin/llvm/bin/llvm-objcopy | grep -A2 LC_RPATH
cmd LC_RPATH
cmdsize 40
path @loader_path/../../../ (offset 12)
--
cmd LC_RPATH
cmdsize 32
path @loader_path/../lib (offset 12)
❯ otool -L build/aarch64-apple-darwin/llvm/lib/libLLVM.dylib
build/aarch64-apple-darwin/llvm/lib/libLLVM.dylib:
@rpath/libLLVM.dylib (compatibility version 1.0.0, current version 23.1.3)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1359.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 2200.27.0)
```
linux
```bash
readelf -d build/x86_64-unknown-linux-gnu/llvm/bin/llvm-objcopy | grep RUNPATH
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/../../../:$ORIGIN/../lib:$ORIGIN/../lib/x86_64-unknown-linux-gnu]
```2 files changed
Lines changed: 35 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
569 | 579 | | |
570 | 580 | | |
571 | 581 | | |
| |||
1162 | 1172 | | |
1163 | 1173 | | |
1164 | 1174 | | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1165 | 1192 | | |
1166 | 1193 | | |
1167 | 1194 | | |
| |||
1436 | 1463 | | |
1437 | 1464 | | |
1438 | 1465 | | |
1439 | | - | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
| 1466 | + | |
1445 | 1467 | | |
1446 | 1468 | | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
1452 | 1472 | | |
1453 | 1473 | | |
1454 | 1474 | | |
| |||
1724 | 1744 | | |
1725 | 1745 | | |
1726 | 1746 | | |
1727 | | - | |
1728 | | - | |
1729 | | - | |
1730 | | - | |
| 1747 | + | |
1731 | 1748 | | |
1732 | 1749 | | |
1733 | | - | |
1734 | | - | |
1735 | | - | |
1736 | | - | |
1737 | | - | |
1738 | | - | |
1739 | | - | |
1740 | | - | |
1741 | | - | |
| 1750 | + | |
| 1751 | + | |
1742 | 1752 | | |
1743 | 1753 | | |
1744 | 1754 | | |
| |||
0 commit comments