Skip to content

Commit ac04e2b

Browse files
committed
[devdocs] Improve documentation about building external forks of LLVM
1 parent 9501540 commit ac04e2b

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

Make.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ USE_MLIR := 0
357357
# Options to use RegionVectorizer
358358
USE_RV := 0
359359

360+
# Use `ccache` for speeding up recompilation of the C/C++ part of Julia.
361+
# Requires the `ccache` executable to be in the `PATH` environment variable.
362+
USECCACHE := 0
363+
360364
# Cross-compile
361365
#XC_HOST := i686-w64-mingw32
362366
#XC_HOST := x86_64-w64-mingw32

doc/src/devdocs/build/build.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ To run julia from anywhere you can:
6060

6161
- write `prefix=/path/to/install/folder` into `Make.user` and then run `make install`. If there is a version of Julia already installed in this folder, you should delete it before running `make install`.
6262

63+
Some of the options you can set to control the build of Julia are listed and documented at the beginning of the file `Make.inc`, but you should never edit it for this purpose, use `Make.user` instead.
64+
6365
Now you should be able to run Julia like this:
6466

6567
julia
@@ -239,10 +241,32 @@ For packaging Julia with LLVM, we recommend either:
239241
- bundling a Julia-only LLVM library inside the Julia package, or
240242
- adding the patches to the LLVM package of the distribution.
241243
* A complete list of patches is available in on [Github](https://github.com/JuliaLang/llvm-project) see the `julia-release/15.x` branch.
242-
* The only Julia-specific patch is the lib renaming (`llvm-symver-jlprefix.patch`), which should _not_ be applied to a system LLVM.
244+
* The only Julia-specific patch is the lib renaming (`llvm7-symver-jlprefix.patch`), which should _not_ be applied to a system LLVM.
243245
* The remaining patches are all upstream bug fixes, and have been contributed into upstream LLVM.
244246

245-
Using an unpatched or different version of LLVM will result in errors and/or poor performance. Though Julia can be built with newer LLVM versions, support for this should be regarded as experimental and not suitable for packaging.
247+
Using an unpatched or different version of LLVM will result in errors and/or poor performance.
248+
You can build a different version of LLVM from a remote Git repository with the following options in the `Make.user` file:
249+
250+
```make
251+
# Force source build of LLVM
252+
USE_BINARYBUILDER_LLVM = 0
253+
# Use Git for fetching LLVM source code
254+
DEPS_GIT = 1
255+
# URL of the Git repository you want to obtain LLVM from:
256+
LLVM_GIT_URL = ...
257+
# Name of the branch to check out automatically
258+
LLVM_BRANCH = standalone_rel_15_x
259+
LLVM_SHA1 = $(LLVM_BRANCH)
260+
261+
# Other useful options:
262+
# List of LLVM targets to build. It is strongly recommended to keep at least all the
263+
# default targets listed in `deps/llvm.mk`, even if you don't necessarily need all of them.
264+
# LLVM_TARGETS = ...
265+
# Use ccache for faster recompilation in case you need to restart a build.
266+
# USECCACHE = 1
267+
```
268+
269+
Though Julia can be built with newer LLVM versions, support for this should be regarded as experimental and not suitable for packaging.
246270

247271
### libuv
248272

0 commit comments

Comments
 (0)