Issue 87168
Summary Duplicate symbol: public: __cdecl llvm::PredicateInfo::~PredicateInfo(void)
Labels new issue
Assignees
Reporter Stanlyhalo
    **Problem**
When attempting to build a project that calls `llvm::InitializeAllTargets()` using the latest llvm repo changes (as of commit 6aa5388), it throws two compiler errors as denoted in the title.

**Steps to reproduce**
1) `git clone --depth 1 --config core.autocrlf=false https://github.com/llvm/llvm-project.git`
2) `cmake -S llvm -B build -G "Visual Studio 17 2022" -DLLVM_ENABLE_PROJECTS="lld" -DLLVM_BUILD_LLVM_DYLIB=OFF -DLLVM_LINK_LLVM_DYLIB=OFF -DCMAKE_BUILD_TYPE=Debug`
3) `cmake --build build` (this is the long part)
4) Start a new project and add the includes, links, and add defines for llvm (I use premake, however I'm following the output of the following messages from a cmake test project)
```
message(WARNING "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(WARNING "${LLVM_INCLUDE_DIRS}\n")
message(WARNING "${LLVM_LIBRARY_DIRS}\n")
message(WARNING "${LLVM_DEFINITIONS}\n")
message(WARNING "${LLVM_AVAILABLE_LIBS}\n")
```
5) Now that a project is setup, write a simple IR builder (anything will do, it's the next part(s) that matter).
6) Follow the guide at https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.html.
7) Upon attempting to compile (tested in clang vs22) while trying to call `llvm::InitializeAllTargets()` in the code, it will throw two errors that state what the error is in the title.

**Notes**
- Commenting out the function will allow it to compile, however I run into a runtime error since TargetMachine will get returned as a nullptr (which I presume is because I haven't initialized the targets).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to