Link error when I compile the Toy(kaleidoscope) example

Hi All,

I check out the LLVM code and compile, install it by below commands:

mkdir build & cd build
cmake -G “Unix Makefiles” -DCMAKE_BUILD_TYPE=Release …/
make -j4
make install

Then I copy the source code from
And run the command as it showed:

undefined reference to `typeinfo for llvm::CmpInst'
clang-3.7: error: linker command failed with exit code 1 (use -v to see

Looks like an error from the toy being built with -frtti but LLVM with
-fno-rtti. Try this if you're not actually using the typeinfo:

$ clang++ -g -O3 toy.cpp `llvm-config --cxxflags --ldflags
--system-libs --libs core` -fno-rtti -o toy

I've never been quite sure why that flag isn't part of "llvm-config --cxxflags".