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

Building Dex on Fedora 36 (clang++-14) #1059

Open
darrenjw opened this issue Sep 10, 2022 · 4 comments
Open

Building Dex on Fedora 36 (clang++-14) #1059

darrenjw opened this issue Sep 10, 2022 · 4 comments

Comments

@darrenjw
Copy link
Contributor

Fedora 36 contains a package which provides clang++-14, but no longer includes one that provides clang++-12. Is it easy/possible to build Dex on Fedora, or more generally, with clang++-14?

@apaszke
Copy link
Collaborator

apaszke commented Sep 12, 2022

clang++-14 might work, but it's likely it won't. The main reason for this is that we use clang to generate some LLVM IR that we later read in the compiler. If the clang version is newer than whatever LLVM you used to build Dex (pretty much always 12), then it might fail if the IR has been extended since then.

I actually have a branch where I'm adding support for LLVM 15. It's freshly released, so it might take a few weeks before packages appear in most popular repositories, but it should give you the cutting edge support (in that case you might even be able to use clang++-14, not just clang++-15).

@darrenjw
Copy link
Contributor Author

Thanks. I tried hacking the makefile to allow building with clang++-14. It did build an executable, but it crashed at runtime.
In the end I built clang-12 from the official release sources. This was simpler than I expected, but very slow. That works fine, but it's good to know that newer clang support is on the way.

@apaszke
Copy link
Collaborator

apaszke commented Sep 12, 2022

Yes, I would expect it to crash at runtime. The only rule that depends on the clang version is the one for src/lib/dexrt.bc. You might even be able to copy that file from another computer where you do have an older clang version, but that might be an overkill given that you've already built clang form source 😅

@codereport
Copy link

Just adding to this. I tried building/installing dex with clang++-14 (by modifying the makefile) as well as I am on Ubuntu 22.04 which doesn't come with clang++-12 either and it failed when building the llvm-hs-12.0.0 package. Will just download the old clang++-12 but I would +1 enabling newer clang versions. Clang 16 is newest as of this posting.

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