We are trying to implement some disassembly support (decode instructions and provide information about them) through a DLL on windows and an SO on linux.
We managed to succeed on windows by building the llvm-c.dll and exporting a function that will return a class instance that supports the necessary API. This so far seems to work in Windows. However, trying to build LLVM-C as a shared object on linux fails on cmake with “Generating libLLVM-c is only supported on Darwin” - Seems like it is build-into the cmakes that you can’t build llvm-c as a shared object on Linux, and according to chatGPT this had been like that since Clang 11.
ChatGPT suggested to build the C++ libLLVM on linux instead, using the cmake flags:
However, when using those flags I get linker errors for missing symbols from our custom target libs. Without those flags, our custom targets build fine on linux, so it’s unclear where we might be missing something in the configuration. Even if we solve this, I’m not sure if that would actually include the required disassembler functionality that we currently got working correctly through LLVM-C.dll on Windows.
Any ideas/suggestions regarding how to handle this in the best way possible, or even any way that would work…