Compiling kaleidoscope tutorial code fails with clang++ -g -O3 toy.cpp $(llvm-config --cxxflags) -std=c++17
(as the example goes) and outputs the following error:
Undefined symbols for architecture x86_64:
"llvm::DisableABIBreakingChecks", referenced from:
llvm::VerifyDisableABIBreakingChecks in toy-e1a114.o
ld: symbol(s) not found for architecture x86_64
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
LLVM were installed with brew install llvm
(version 10 when this question is posted), later changed to brew install llvm@8
.
Interesting thing is, removing header llvm/ADT/STLExtras.h
actually solves this. But I'm afraid removing this will not be a general solution.