5

I want to set up a debugger for Visual Studio Code so I tried to build LLVM environment so as to have LLDB on my computer. But the build fails with following output:

CMake Warning at cmake/modules/GetHostTriple.cmake:28 (message):
  unable to determine host target triple
Call Stack (most recent call first):
  cmake/config-ix.cmake:401 (get_host_triple)
  CMakeLists.txt:670 (include)
 
 
CMake Error at cmake/config-ix.cmake:409 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  CMakeLists.txt:670 (include)
 
CMake Error at cmake/config-ix.cmake:453 (message):
  Unknown architecture host
Call Stack (most recent call first):
  CMakeLists.txt:670 (include)

I use clang v11.0.1, CMake v3.18.0-rc4, and Ninja v1.10.2.

2
  • Also seeing this error. Did you find a solution? Commented Mar 5, 2021 at 23:36
  • @Nate, unfortunately no Commented Mar 8, 2021 at 8:00

1 Answer 1

12

I had same problem and fixed by adding this line manually as build option:

-DLLVM_HOST_TRIPLE=x86_64
Sign up to request clarification or add additional context in comments.

6 Comments

Where did you add this?
@user162988 While building from source, you can add this flag like other options, for example: cmake -G "Visual Studio 16 2019" -Thost=x64 -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD=all -DLLVM_HOST_TRIPLE=x86_64 ../llvm So here, you can use Ninja after -G flag as generator like asked in the question and you can use also different -D flags to configure project anyway you like.
This can be done in your newly created build directory by command window and after that cmake --build . build the whole thing with your configurations. Please look at how to build llvm in detail because I just gave an example that I haven't tried at the moment, that's why many other errors can occur when you are building, so you may need to change or add some flags. So, the answer to your question is that I was added this flag to my cmake configurations like the example that I gave and the problem was solved for me at that time.
@Celuk How did you find this? Couldn't find it on the "Building LLVM with CMake" page.
This solution is basically mandatory for compiling llvm-project on Windows
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.