<div dir="ltr">Hi all,<br><br>Maybe I'm missing something in the documentation somewhere, but I've found<br>the officially suggested way to link an application to LLVM to be quite<br>brittle. I'm referring to the way listed here: <a href="https://llvm.org/docs/CMake.html">https://llvm.org/docs/CMake.html</a><br><br>If I use llvm_map_components_to_libnames with an LLVM that was built with<br>LLVM_LINK_LLVM_DYLIB set to true, and then try to link to both some LLVM <br>components and lldWasm, then my library will compile, but it will fail at<br>runtime since it is linked to both the shared LLVM library (via lldWasm)<br>and the static libraries I requested with the function. Linuxbrew builds<br>this way.<br><br>Furthermore, if only the shared library was built and packaged, then the<br>function will throw a fatal error. This broke our build on Gentoo.<br><br>For context, I work on the Halide CMake build and you can see the hoops we<br>have to jump through here:<br><br><a href="https://github.com/halide/Halide/blob/master/dependencies/llvm/CMakeLists.txt">https://github.com/halide/Halide/blob/master/dependencies/llvm/CMakeLists.txt</a><br><br>What is the correct way to link to LLVM, no matter the configuration?<br><br>Thanks,<br><br>Alex</div>