As described in Issue #53709, since 28d58d8fe2094af6902dee7b4d68ec30a3e9d737 clang doesn't find the latest of several parallel GCC installations on Solaris, but only the first in directory order, which is pretty random.
Since this breaks basic functionality of the Solaris port, this patch restores scanning all prefixes for GCC installations.
Tested on sparcv9-sun-solaris2.11, amd64-pc-solaris2.11, and x86_64-pc-linux-gnu.
Adding a Solaris special case here seems strange.
Do you know what the typical Prefixes values are on Solaris? Is it possible to remove some elements as a special case for Solaris instead?