[clang] [clang][Driver] Obey -fuse-ld=... for -print-prog-name=ld output (PR #66698)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 18 23:49:34 PDT 2023


MaskRay wrote:

> > Can you comment on what projects need this? Can't we fix the projects instead? And what do they do with the linker path? Why don't they invoke the clang driver to run a link action?
> 
> They are legion. It comes from autoconf checks for libtool. It doesn't really matter why they're doing it. They are doing it and it will be years before they can all be changed. If you want to use Clang as the compiler for random open source code, it needs to be compatible with GCC in this regard.

Do your have some examples of such projects? As mentioned, I know multiple lld based distributions and they don't find `clang -fuse-ld=ld --print-prog-name=ld` not behave like GCC a problem. If you think there are many and existing distributions haven't detected them, I'd like to know the project.

BTW: if you make `ld` a symlink to `lld` or `ld.lld`, you'll pretty much not notice anything.


https://github.com/llvm/llvm-project/pull/66698


More information about the cfe-commits mailing list