[all-commits] [llvm/llvm-project] 028571: [clang][Driver] Correct tool search path priority

David Spickett via All-commits all-commits at lists.llvm.org
Mon Jun 22 01:41:32 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 028571d60843cb87e2637ef69ee09090d4526c62
      https://github.com/llvm/llvm-project/commit/028571d60843cb87e2637ef69ee09090d4526c62
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2020-06-22 (Mon, 22 Jun 2020)

  Changed paths:
    M clang/lib/Driver/Driver.cpp
    A clang/test/Driver/program-path-priority.c
    M clang/test/lit.cfg.py

  Log Message:
  -----------
  [clang][Driver] Correct tool search path priority

Summary:
As seen in:
https://bugs.llvm.org/show_bug.cgi?id=45693

When clang looks for a tool it has a set of
possible names for it, in priority order.
Previously it would look for these names in
the program path. Then look for all the names
in the PATH.

This means that aarch64-none-elf-gcc on the PATH
would lose to gcc in the program path.
(which was /usr/bin in the bug's case)

This changes that logic to search each name in both
possible locations, then move to the next name.
Which is more what you would expect to happen when
using a non default triple.

(-B prefixes maybe should follow this logic too,
but are not changed in this patch)

Subscribers: kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79988




More information about the All-commits mailing list