Skip to content

Commit e2ddd0c

Browse files
author
2b57
committed
update readme
1 parent a8c90b2 commit e2ddd0c

File tree

1 file changed

+36
-24
lines changed

1 file changed

+36
-24
lines changed

README.md

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,61 @@
11
# Clang/LLVM as a main toolchain for Gentoo Linux!
2-
3-
This is Gentoo Linux overlay experiment allowing to have your stage3 completely _gccfree_. In the future, fully usable stage3 files will be provided. As of now, you can either try to assemble stage yourself, by using provided script, or add profile to your system and rebuild world.
4-
52
### WARNING: Alpha quality!
63

7-
## Technote
8-
Since this is not official and tweaked base profile is required (as well as other ARCH-native parent ones), `assets/stage-builder.sh` script
9-
creates portage overlay via OverlayFS, which combines mainline Gentoo one with the content of `assets/baserepo_overlay` folder. Modifications made there are purely cosmetic thus patch against upstream would be minimal.
10-
11-
## Concept
12-
GCC and binutils are deeply ingrained in the system, so two virtuals were created: `virtual/toolchain`, which can be either `gcc` or `clang`, and `virtual/binutils`, which can be `binutils` or `llvm`, respectively. Proposed profiles will take care of required USE flags and make required virtual resolutions by masking GCC/binutils.
4+
This is Gentoo Linux overlay experiment allowing to have your stage3 completely _GCC-free_. You can either grab a release and process with installation as per Gentoo Handbook, or try to switch your current system profile and rebuild world.
135

14-
## Building stage3 by hand
6+
# Available profiles
7+
### amd64
8+
- `clang` based on `default/linux/amd64/17.1`;
9+
- `clang/lto` same, but with LTO;
10+
- `clang/musl` based on `default/linux/amd64/17.0/musl`;
11+
- `clang/musl/lto` same, but with LTO.
1512

16-
As of now, there are profiles for `amd64` only. Once PoC will be done, other archs will be added.
17-
18-
1. Add this overlay to your system as per wiki:
13+
### NOTE
14+
`bootstrap` profile is used by catalyst only and shouldn't be selected.
1915

16+
# HOWTO
17+
## Add this overlay
2018
```
2119
eselect repository add toolchain-clang git https://github.com/2b57/toolchain-clang.git
2220
emaint sync -r toolchain-clang
2321
```
2422

25-
2. Pick a profile (but don't `eselect` it). There are 3 main profiles available:
23+
## How to use it
24+
This is your default stage3 + `git` + `eselect-repository` packages for overlay management. You'll get warnings that your profile symlink is invalid, so after chrooting inside be sure to add this overlay (see above) and select right profile:
25+
```
26+
# eselect profile list | grep toolchain-clang:linux/amd64/clang/musl
27+
[43] toolchain-clang:linux/amd64/clang/musl (exp)
28+
[44] toolchain-clang:linux/amd64/clang/musl/lto (exp)
29+
# eselect profile set --force 43
30+
# eselect profile list | grep toolchain-clang:linux/amd64/clang/musl
31+
[43] toolchain-clang:linux/amd64/clang/musl (exp) *
32+
[44]
33+
```
2634

27-
- `clang` – based on `default/linux/amd64/17.1`;
28-
- `clang/lto` – same, but with LTO;
29-
- `clang/musl` – based on `default/linux/amd64/17.0/musl`;
30-
- `clang/musl/lto` – same, but with LTO.
35+
# I want to build stage3 myself
36+
## Overview
37+
Apart from custom spec files, some modifications to `scripts/bootstrap.sh` are required. In order to execute right file, provided build script creates OverlayFS mount which will be used as Gentoo Portage tree for catalyst; contents of `/var/db/repos/gentoo` (main tree) is combined with `assets/baserepo_overlay` folder. Catalyst envscripts (`catalystrc`) are created as needed during the process.
3138

32-
`bootstrap` profile is used for building `stage1` and should not be explicitly chosen.
39+
### bootstrap profile
40+
`bootstrap` profile is used for building `stage1` with GCC if there are no seed `clang` stages available and should not be explicitly chosen. In this case, catalyst build order is `bootstrap-stage1` -> `clang-stage2` -> `clang-stage3`. If `clang` seed stage is present, you'll need to edit spec files accordingly.
3341

34-
**NOTE:** if you're using anything `musl`-related, you'll need to clone RelEng repo as well, since `musl` stages require some of the tweaks from there:
42+
### musl
43+
If you want to go with anything `musl`-related, you'll need to clone RelEng repo as well, since `musl` stages require some of the tweaks from there:
3544
```
3645
cd /var/db/repos/toolchain-clang
3746
git clone https://github.com/gentoo/releng.git
3847
```
3948

40-
3. Run `stage-builder.sh` script against corresponding `spec` file:
49+
50+
## Building
51+
- Add this overlay to your system (see above)
52+
- Install deps: `catalyst` and `pixz`
53+
- Pick a profile, but don't `eselect` it
54+
- Run `stage-builder.sh` script against corresponding `spec` file:
4155

4256
```
4357
cd /var/db/repos/toolchain-clang
4458
./assets/scripts/stage-builder.sh specs/clang/musl/stage1.spec
4559
./assets/scripts/stage-builder.sh specs/clang/musl/stage2.spec
4660
./assets/scripts/stage-builder.sh specs/clang/musl/stage3.spec
47-
```
48-
49-
3. Cross fingers...
61+
```

0 commit comments

Comments
 (0)