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

[build] make LK buildable with LLVM/Clang #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pcc
Copy link
Contributor

@pcc pcc commented Apr 1, 2022

Add an environment setting LLVM=1 that replaces usage of GNU tools
with the LLVM equivalents.

Current status is that it builds on arm64 for QEMU with several
warnings and then boots. I didn't hook up any other architectures but
the arm64 setup should serve as a guideline.

@travisg
Copy link
Member

travisg commented Apr 20, 2022

Oh I just saw this after mentioning that should add support for LLVM. Will give it a go to make sure it works on all the arches. Seems like it's just for arm64 at the moment?

@pcc
Copy link
Contributor Author

pcc commented Apr 20, 2022

Yes, I'd expect this to fail on the other arches because it would need some changes to the other arch-specific makefiles. I'm currently only set up to build for arm64 (e.g. only have arm64 baremetal builtins library to hand) so I didn't touch the other arches.

Add an environment setting LLVM=1 that replaces usage of GNU tools
with the LLVM equivalents.

Current status is that it builds on arm64 for QEMU with several
warnings and then boots. I didn't hook up any other architectures but
the arm64 setup should serve as a guideline.
@pcc
Copy link
Contributor Author

pcc commented Jul 21, 2022

Ping... it would be nice to land this so that I don't have to keep carrying it around when testing other patches (I don't have a compatible GCC installation on this machine).

@travisg
Copy link
Member

travisg commented Jul 22, 2022 via email

@travisg
Copy link
Member

travisg commented Jul 22, 2022

One thing that might help is to break this CL into two parts. One is just stuff needed to get clang to compile and the second one would be build system config stuff. The former is a slam dunk, the latter might need a bit of thinking.

@pcc
Copy link
Contributor Author

pcc commented Jul 22, 2022

Sure, I was thinking that because this doesn't regress the other arches (you can still compile them with GCC) that wouldn't be a blocker to landing it at this point. Also some of the arches don't have LLVM backends at this point (microblaze, or1k) so this is probably never going to be "complete" in terms of arch support.

Would it help to have some kind of explicit error if you try to build an unsupported arch with LLVM=1?

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.

2 participants