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

Compiler fails to build using llvm 3.9 #3663

Closed
bew opened this issue Dec 10, 2016 · 3 comments
Closed

Compiler fails to build using llvm 3.9 #3663

bew opened this issue Dec 10, 2016 · 3 comments

Comments

@bew
Copy link
Contributor

bew commented Dec 10, 2016

On crystal current master (8295d8c), using llvm 3.9 on up-to-date archlinux :

% sudo pacman -Q llvm llvm-libs
llvm 3.9.0-3
llvm-libs 3.9.0-3

% llvm-config --libs
-lLLVM-3.9

% llvm-config --ldflags
-L/usr/lib 

I get the following errors :

% make
Using /usr/bin/llvm-config [version=3.9.0]
CRYSTAL_CONFIG_PATH=`pwd`/src ./bin/crystal build  -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
/home/lesell_b/Projects/opensource/crystal/src/llvm/ext/llvm_ext.o: In function `LLVMDIBuilderCreateCompileUnit':
llvm_ext.cc:(.text.LLVMDIBuilderCreateCompileUnit+0xa6): undefined reference to `llvm::DIBuilder::createCompileUnit(unsigned int, llvm::StringRef, llvm::StringRef, llvm::StringRef, bool, llvm::StringRef, unsigned int, llvm::StringRef, llvm::DIBuilder::DebugEmissionKind, unsigned long, bool)'
/home/lesell_b/Projects/opensource/crystal/src/llvm/ext/llvm_ext.o: In function `LLVMDIBuilderCreateSubroutineType':
llvm_ext.cc:(.text.LLVMDIBuilderCreateSubroutineType+0xa): undefined reference to `llvm::DIBuilder::createSubroutineType(llvm::DITypeRefArray, unsigned int)'
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc -o "/home/lesell_b/Projects/opensource/crystal/.build/crystal" "${@}"  -rdynamic  /home/lesell_b/Projects/opensource/crystal/src/llvm/ext/llvm_ext.o `/usr/bin/llvm-config --libs --system-libs --ldflags 2> /dev/null` -lstdc++ -lpcre -lm -lgc -lpthread /home/lesell_b/Projects/opensource/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`
make: *** [Makefile:85: .build/crystal] Error 1

The crystal compiler version is :

% ./bin/crystal version
Crystal 0.20.1 (2016-12-06)

@ysbaddaden any idea on that ?

@bew bew changed the title Compiler compilation : errors using llvm 3.9 Compiler fails to build using llvm 3.9 Dec 10, 2016
@ysbaddaden
Copy link
Contributor

Maybe make clean crystal ?

@bew
Copy link
Contributor Author

bew commented Dec 10, 2016

Oh no I feel so stupid now :(

Thanks, didn't knew there were a C/C++ step before the crystal compilation

@bew bew closed this as completed Dec 10, 2016
@ysbaddaden
Copy link
Contributor

Sadly, LLVM doesn't offer an official C API for DIBuilder which allows to add debug information, so we had to implement it in C (and have to fix it for each LLVM release) 😭

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

2 participants