I am trying to compiler a .ll file which calls external function from a file named “MapUtil.cpp”. In MapUtil.cpp, when i refer header file “llvm/ADT/DenseMap.h” , it fails with the error :

/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x23
MapUtil.cpp.o:(.data+0x0): undefined reference to `llvm::EnableABIBreakingChecks'

There is no other reference to llvm from that file. My project is setup with MLIR Config and llvm headers.

How to correctly refer to llvm utilities?

This means that you have a mismatch between the prebuilt LLVM and your client in terms of whether assertions are enabled or not.
You need to match the two.

LLVM was built with LLVM_ENABLE_ASSERTIONS ON. So i should build my repo with this flag too, right? I am not sure if you meant this.


It depends if you’re repo is using LLVM CMake to configure its flags :slight_smile:

What matters is that -UNDEBUG is passed to the compiler (or at least no -DNDEBUG is passed to the compiler) when building your project. This is what this flag does when building in LLVM, but CMake has various ways of achieving it otherwise!

Got it.
there is mismatch in the prebuilt LLVM andmy client’s assertions.

Thank you so much