Commit be5ec4a
committed
[Driver] Improve error when a compiler-rt library is not found
BSD, Linux, and z/OS enable `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` by default.
When a compiler-rt library is not found, we currently report an
incorrect filename `libclang_rt.XXX-$arch.a`
```
% /tmp/Debug/bin/clang++ a.cc -fsanitize=address -o a
ld.lld: error: cannot open /tmp/Debug/lib/clang/19/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```
With this change, we will correctly report:
```
% /tmp/Debug/bin/clang++ a.cc -fsanitize=address -o a
ld.lld: error: cannot open /tmp/Debug/lib/clang/19/lib/x86_64-unknown-linux-gnu/libclang_rt.asan.a: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```
Link: https://discourse.llvm.org/t/runtime-directory-fallback/768601 parent cebb8f0 commit be5ec4a
File tree
32 files changed
+114
-104
lines changed- clang
- lib/Driver
- test/Driver
- Inputs/resource_dir/lib
- aarch64-unknown-linux
- i386-unknown-linux
- i686-unknown-linux
- x86_64-unknown-linux
32 files changed
+114
-104
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
| 659 | + | |
659 | 660 | | |
660 | 661 | | |
661 | 662 | | |
662 | 663 | | |
663 | 664 | | |
| 665 | + | |
| 666 | + | |
664 | 667 | | |
| 668 | + | |
| 669 | + | |
665 | 670 | | |
666 | | - | |
667 | | - | |
| 671 | + | |
668 | 672 | | |
669 | 673 | | |
670 | | - | |
671 | | - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
672 | 682 | | |
673 | 683 | | |
674 | 684 | | |
| |||
0 commit comments