Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `LLVMInitializeInstCombine' #8254

Closed
girng opened this issue Oct 1, 2019 · 3 comments
Closed

undefined reference to `LLVMInitializeInstCombine' #8254

girng opened this issue Oct 1, 2019 · 3 comments

Comments

@girng
Copy link
Contributor

girng commented Oct 1, 2019

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 #5556 (comment) but with no luck.

I tried make clean std_spec from this comment #6306 (comment), and these errors appear:
https://paste.sh/A-i3yG90#IZ4eQ5MXcrCn0Kobe6jL4S5j

What have I done? ;D

@girng
Copy link
Contributor Author

girng commented Oct 1, 2019

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

@asterite
Copy link
Member

asterite commented Oct 1, 2019

This is a bug in Llvm 6.0.0, please use a newer LLVM version. 6.0.1 works fine.

@asterite asterite closed this as completed Oct 1, 2019
@rdp
Copy link
Contributor

rdp commented Dec 13, 2019

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants