[cfe-dev] [RFC] Changing tool search path priority

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Thu May 14 06:34:18 PDT 2020


On Thu, May 14, 2020 at 09:38:43AM +0100, David Spickett via cfe-dev wrote:
> I have a patch up for review that changes how external tools like gcc are
> found [0]. Short version, more specific names on the user's PATH should be
> found before less specific names that are in the clang install dir.

I don't mind inverting the flow here.

> This was raised in a bug report [1] and I'll use that to describe the
> current behaviour.
> 
> $ clang --target=aarch64-none-elf <...>
> 
> Clang looks for a GCC to use. With one of these possible names:
> "aarch64-elf-none-gcc", "gcc", ""x86_64-unknown-linux-gnu-gcc" (which is
> the default triple in this example)

...but I don't think we should ever be looking for
${DEFAULT_TRIPLE}-gcc. That doesn't make sense to me at all.

> We look for each name in the installed dir first, so if clang is in
> /usr/bin we likely find /usr/bin/gcc. This isn't going to work for cross
> compiling.

It works with as/ld in most places, but I can understand the desire to
having them in PATH.

Joerg


More information about the cfe-dev mailing list