[Driver] Stop searching other prefixes once a GCC installation is found in one prefix
authorFangrui Song <i@maskray.me>
Sat, 20 Mar 2021 03:35:59 +0000 (20:35 -0700)
committerFangrui Song <i@maskray.me>
Sat, 20 Mar 2021 03:35:59 +0000 (20:35 -0700)
commit28d58d8fe2094af6902dee7b4d68ec30a3e9d737
tree33d0badf2097527b09d88fdd659e29602db22418
parentfe5f4c397f029b66a541b25d4749496785f2d4f5
[Driver] Stop searching other prefixes once a GCC installation is found in one prefix

so that when --sysroot is specified, the detected GCC installation will not be
overridden by another from /usr which happens to have a larger version.

This behavior is particularly inconvenient when the system has a larger version
GCC while the user wants to try out an older sysroot.

Delete some tests from linux-ld.c which overlap with cross-linux.c
clang/lib/Driver/ToolChains/Gnu.cpp
clang/test/Driver/linux-ld.c
clang/unittests/Driver/ToolChainTest.cpp