Errors while building LLVM for CIRCT

I am trying to build CIRCT. Steps that I taken are same as of documentation-

git clone git@github.com:circt/circt.git
cd circt
git submodule init
git submodule update
cd circt
mkdir llvm/build
cd llvm/build
cmake -G Ninja …/llvm
-DLLVM_ENABLE_PROJECTS=“mlir”
-DLLVM_TARGETS_TO_BUILD=“X86;RISCV”
-DLLVM_ENABLE_ASSERTIONS=ON
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++ \
-DLLVM_ENABLE_LLD=ON
ninja

But many similar error messages appears-

`ld.lld: error: undefined symbol: llvm::BitstreamCursor::skipRecord(unsigned int)

referenced by BitcodeReader.cpp
BitcodeReader.cpp.o:(llvm::getBitcodeFileContents(llvm::MemoryBufferRef)) in archive lib/libLLVMBitReader.a
referenced by BitcodeReader.cpp
BitcodeReader.cpp.o:(llvm::getBitcodeTargetTripleabi:cxx11) in archive lib/libLLVMBitReader.a
referenced by MetadataLoader.cpp
MetadataLoader.cpp.o:(llvm::MetadataLoader::MetadataLoaderImpl::lazyLoadModuleMetadataBlock()) in archive lib/libLLVMBitReader.a
referenced 1 more times

ld.lld: error: undefined symbol: llvm::BitstreamCursor::ReadAbbrevRecord()

referenced by BitcodeReader.cpp
BitcodeReader.cpp.o:(llvm::BitstreamCursor::advance(unsigned int)) in archive lib/libLLVMBitReader.a

ld.lld: error: undefined symbol: llvm::BitstreamCursor::EnterSubBlock(unsigned int, unsigned int*)

referenced by BitcodeReader.cpp
BitcodeReader.cpp.o:(readBlobInRecord(llvm::BitstreamCursor&, unsigned int, unsigned int)) in archive lib/libLLVMBitReader.a
referenced by BitcodeReader.cpp
BitcodeReader.cpp.o:(readIdentificationBlockabi:cxx11) in archive lib/libLLVMBitReader.a
referenced by BitcodeReader.cpp
BitcodeReader.cpp.o:(llvm::getBitcodeTargetTripleabi:cxx11) in archive lib/libLLVMBitReader.a
referenced 14 more times
`

CMakeError.log
CMakeOutput.log

Is there something wrong from my side?

I just updating the llvm submodule in CIRCT, so you might try again. If it still fails, this is probably more of a question for the MLIR category as it looks like you are having trouble getting MLIR to compile. One difference I’ll note is that our README.md doesn’t mention LLD anywhere, so that could be a problem.

Thanks, john for replying.
I change the directory and start from scratch with new git clone. This time use gcc, g++and ld linker.
but still, have errors in linking now related to libLLVMX86CodeGen.a, libLLVMSelectionDAG.a, libLLVMipo.a etc.

OK, I will create a new topic in the LLVM category if someone knows about them.