Skip to content

Commit 7de98e8

Browse files
soypatdeadprogram
authored andcommitted
clarify linux install from source instructions
1 parent bf7b94c commit 7de98e8

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

content/docs/guides/build.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,43 @@ You need to build LLVM manually in the following cases:
3535

3636
Using a system-installed version of LLVM depends on your system, of course.
3737

38-
For Debian or Ubuntu you can install LLVM by adding a new apt repository (please replace `buster` with the appropriate codename). For more information about this method, see [apt.llvm.org](https://apt.llvm.org/).
38+
For **Debian** or **Ubuntu** you can install LLVM by adding a new apt repository. For more information about this method, see [apt.llvm.org](https://apt.llvm.org/). *Before copying the command below, please replace `xxxxx` with your distribution's codename*.
39+
40+
| Distro | Version | Codename |
41+
|--------|------- |-----------|
42+
| Ubuntu | 18.04 | `bionic` |
43+
| Ubuntu | 20.04 | `focal` |
44+
| Ubuntu | 20.10 | `groovy` |
45+
| Ubuntu | 21.04 | `hirsute` |
46+
| Debian | 10 | `buster` |
47+
| Debian | 11 | `bullseye`|
48+
| Debian | sid | `unstable`|
3949

4050
```shell
41-
echo 'deb http://apt.llvm.org/buster/ llvm-toolchain-buster-11 main' | sudo tee /etc/apt/sources.list.d/llvm.list
51+
echo 'deb http://apt.llvm.org/xxxxx/ llvm-toolchain-xxxxx-11 main' | sudo tee /etc/apt/sources.list.d/llvm.list
52+
```
53+
54+
After adding the apt repository for your distribution you may install the LLVM toolchain packages:
55+
56+
```
4257
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
4358
sudo apt-get update
4459
sudo apt-get install clang-11 llvm-11-dev lld-11 libclang-11-dev
4560
```
4661

47-
For MacOS, you can install LLVM through [Homebrew](https://formulae.brew.sh/formula/llvm). The Clang/LLVM version from Apple is not supported by TinyGo.
62+
For **MacOS**, you can install LLVM through [Homebrew](https://formulae.brew.sh/formula/llvm). The Clang/LLVM version from Apple is not supported by TinyGo.
4863

4964
```shell
5065
brew install llvm@11
5166
```
5267

53-
After LLVM has been installed, installing TinyGo should be as easy as running the following command:
68+
After LLVM has been installed, installing TinyGo should be as easy as running the following command (cgo must be enabled so that the compile does not fail):
5469

5570
```shell
56-
go install
71+
CGO_ENABLED=1 go install
5772
```
5873

74+
5975
Note that you should not use `make` when you want to build using a system-installed LLVM, just use the Go toolchain. `make` is used when you want to use a self-built LLVM, as in the next section.
6076

6177
If you have gotten this far, please skip over to [Additional requirements](#additional-requirements) below to further set up TinyGo.

0 commit comments

Comments
 (0)