ClangBuiltLinux/llvm-distributors-conf-2021

[CFP] Fuchsia Clang Toolchain

petrhosek opened this issue · 4 comments

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.

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?

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 .

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.

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 :-)