Commit b876596
authored
[Driver] Improve error when a compiler-rt library is not found (#81037)
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 695b630 commit b876596
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 | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
684 | 685 | | |
685 | 686 | | |
686 | 687 | | |
687 | 688 | | |
688 | 689 | | |
| 690 | + | |
| 691 | + | |
689 | 692 | | |
| 693 | + | |
| 694 | + | |
690 | 695 | | |
691 | | - | |
692 | | - | |
| 696 | + | |
693 | 697 | | |
694 | 698 | | |
695 | | - | |
696 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
697 | 707 | | |
698 | 708 | | |
699 | 709 | | |
| |||
0 commit comments