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

compilation fails #19

Closed
kostya opened this issue Jun 11, 2013 · 3 comments
Closed

compilation fails #19

kostya opened this issue Jun 11, 2013 · 3 comments

Comments

@kostya
Copy link
Contributor

kostya commented Jun 11, 2013

./bin/crystal 1.cr

llc: <stdin>: Invalid MODULE_CODE_GLOBALVAR record
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

./bin/crystal 1.cr -run
this is works.

@asterite
Copy link
Member

Oro!

Welcome to Crystal!

Did you try googling "llc: : Invalid MODULE_CODE_GLOBALVAR record"? I found a bunch of results saying that you probably have many LLVM versions installed so two llvm command are executed with different versions (crystal uses first llc, then clang). So the problem is not related to crystal.

What's the output of the following commands?

llc -version
clang --version

Anyway, make sure that on the command line when you execute any llvm executable they are using version 3.1.

@kostya
Copy link
Contributor Author

kostya commented Jun 11, 2013

llc -version

Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.9 (Ubuntu 2.9+dfsg-3ubuntu4)
...

clang --version

Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

i ll try to switch 3.1 in ubuntu

@asterite
Copy link
Member

So, 2.9 vs 3.0. Make sure both versions give you 3.1. I don't know how to do it in Ubuntu... (I'm on a Mac right now)

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