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

Use the OpenBSD version of LLVM when cross-compiling for it #3823

Closed
wants to merge 1 commit into from

Conversation

wmoxam
Copy link
Contributor

@wmoxam wmoxam commented Jan 2, 2017

When cross compiling an object file from an OS that has a newer version of LLVM install, we need to use the version of LLVM supported on the cross-compile target.

@bcardiff
Copy link
Member

bcardiff commented Jan 2, 2017

The file changes would apply only in a punctual configuration of environment and do not support the whole statement in the description.

LLVM is unable to emit code for an older LLVM.

When cross compiling both llvm should match or at least the target must be newer.

I don't know about OpenBSD, but binding llvm-3.8 with openbsd can't be right. You can build sources and use other llvm version.

Feel free to ask for support for some issue you might be experiencing. Meanwhile I will close this.

@bcardiff bcardiff closed this Jan 2, 2017
@ysbaddaden
Copy link
Contributor

Please specify the LLVM_CONFIG environment variable on the host target to specify which LLVM to use. For example:

LLVM_CONFIG=/opt/llvm3.8/bin/llvm-config \
  bin/crystal build src/compiler/crystal.cr \
  -o crystal -Dwithout_zlib -Dwithout_openssl

@ysbaddaden
Copy link
Contributor

I use this a lot to test against different LLVM versions locally.

@wmoxam
Copy link
Contributor Author

wmoxam commented Jan 3, 2017

Hrmm, ok.

This did resolve my cross-compiling issues which were due to linking problems since LLVMCreateTargetDataLayout isn't defined in v 3.8

I'll try specifying LLVM_CONFIG as @ysbaddaden suggests

@wmoxam
Copy link
Contributor Author

wmoxam commented Jan 3, 2017

I don't actually need v3.8 installed for this to work, I just need the compatible methods specified so I can cross-compile an object file that can be used on the OpenBSD side.

I'm building via these instructions: https://gist.github.com/wmoxam/d06f9ccc82e03f6fea64747d82caa421

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

Successfully merging this pull request may close these issues.

None yet

3 participants