<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57570>57570</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang Driver: Simplify Gentoo gcc-config detection
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:driver
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          MaskRay
      </td>
    </tr>
</table>

<pre>
    On Debian, Clang Driver tries to pick the GCC installation as selected by gcc-config. It triples to be permissive with `--target=` by detecting several aliases. I think these aliases detection should be removed.

```cpp
    GentooTestTriples.push_back(TargetTriple.str());
    // Check rest of triples.
    GentooTestTriples.append(ExtraTripleAliases.begin(),
                             ExtraTripleAliases.end());
    GentooTestTriples.append(CandidateTripleAliases.begin(),
                             CandidateTripleAliases.end());
```

The code parses `CURRENT=`, `LDPATH=`, etc, which does not look very pretty. I am considering adding `--gcc-install-dir=` (https://reviews.llvm.org/D133329) and `Generic_GCC::GCCInstallationDetector::ScanGentooGccConfig` may be simplified to use the `--gcc-install-dir=` code.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVE1vozAQ_TVwsYJcE2g4cEih211pv9Rmz5WxJ-CNwch20s2_3zEkTVZqe1lkYTyW3zzPvEdj5LH8MZAaGsWHiFWk0nxoSW3VASzxVoEj3pBRiR3xHZCHqiJqcJ5rzb0yA-GOONAgPEjSHEkrxEKYYavahHzxAWDUM0QDZATbK-cQmrwo35Eop4uF57YFH6U1rgKCBI9oCkk4QA5cE64Vd-AQECmoYSLi4Bw-H0AurjN7LUMmC705gEwiWkd0fXrndB5iHOcIwecBBm_MBpzfzFyTce-654aLXcRWm4ncvJM4bzEUsSKM9O6CEbFPOEjVAVbJIhQx2_PVk49S8XGEQSLo_R9v-Rxdn27bQKuGc77qgvLu8wbGDP4G4w-oVHyQSnIP_0nnHZw3Kb225rpfG5SbMBJlw23oM25Xvx4f779vZrEEteL0tf653ny-hMCLML10SnREGjw4GE-0MTuCcjqS0YL3xyAm3iP-4JQEG-TGpQzTJMog45PMF1LZkzqReOf96KJ0PbfcwkHBi0u0PvSJsS2G6ps0TafbESxAQMNaYwLxjNYJB9M1fny5slA96dfYefNJ8GHuzoMQ1eSkkLrnx6Brp_pRq61Cs6Gl9uiCYMoPKIcCJjGUN3nOloymqzSWZSqLtOCxV15DeW14zE-e5hTHk0auHH1xWry3uvy3FC0aet8kwvS4CPU4TYvRmt94Cpdo_T04_Mhus1sad-UqW63SIqfF6na5ooJn-fKmWVJBi2K5TVMRa96AdmWU3UWMiUAU88mZKmNRVseqZJQxWtCMpSxnaQJ0ecObjIq8oACcRUsKPVf6tUexLSdezb51uKmV85cGxhx_T-0AMOVEfL73nbHlN-52j_wYT1coJ_5_AY-RouI">