You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: content/docs/guides/build.md
+16-7Lines changed: 16 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,23 +66,32 @@ For **MacOS**, you can install LLVM through [Homebrew](https://formulae.brew.sh/
66
66
brew install llvm@15
67
67
```
68
68
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.
make config VERSION=15 SRCDIR=/usr/include/llvm/ BUILDIR=/usr/bin/llvm/
75
-
go install
72
+
sudo dnf install llvm-devel lld-libs lld
76
73
```
77
74
78
75
After LLVM has been installed, installing TinyGo should be as easy as running the following command:
79
76
80
77
```shell
81
-
go install -tags=llvm14
78
+
go install
82
79
```
83
80
84
81
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.
85
82
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
+
86
95
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.
87
96
88
97
If you have gotten this far, please skip over to [Additional requirements](#additional-requirements) below to further set up TinyGo.
0 commit comments