Skip to content

Commit 22c482e

Browse files
aykevldeadprogram
authored andcommitted
guides/build: fix Fedora instructions
The instructions for Fedora were almost certainly not correct. I'm not sure what kind of error it was trying to fix, but it was probably misguided. I have removed these instructions and added more detail on the `-tags=llvm14` build tag. I didn't test this on Fedora as I'm not on Linux and thus testing Fedora is a bit difficult.
1 parent 2b16f8f commit 22c482e

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

content/docs/guides/build.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,32 @@ For **MacOS**, you can install LLVM through [Homebrew](https://formulae.brew.sh/
6666
brew install llvm@15
6767
```
6868

69-
For **Fedora** users you configure the go-llvm module before installing the remaining dependencies
69+
For **Fedora** users you can install LLVM from the repository. Note that the version of LLVM [varies by Fedora version](https://packages.fedoraproject.org/pkgs/llvm/llvm-libs/), for example Fedora 37 has LLVM 15.
70+
7071
```shell
71-
sudo dnf install llvm-devel golang-tinygo-x-llvm-devel lld-libs lld
72-
git clone https://github.com/tinygo-org/go-llvm.git
73-
cd go-llvm
74-
make config VERSION=15 SRCDIR=/usr/include/llvm/ BUILDIR=/usr/bin/llvm/
75-
go install
72+
sudo dnf install llvm-devel lld-libs lld
7673
```
7774

7875
After LLVM has been installed, installing TinyGo should be as easy as running the following command:
7976

8077
```shell
81-
go install -tags=llvm14
78+
go install
8279
```
8380

8481
If you are getting an `gcc` or `g++ not found` error you most likely do not have a working C++ build environment. You'll need the `build-essential` package on Debian or `sudo dnf install make automake gcc gcc-c++` for Fedora based systems.
8582

83+
If you are getting a build error like this, LLVM is not installed as expected:
84+
85+
```
86+
# tinygo.org/x/go-llvm
87+
../../../go/pkg/mod/tinygo.org/x/go-llvm@v0.0.0-20221028183034-8341240c0b32/analysis.go:16:10: fatal error: 'llvm-c/Analysis.h' file not found
88+
#include "llvm-c/Analysis.h" // If you are getting an error here you need to build or install LLVM, see https://tinygo.org/docs/guides/build/
89+
^~~~~~~~~~~~~~~~~~~
90+
1 error generated.
91+
```
92+
93+
This can often be fixed by specifying the LLVM version as a build tag, for example `-tags=llvm14` if you have LLVM 14 instead of LLVM 15.
94+
8695
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.
8796

8897
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)