Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d01a2c7

Browse files
committed
Clarify why LLVM is required
1 parent 5e229ed commit d01a2c7

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Tools/jit/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ The JIT Compiler
33

44
This version of CPython can be built with an experimental just-in-time compiler. While most everything you already know about building and using CPython is unchanged, you will probably need to install a compatible version of LLVM first.
55

6-
### Installing LLVM
6+
## Installing LLVM
77

8-
The JIT compiler does not require end users to install any third-party dependencies, but part of it must be *built* using LLVM. You are *not* required to build the rest of CPython using LLVM, or even the same version of LLVM (in fact, this is uncommon).
8+
The JIT compiler does not require end users to install any third-party dependencies, but part of it must be *built* using LLVM[^why-llvm]. You are *not* required to build the rest of CPython using LLVM, or even the same version of LLVM (in fact, this is uncommon).
99

1010
LLVM version 16 is required. Both `clang` and `llvm-readobj` need to be installed and discoverable (version suffixes, like `clang-16`, are okay). It's highly recommended that you also have `llvm-objdump` available, since this allows the build script to dump human-readable assembly for the generated code.
1111

1212
It's easy to install all of the required tools:
1313

14-
#### Linux
14+
### Linux
1515

1616
Install LLVM 16 on Ubuntu/Debian:
1717

@@ -21,7 +21,7 @@ chmod +x llvm.sh
2121
sudo ./llvm.sh 16
2222
```
2323

24-
#### macOS
24+
### macOS
2525

2626
Install LLVM 16 with [Homebrew](https://brew.sh):
2727

@@ -31,16 +31,18 @@ $ brew install llvm@16
3131

3232
Homebrew won't add any of the tools to your `$PATH`. That's okay; the build script knows how to find them.
3333

34-
#### Windows
34+
### Windows
3535

3636
LLVM 16 can be installed on Windows by using the installers published on [LLVM's GitHub releases page](https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.6).
3737

3838
[Here's a recent one.](https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.6/LLVM-16.0.6-win64.exe) **When installing, be sure to select the option labeled "Add LLVM to the system PATH".**
3939

40-
### Building
40+
## Building
4141

4242
For `PCbuild`-based builds, pass the new `--experimental-jit` option to `build.bat`.
4343

4444
For all other builds, pass the new `--enable-experimental-jit` option to `configure`.
4545

4646
Otherwise, just configure and build as you normally would. Cross-compiling "just works", since the JIT is built for the host platform.
47+
48+
[^why-llvm]: Clang is specifically needed because it's the only C compiler with support for guaranteed tail calls (`musttail`), which are required by CPython's continuation-passing-style approach to JIT compilation. Since LLVM also includes other functionalities we need (namely, object file parsing and disassembly), it's convenient to only support one toolchain at this time.

0 commit comments

Comments
 (0)