Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix error locating llvm-ar during build on Linux #35

Merged
merged 1 commit into from
Feb 3, 2015
Merged

Fix error locating llvm-ar during build on Linux #35

merged 1 commit into from
Feb 3, 2015

Conversation

ddevault
Copy link

@ddevault ddevault commented Feb 3, 2015

This explicitly sets the ar to llvm-ar when running cmake. Prior to this
commit, CMake was told that the prefix for all tools is "llvm-", but
this did not affect ar. Explicitly setting CMAKE_AR to "llvm-ar" is a
bit of a workaround considering the rest of the tools are set
automatically, but I cannot think of any negative side effects of doing
so.

This fixes #33.

@ddevault
Copy link
Author

ddevault commented Feb 3, 2015

A note: _CMAKE_TOOLCHAIN_PREFIX is an undocumented internal variable that CMake uses. It may be a better choice to simply explicitly declare the entire toolchain.

@janvorli
Copy link
Member

janvorli commented Feb 3, 2015

"which llvm-ar" doesn't show anything on my Ubuntu 14.04 with LLVM 3.5 installed. There is no llvm-ar on the system, just llvm-ar-3.5.
I've tried your change and it breaks the build on my Ubuntu due to this.

@ddevault
Copy link
Author

ddevault commented Feb 3, 2015

Hmm, it's odd that your llvm-ar executable would be named that. That sounds like a packaging error. Let me see if I can determine a consistent way to locate that file. Are the rest of your llvm tools (i.e. llvm-as, llvm-link, etc) postfixed with a version number?

@ddevault
Copy link
Author

ddevault commented Feb 3, 2015

Looks like they're packaged without the postfix: http://packages.ubuntu.com/trusty/amd64/llvm/filelist

This is pretty weird.

@janvorli
Copy link
Member

janvorli commented Feb 3, 2015

Yes, all of them have the suffix except of the llvm-clang. The package we install on Linux is called llvm-3.5

@ddevault
Copy link
Author

ddevault commented Feb 3, 2015

Thanks for clarifying. That package is a pretty non-standard install of llvm, so some thought will have to be put into how to support it. I'm spinning up an Ubuntu VM now to see what I can do.

@janvorli
Copy link
Member

janvorli commented Feb 3, 2015

So the package that you have installed is called just llvm? That one on Ubuntu contains an old version (3.4.0-ubuntu1).

@ddevault
Copy link
Author

ddevault commented Feb 3, 2015

I'm testing it on Arch Linux, which uses llvm 3.5 in the llvm package. The typical llvm install does not include a postfix.

This manually locates the llvm toolchain and sets the relevant cmake
variables. The _CMAKE_TOOLCHAIN_PREFIX variable is internal and
undocumented and should probably be avoided.
@ddevault
Copy link
Author

ddevault commented Feb 3, 2015

@janvorli I have just force pushed an alternative fix. Would you be so kind as to test it under Ubuntu for me?

@ddevault
Copy link
Author

ddevault commented Feb 3, 2015

Build server seems to have gotten through the cmake configuration part of this ordeal, so presumably this is good to go.

@janvorli
Copy link
Member

janvorli commented Feb 3, 2015

It works fine on my Ubuntu and the change looks good to me. Thank you very much for fixing the issue!

@ddevault
Copy link
Author

ddevault commented Feb 3, 2015

Happy to help 😄

@janvorli
Copy link
Member

janvorli commented Feb 3, 2015

@sergeyk @jkotas Could you please take a look as well?

@jkotas
Copy link
Member

jkotas commented Feb 3, 2015

LGTM

janvorli added a commit that referenced this pull request Feb 3, 2015
Fix error locating llvm-ar during build on Linux
@janvorli janvorli merged commit 58ef03f into dotnet:master Feb 3, 2015
@ddevault ddevault deleted the fix-linux-build branch February 3, 2015 23:19
BruceForstall pushed a commit to BruceForstall/coreclr that referenced this pull request Aug 16, 2016
Need to lower PHI stores to smash their TYP_SIMD12 types
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't built on Ubuntu 14.04
3 participants