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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to