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

[CFP] Fuchsia Clang Toolchain #14

Open
petrhosek opened this issue Aug 3, 2021 · 4 comments
Open

[CFP] Fuchsia Clang Toolchain #14

petrhosek opened this issue Aug 3, 2021 · 4 comments

Comments

@petrhosek
Copy link
Contributor

Title

Fuchsia Clang Toolchain

Author

Petr Hosek, phosek@google.com, Google

Distribution

Fuchsia's Clang toolchain is used to build the Fuchsia platform, the Zircon kernel and host tools.

Abstract (optional)

The Fuchsia Clang toolchain is a complete C/C++ toolchain distribution that supports Fuchsia, Linux, macOS and Windows and includes a number of LLVM tools and runtime libraries.

It is used by Fuchsia to build the system that powers millions of devices, as well as other related projects such as Pigweed, Dart and Flutter.

In this talk, we will cover our toolchain distribution, how we build it, test it and distribute it to all our developers. We will also talk about our principles and discuss some of the challenges we face.

What's unique about the environment you package LLVM for? (optional)

We ship a complete, general purpose LLVM-based toolchain for C/C++. We use this toolchain to build an entire operating system that was developed from scratch and includes everything from bootloader, kernel, system libraries all the way up to user applications.

We currently support four host platforms:

  • Linux AArch64 and x86-64;
  • macOS x86-64;
  • Windows x86-64.

We currently support nine target platforms:

  • Fuchsia AArch64 and x86-64;
  • Linux x86, x86-64, ARM and AArch64;
  • macOS x86-64 and AArch64;
  • Windows x86-64.

Our goal is to provide the same experience on every supported platform and we achieve that by using LLVM tools and libraries making our toolchain completely self-contained.

What makes your distribution of LLVM unique? (optional)

We follow the "live at HEAD" model and stay close to the tip-of-tree. We release new toolchains on a weekly cadence and we adopt new features at a rapid pace.

We rely extensively on automation. We continuously build toolchains and use every newly produced toolchain to build and test the entire system. This automation is what makes it feasible to "live at HEAD" and roll so frequently.

Everything we use, including the CMake cache files, is upstream and we do not have any downstream changes so anyone should be able to reproduce our toolchain build.

What might others learn from your experience? (optional)

How to build an LLVM-based cross-compiling toolchain with a single CMake invocation.

What could be improved in upstream LLVM to make working with it easier as a downstream packager? (optional)

Support for cross-platform testing in lit which will be important for us to run tests on Fuchsia.

Automated way to report downstream test results since it is infeasible for us to cover every build configuration through upstream testing.

@mstorsjo
Copy link
Contributor

mstorsjo commented Sep 8, 2021

Hey, can I ask questions in advance here? :-)

We ship a complete, general purpose LLVM-based toolchain for C/C++.

Is it distributed publicly anywhere?

In particular, regarding this:

We currently support nine target platforms:

  • macOS x86-64 and AArch64;
  • Windows x86-64.

I presume these require you to get the not-freely-redistributable platform SDKs for these targets separately from the toolchain? Or is that handled by just distributing the toolchain in-house without redistribution license restrictions?

@nickdesaulniers
Copy link
Member

Thanks for taking the time to write up a CFP; we'd be overjoyed to have you present at LLVM Distributors Conf 2021! If you still plan on presenting, this is a reminder to get started on your slides for next week. Once they're done, we will contact you about submitting a PDF of your slides as either a pull request to this repository or via email to the organizer. We hope to have a schedule finalized by EOW; we may iterate on the schedule based on whether presenters have conflicts. Please keep this issue open for attendees to ask questions, or close this issue if you no longer plan on attending. Reminder to keep your talk concise (15 minutes); we wont be doing time for questions in order to fit as much content as possible. Attendees should ask questions here in this github issue.

The matrix of supported hosts + targets looks neat, we should do that for the Android talk in #9 .

@petrhosek
Copy link
Contributor Author

Hey, can I ask questions in advance here? :-)

@mstorsjo Sure!

We ship a complete, general purpose LLVM-based toolchain for C/C++.

Is it distributed publicly anywhere?

All of our Clang toolchain packages are publicly available. The integration ref points to the one we are currently using for Fuchsia.

In particular, regarding this:

We currently support nine target platforms:

  • macOS x86-64 and AArch64;
  • Windows x86-64.

I presume these require you to get the not-freely-redistributable platform SDKs for these targets separately from the toolchain? Or is that handled by just distributing the toolchain in-house without redistribution license restrictions?

We have a publicly available SDK for Linux (which is based on Debian), but for macOS and Windows you have to supply the platform SDK yourself.

@mstorsjo
Copy link
Contributor

We have a publicly available SDK for Linux (which is based on Debian), but for macOS and Windows you have to supply the platform SDK yourself.

Right, ok, thanks! It was exactly this last bit that I was curious to see if you had any figured out any creative solution for :-)

petrhosek added a commit to petrhosek/llvm-distributors-conf-2021 that referenced this issue Sep 17, 2021
Andarwinux added a commit to Andarwinux/xanmod-kernel-WSL2 that referenced this issue Nov 8, 2024
Andarwinux added a commit to Andarwinux/xanmod-kernel-WSL2 that referenced this issue Nov 8, 2024
Locietta pushed a commit to Locietta/xanmod-kernel-WSL2 that referenced this issue Nov 8, 2024
This is a fully tested nightly LLVM toolchain built by Google LUCI, "live at HEAD"

Introduction: ClangBuiltLinux/llvm-distributors-conf-2021#14
CI Status: https://luci-milo.appspot.com/ui/p/fuchsia/builders/luci.fuchsia.prod/clang-linux-x64
Repo: https://chrome-infra-packages.appspot.com/p/fuchsia/third_party/clang/linux-amd64

Co-authored-by: Andarwinux <Andarwinux@users.noreply.github.com>
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