Skip to content

[CFP] Building LLVM at rev.ng: a report #6

@aleclearmind

Description

@aleclearmind

Title

Building LLVM at rev.ng: a report

Authors

Alessandro Di Federico ([email protected]), rev.ng
Filippo Cremonese ([email protected]), rev.ng

Distribution

We build and distribute LLVM both for development purposes (sort of an SDK) and as a library for our application.

Abstract

At rev.ng we're building a LLVM-based decompiler with Qt UI.
Our development environment is Linux-only.

We build and distribute LLVM as:

  1. a Linux toolchain for the whole project, using libc++;
  2. a Windows (and soon macOS) cross-toolchain for the whole project, using libc++;
  3. a library used by our application (the decompiler);

Our own package manager, orchestra, produces binaries that can be used by end-users and developers.
Thanks to RPATH magic, all of our binaries are portable (run them from your $HOME) and do not require root to be installed.
Also, since we build and link against an ancient glibc, the binaries can run on distributions as old as Debian 7, despite being built on modern systems.
We build LLVM in debug -O0, debug -O2, debug + ASan and release.

We'd like to report (and hopefully get feedback) on issues we regularly face when building LLVM:

  1. issues building clang and libc++/libc++abi for Windows;
  2. issues arising when a release build of an application uses a debug build of LLVM (or an ASan build);
  3. constraints in the version of LLVM we want/have to use as a library (for the decompiler, for building mesa...) and the desire to use the most recent version of clang as a toolchain;
  4. dealing with failures in LLVM tests due to our particular set up (building as "root", building as C++20...);
  5. struggles in passing the right flags to the compiler when dealing with custom/ancient build systems;
  6. discussion on having a set of well-defined, documented and CI-tested build configurations that are supported/known to work;

What makes your distribution of LLVM unique?

  • We produce Linux binaries compatible with ancient glibc (i.e., Linux distros)
  • We cross-compile for Windows from Linux
  • We build portable installations of LLVM
  • We support mixing different build modes across different projects (debug LLVM and a non-debug application using it)

What might others learn from your experience?

Struggles and workarounds in building (and cross-building) recent and ancient packages using an clang/libc++ based toolchain.

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

  • Have a set of build configurations well-document, supported and CI-tested by upstream
  • Make cross-compiling libc++ easier

Metadata

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