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

    <tr>
        <th>Summary</th>
        <td>
            Cannot build mlir with shared libs `error: undefined reference to 'mlir::makeOptimizingTransformer(unsigned int, unsigned int, llvm::TargetMachine*)'`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir:core
      </td>
    </tr>

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

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

<pre>
    ```
tools/mlir/lib/Dialect/GPU/CMakeFiles/obj.MLIRGPUTransforms.dir/Transforms/SerializeToHsaco.cpp.o:SerializeToHsaco.cpp:function (anonymous namespace)::SerializeToHsacoPass::optimizeLlvm(llvm::Module&, llvm::TargetMachine&): 
error: undefined reference to 'mlir::makeOptimizingTransformer(unsigned int, unsigned int, llvm::TargetMachine*)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```
Log:
https://llvm-jenkins.debian.net/job/llvm-toolchain-jammy-binaries/architecture=amd64,distribution=jammy,label=amd64/21/console

cc @joker-eph 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNk8GOmzAQhp8GLlYQMYQkBw7bjdJW2qirdvsAgxnAWWMj26RNn75js7tRq-29EjLYvz3z-5uhMe21Tqr85ckPSX7njVEu4cdRSUsvJRsaDxIUCk9fHx-_03h_gmc8SoVhp2nO2enh81eSnixo1xk7uqyNx28LNPmGluLIX_hkPjkQJhPTlJmkuHtPoOVu1sJLo1nCd6CNvo5mdkzDiG4CgQnf06Z3jj-Cc4tiJi9HEh7UZaQgKryicDLtrChClfB7dlt-AtujP4EYpF7UkIItZNBaY8N01i12tKFlFju0qAUyb8jlNkKLkUYC9GXJLnX_hgEJym7WTvbhuNQ-5P97_k8_d8EP3y52hALdJ_xDeMjUmzsl9TNaJsw4gm5ZB1Smlv2QfmD4U3oSWmTrwHR2yFaXYN0hUvKLERB4hywxxV-t8WD6YCt-D95PETI_hi4hx6sz6mepqfLYSNCZxtAvZ9O86qGzxABSr84wjtdVIzVYGVsILN3QU4fNFpPiAGNblUSilc5b2czRVHGIx2hZQYPqtu3I1zQIo52hki7GF0KCJWV-NoRjhdPA0rYu2n2xh9RLr7C-B62NZ80sVctC6RZKbgBLxKjzHaO7_z9lr_J0tqr-E31Plucmo3K_cH7FPVlzXv5Z6dwcMW9KXvJ0qNci3-27rugqvt5thdh2e1jvEGC35VvcQBoJuzrZUHfxl9sJQ7XhPNkcUlnznPO8yLd5VdKYVSLf7_NqU3FRNuWmIOw4UuNlwUlmbJ_aOppq5t6RqKiw7ibS_xpIYExI8WH2g7G1u6oLUgdgGm9QR_u_ATDih-4">