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

    <tr>
        <th>Summary</th>
        <td>
            Standalone libclc build fails on 19.1.0
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    
Attempting a standalone libclc build on Linux after building llvm 19.1.0 with libclc built-in (which itself appears to be incomplete because mesa complains about a missing libclc.):
```-- Found zstd: /usr/local/lib64/libzstd.so
-- Found LibXml2: /usr/local/lib64/libxml2.so (found version "2.13.3")
-- Linker detection: GNU ld
-- libclc LLVM version: 19.1.0
CMake Error at /usr/local/lib64/cmake/llvm/AddLLVM.cmake:1029 (add_executable):
 add_executable cannot create target "prepare_builtins" because an imported
  target with the same name already exists.
Call Stack (most recent call first):
  CMakeLists.txt:170 (add_llvm_executable)


CMake Error at /usr/local/lib64/cmake/llvm/LLVM-Config.cmake:95 (target_link_libraries):
 IMPORTED library can only be used with the INTERFACE keyword of
 target_link_libraries
Call Stack (most recent call first):
 /usr/local/lib64/cmake/llvm/AddLLVM.cmake:1089 (llvm_config)
 CMakeLists.txt:170 (add_llvm_executable)


CMake Error at /usr/local/lib64/cmake/llvm/AddLLVM.cmake:1106 (target_link_libraries):
 IMPORTED library can only be used with the INTERFACE keyword of
 target_link_libraries
Call Stack (most recent call first):
 CMakeLists.txt:170 (add_llvm_executable)


CMake Error at CMakeLists.txt:177 (target_compile_definitions):
 target_compile_definitions may only set INTERFACE properties on IMPORTED
 targets


-- Found Python3: /usr/local/bin/python3.12 (found version "3.12.6") found components: Interpreter
-- libclc target 'amdgcn--' is enabled
```

_Originally posted by @satmandu in https://github.com/llvm/llvm-project/issues/101154#issuecomment-2363985324_
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/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