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

    <tr>
        <th>Summary</th>
        <td>
            [clang][amdgpu] Add LLVM_ENABLE_HSA flag or similar
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    Recent patches have updated the [amdgpu-arch tool](https://github.com/llvm/llvm-project/commits/main/clang/tools/amdgpu-arch).

With the current behavior, if a local HSA is found, the tool will be built with it.

HSA is part of the rocr-runtime which depends on the rocm-device-libs and those need clang to build. If an older HSA is on the system the tool may fail to build with a newer Clang, i.e. Clang will fail to build and the error will only be noticeable during linking of the tool. Old clang won't be able to build new HSA either.

Deadlock, until the old HSA is forcefully removed :(

I think there needs to be an `LLVM_ENABLE_HSA` flag or similar and that flag needs to be disabled by default. Otherwise we may get deadlocks on source based distros where users need to jump through hoops to get things running again.

cc @jhuber6 @JonChesterfield @arsenm @littlewu2508 @mgorny
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVMuO4zYQ_Br60rBA05Y8PujgGa-xG0yyQBZIjguKbImcoUiBDwv--4CUPa9bLpb4qOqqaqt5CHqwiC2pH0l9WvEUlfMt597Z0VnJzapz8tr-jQJthIlHoTCA4heENEkeUUJUCKR-5KMcprTmXiiIzhlSnwh7UDFOgWyPhJ0JOw86qtRVwo2EnY253B_rybsXFJGws3DjqGMg7DxybfOG4XYg7Jw58_aHOoQdKkJPhB6X3391VEWOSN5nvR0qftHOE_YEugcOxglu4PuvI-gAvUtW5qMMyfQwa2OgQ-iSNhHmTKfjpxI36MR9BNcXpHfCr32yUY8Is9JCgcQJrQzg7P3GuJZ40QLXRncBuM2xuYBgESUUixBdqSsr-NEDt-CMRH_XemMK1xBxfBc88iv0XJs38CKag8UZPTwt2T2BrrBaVovHz5hFDgJ67_xywVlzzUlYF7VA3hkEmby2AxhtX_Pz5j7LqOCnubuYnSVsn6OHgnorYnEuZlBHhf5TqCfk0jjxmpXmHE1hdka-d8oL7JMxV_A4ugtKKP-ph48sPyAqbV8z1i_BhlIdc5ikoc_P__z5-9tfx8fnb7-__zqShkJv-ADOQ9CjNtzfguBxOfhIIXXIdiR0V5DY82RiBT9zqVkHhBlLKwaMIG9mSs-CS14gdDygzBzRuwBzEZgC-rD0Pzp4SeMEUXmXBgXKuakUznzZ1BDAJ2tz7Hzg2n5KTwggO_qiUoe-ya9_OPukMET0vUYj8xb3Ae2Y34yO0eCcWE0f8nocnLfXlWy38rA98BW2m2bf0C1tKFupdl8_0JrTA93vGtnRvme7w44KgUx2Hd3sV7pllG0p29ANo1vGKtrstlvGNhu62yGvN2RHceTaVPlDr5wfVjqEhG1Dm4auDO_QhPv48W2ZBl0aQpEaYniHRR1NGVTLRKhPb0OH1Cc4SglfOvy1vavkTfu_B1JRmwdPEfxfAAAA___1iLr-">