LLVM/Clang/Desktop profile

From Gentoo Wiki
< LLVM‎ | Clang
Jump to:navigation Jump to:search

Some users may wish to use LLVM as a desktop system. No official profiles for these exist (see bug #913225), however it is still possible to create them locally using the following steps.

The custom LLVM profile described below, which is not the same as just using Clang and friends, is experimental. A 'GCC fallback' cannot be used as-is (though it is possible to use it with -stdlib=libc++ added in that case).

Create a local repository

A local repository is needed for the custom profile to be created.

First, install app-eselect/eselect-repository:

root #emerge --ask app-eselect/eselect-repository

Create a local repository:

root #eselect repository create local

Set up the repository layout

It's recommended to make use of a Portage extension for the repository as it simplifies configuration:

FILE /var/db/repos/local/metadata/layout.conf
masters = gentoo
thin-manifests = true

# Needed for profiles parent with repo syntax
profile-formats = portage-2

Create the profile

profiles.desc

profiles.desc provides a list of profiles for eselect profile list to consume:

FILE /var/db/repos/local/profiles/profiles.desc
# Adjust the list below as needed, no need to make them all
amd64 llvm-desktop exp
amd64 llvm-plasma-systemd exp
amd64 llvm-plasma-split-usr exp

The profile itself

Create the following directories (adjust as needed):

  • /var/db/repos/local/profiles/llvm-desktop
  • /var/db/repos/local/profiles/llvm-plasma-systemd
  • /var/db/repos/local/profiles/llvm-plasma-split-usr

Use the following command:

root #mkdir -p /var/db/repos/local/profiles/llvm-desktop

llvm-desktop

Create the following files:

FILE /var/db/repos/local/profiles/llvm-desktop/eapi
8
FILE /var/db/repos/local/profiles/llvm-desktop/parent
gentoo:default/linux/amd64/23.0/llvm
gentoo:targets/desktop

llvm-plasma-systemd

Create the following files:

FILE /var/db/repos/local/profiles/llvm-plasma-systemd/eapi
8
FILE /var/db/repos/local/profiles/llvm-plasma-systemd/parent
gentoo:default/linux/amd64/23.0/llvm
gentoo:targets/desktop/plasma
gentoo:targets/systemd

llvm-plasma-split-usr

Create the following files:

FILE /var/db/repos/local/profiles/llvm-plasma-split-usr/eapi
8
FILE /var/db/repos/local/profiles/llbm-plasma-split-usr/parent
gentoo:default/linux/amd64/23.0/llvm
gentoo:features/split-usr
gentoo:targets/desktop/plasma


Selecting the profile

The new profiles should now appear in eselect profile list. Enjoy!

TODO

Add more profiles