Skip to content

[CFP] Fuchsia Clang Toolchain #14

Open
@petrhosek

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions