Ld.lld: error: undefined symbol: tvm::runtime::detail::LogFatal::GetEntry()

Hi, I encountered this error while trying to compile with internal logging.h:

Full error log:

Action graph will be rebuilt because files have been added or removed.
ld.lld: error: undefined symbol: tvm::runtime::detail::LogFatal::GetEntry()
>>> referenced by logging.h:349 (tvm/tvm08/tvm/include/tvm/runtime/logging.h:349)
>>>               buck-out/dev/gen/aab7ed39/tvm/tvm08/tvm_base#compile-pic-c_runtime_api.cc.obedf6452,platform010-clang/tvm/src/runtime/c_runtime_api.cc.o:(tvm::runtime::GetCustomTypeName[abi:cxx11](unsigned char))
>>> referenced by logging.h:345 (tvm/tvm08/tvm/include/tvm/runtime/logging.h:345)
>>>               buck-out/dev/gen/aab7ed39/tvm/tvm08/tvm_base#compile-pic-c_runtime_api.cc.obedf6452,platform010-clang/tvm/src/runtime/c_runtime_api.cc.o:(tvm::runtime::GetCustomTypeName[abi:cxx11](unsigned char))
>>> referenced by logging.h:345 (tvm/tvm08/tvm/include/tvm/runtime/logging.h:345)
>>>               buck-out/dev/gen/aab7ed39/tvm/tvm08/tvm_base#compile-pic-c_runtime_api.cc.obedf6452,platform010-clang/tvm/src/runtime/c_runtime_api.cc.o:(tvm::runtime::GetCustomTypeName[abi:cxx11](unsigned char))
>>> referenced 580 more times

ld.lld: error: undefined symbol: tvm::runtime::Backtrace[abi:cxx11]()
>>> referenced by logging.h:358 (tvm/tvm08/tvm/include/tvm/runtime/logging.h:358)
>>>               buck-out/dev/gen/aab7ed39/tvm/tvm08/tvm_base#compile-pic-c_runtime_api.cc.obedf6452,platform010-clang/tvm/src/runtime/c_runtime_api.cc.o:(tvm::runtime::detail::LogFatal::Entry::Finalize())
>>> referenced by c_runtime_api.cc:518 (tvm/tvm08/tvm/src/runtime/c_runtime_api.cc:518)
>>>               buck-out/dev/gen/aab7ed39/tvm/tvm08/tvm_base#compile-pic-c_runtime_api.cc.obedf6452,platform010-clang/tvm/src/runtime/c_runtime_api.cc.o:(tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<TVMFuncCreateFromCFunc::$_2> >::Call(tvm::runtime::PackedFuncObj const*, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*))
>>> referenced by c_runtime_api.cc:534 (tvm/tvm08/tvm/src/runtime/c_runtime_api.cc:534)
>>>               buck-out/dev/gen/aab7ed39/tvm/tvm08/tvm_base#compile-pic-c_runtime_api.cc.obedf6452,platform010-clang/tvm/src/runtime/c_runtime_api.cc.o:(tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<TVMFuncCreateFromCFunc::$_3> >::Call(tvm::runtime::PackedFuncObj const*, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*))
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)

I encoutered this error while trying to compile tvm and letting dmlc to use the internal logging:

DMLC_USE_LOGGING_LIBRARY=<tvm/runtime/logging.h>

It seems GetEntry and Backtrace are declared within the file https://github.com/apache/tvm/blob/main/include/tvm/runtime/logging.h, but I cannot find where it’s been implemented.

I wonder is there any workaround, thanks in advance!

They are both in src/runtime/logging.cc.