[clang] [RFC] [clang][Toolchain] Treat "pc"/"unknown" vendor interchangeable (PR #97802)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 9 18:08:33 PDT 2024
MaskRay wrote:
> The problem is not only with Rust, it is any invocation with non-default --target (--target != LLVM_DEFAULT_TARGET_TRIPLE), and I was fixing a C++ issue not a Rust issue, but I guess it will be covered
If you specify the wrong `--target=` (avoid `-target `, deprecated since Clang 3.4), clangDriver will not find the compiler-rt library.
This works as intended.
If you mix target triples for LTO you will get warnings:
```
% clang --target=x86_64-pc-linux-gnu -flto -c a.c && clang --target=x86_64-unkwown-linux-gnu -flto -c b.c && clang -flto -fuse-ld=lld a.o b.o
ld.lld: warning: Linking two modules of different target triples: 'b.o' is 'x86_64-unkwown-linux-gnu' whereas 'ld-temp.o' is 'x86_64-pc-linux-gnu'
```
> @MaskRay you still think that it does not worth to make this two targets (x86_64-**pc**-linux-gnu and x86_64-**unknown**-linux-gnu) interchangeable?
Try fixing the build system issue instead:) I hope that we don't make Clang less strict.
https://github.com/llvm/llvm-project/pull/97802
More information about the cfe-commits
mailing list