I am following this guide, and when running make, this error appears:
Using /usr/bin/llvm-config-6.0 [version=6.0.0]
CRYSTAL_CONFIG_PATH="/usr/share/crystal/crystal-master/src" CRYSTAL_CONFIG_LIBRARY_PATH="/usr/bin/../lib/crystal/lib" CRYSTAL_CONFIG_BUILD_COMMIT="" ./bin/crystal build -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
L-L-V-M-5858P-assR-egistry.o: In function `initialize_inst_combine':
/usr/share/crystal/crystal-master/src/llvm/pass_registry.cr:11: undefined reference to `LLVMInitializeInstCombine'
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/usr/share/crystal/crystal-master/.build/crystal' -rdynamic /usr/share/crystal/crystal-master/src/llvm/ext/llvm_ext.o `/usr/bin/llvm-config-6.0 --libs --system-libs --ldflags 2> /dev/null` -lstdc++ -lpcre -lm /usr/bin/../lib/crystal/lib/libgc.a -lpthread /usr/share/crystal/crystal-master/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/bin/../lib/crystal/lib -L/usr/lib -L/usr/local/lib`
Makefile:131: recipe for target '.build/crystal' failed
make: *** [.build/crystal] Error 1
I also tried @ysbaddaden's fix here https://github.com/crystal-lang/crystal/issues/5556#issuecomment-355981440 but with no luck.
I tried make clean std_spec from this comment https://github.com/crystal-lang/crystal/pull/6306#issuecomment-401945300, and these errors appear:
https://paste.sh/A-i3yG90#IZ4eQ5MXcrCn0Kobe6jL4S5j
What have I done? ;D
Removing inst_combine from src/llvm/pass_registry.cr seems to fix this issue.
Problem is, I think unlinking LLVMInitializeInstCombine is a breaking-change.
Crystal compiled successfully and everything seems normal. I'm going to continue to do testing
This is a bug in Llvm 6.0.0, please use a newer LLVM version. 6.0.1 works fine.
For followers on Ubuntu 18.04 like me, fix was apt remove llvm-dev and apt install llvm-7-dev since its latest version of llvm-dev was 6.0.0 (sigh). And run make clean then make :)
Most helpful comment
This is a bug in Llvm 6.0.0, please use a newer LLVM version. 6.0.1 works fine.