Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update coredistools documentation #353

Merged
merged 1 commit into from
Apr 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions doc/building-coredistools.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building coredistools

## Building on Windows with Visual Studio 2019
## Building on Windows with Visual Studio 2022

1. Checkout the jitutils repository:
```
Expand All @@ -10,7 +10,7 @@ cd jitutils

2. Checkout the LLVM project repository:
```
git clone --depth 1 --branch llvmorg-9.0.1 https://github.com/llvm/llvm-project.git src\llvm-project
git clone --depth 1 --branch llvmorg-13.0.1 https://github.com/llvm/llvm-project.git src\llvm-project
```

4. Build `llvm-tblgen.exe`:
Expand Down Expand Up @@ -44,6 +44,11 @@ build-coredistools.cmd win-arm
build-coredistools.cmd win-arm64
```

### Building Debug binaries

The `build-coredistools.cmd` script is set up to build a Release build. To create a Debug build with a PDB file,
for debugging, change the `--config Release` line to `--config Debug`.

## Building on Linux

1. Checkout the jitutils repository:
Expand All @@ -54,24 +59,24 @@ cd jitutils

2. Checkout the LLVM project repository:
```
git clone --depth 1 --branch llvmorg-9.0.1 https://github.com/llvm/llvm-project.git src/llvm-project
git clone --depth 1 --branch llvmorg-13.0.1 https://github.com/llvm/llvm-project.git src/llvm-project
```

3. Download LLVM release from GitHub:

```
python3 eng/download-llvm-release.py -release llvmorg-9.0.1 -os linux
python3 eng/download-llvm-release.py -release llvmorg-13.0.1 -os linux
```

4. Locate under the current directory file `llvm-tblgen`
```
find -name llvm-tblgen
./clang+llvm-9.0.1-x86_64-linux-gnu-ubuntu-16.04/bin/llvm-tblgen
./clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-tblgen
```
and add its parent directory location to the `PATH`:

```
export PATH=$(pwd)/clang+llvm-9.0.1-x86_64-linux-gnu-ubuntu-16.04/bin:$PATH
export PATH=$(pwd)/clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04/bin:$PATH
```

5. Build `libcoredistools.so` for Linux x64:
Expand All @@ -89,15 +94,15 @@ find ./artifacts -name libcoredistools.so
6. Build `libcoredistools.so` for Linux arm64 under Docker:

```
docker run -it --rm --entrypoint /bin/bash -v ~/git/jitutils:/opt/code -w /opt/code -u $(id -u):$(id -g) mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-20200413125008-cfdd435
export PATH=$(pwd)/clang+llvm-9.0.1-x86_64-linux-gnu-ubuntu-16.04/bin:$PATH
docker run -it --rm --entrypoint /bin/bash -v ~/git/jitutils:/opt/code -w /opt/code -u $(id -u):$(id -g) mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm64-20220312201346-b2c2436
export PATH=$(pwd)/clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04/bin:$PATH
./build-coredistools.sh linux-arm64 /crossrootfs/arm64
```

7. Build `libcoredistools.so` for Linux arm under Docker:
```
docker run -it --rm --entrypoint /bin/bash -v ~/git/jitutils:/opt/code -w /opt/code -u $(id -u):$(id -g) mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-20200413125008-09ec757
export PATH=$(pwd)/clang+llvm-9.0.1-x86_64-linux-gnu-ubuntu-16.04/bin:$PATH
docker run -it --rm --entrypoint /bin/bash -v ~/git/jitutils:/opt/code -w /opt/code -u $(id -u):$(id -g) mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-20220312201346-b9de666
export PATH=$(pwd)/clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04/bin:$PATH
./build-coredistools.sh linux-arm /crossrootfs/arm
```