-
Notifications
You must be signed in to change notification settings - Fork 0
252 lines (234 loc) · 17.6 KB
/
llvm.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
name: Build LLVM toolchain
on:
workflow_dispatch:
inputs:
llvm_tag:
required: true
jobs:
build_linux:
runs-on: ubuntu-latest
strategy:
matrix:
cpu: ["x86_64", "aarch64", "riscv64"]
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -yqq python3 git ninja-build cmake zstd
- name: Install ARM toolchain
run: sudo apt install -yqq gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi
- name: Install AArch64 toolchain
run: sudo apt install -yqq gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
- name: Install RISC-V toolchain
run: sudo apt install -yqq gcc-riscv64-linux-gnu g++-riscv64-linux-gnu binutils-riscv64-linux-gnu
- name: Setup mold
uses: warchant/setup-mold@v1
with:
version: 2.4.0
make_default: false
- name: Checkout LLVM
uses: actions/checkout@v4
with:
repository: "llvm/llvm-project"
ref: ${{ inputs.llvm_tag }}
path: llvm
- name: Checkout code
uses: actions/checkout@v4
with:
path: toolchain
- name: Build and install
env:
CXXFLAGS: -w
CFLAGS: -w
run: |
mkdir build && mkdir install
python3 ./toolchain/scripts/configure_llvm.py --target_cpu="${{matrix.cpu}}-unknown-linux-gnu" --build_dir=$PWD/build
cd build
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-clang-tidy ninja install-clangtidy-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-clang-doc ninja install-clangdoc-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-clang-format ninja install-clangformat-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-clangd ninja install-clangdtool-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-bolt ninja install-bolttool-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-lld ninja install-lldtool-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-libcpp ninja install-stdlib-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}} ninja install-toolchain-distribution-stripped
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-clang-tidy
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-clang-doc
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-clang-format
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-clangd
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-bolt
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-lld
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}-libcpp
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}
ninja llvm-dwp
DESTDIR=$PWD/install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}} ninja install-pstl
cp ./bin/llvm-dwp ../install/${{inputs.llvm_tag}}-linux-${{matrix.cpu}}/bin/
cd ../install
tar --zstd -cf ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}.tar.zst ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}
tar --zstd -cf ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-clang-tidy.tar.zst ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-clang-tidy
tar --zstd -cf ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-clang-doc.tar.zst ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-clang-doc
tar --zstd -cf ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-clang-format.tar.zst ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-clang-format
tar --zstd -cf ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-clangd.tar.zst ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-clangd
tar --zstd -cf ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-bolt.tar.zst ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-bolt
tar --zstd -cf ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-lld.tar.zst ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-lld
tar --zstd -cf ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-libcpp.tar.zst ${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}-libcpp
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
path: install/${{ inputs.llvm_tag }}-linux-${{matrix.cpu}}*.tar.zst
name: linux-${{matrix.cpu}}-toolchain
build_macos:
runs-on: macos-13
strategy:
matrix:
cpu: ["x86_64", "aarch64"]
steps:
- name: Install dependencies
run: brew install ninja zstd gnu-tar
- name: Checkout LLVM
uses: actions/checkout@v4
with:
repository: "llvm/llvm-project"
ref: ${{ inputs.llvm_tag }}
path: llvm
- name: Checkout code
uses: actions/checkout@v4
with:
path: toolchain
- name: Build and install
env:
CXXFLAGS: -w
CFLAGS: -w
run: |
mkdir build && mkdir install
python3 ./toolchain/scripts/configure_llvm.py --target_cpu="${{matrix.cpu}}-apple-darwin" --build_dir=$PWD/build
cd build
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-clang-tidy ninja install-clangtidy-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-clang-doc ninja install-clangdoc-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-clang-format ninja install-clangformat-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-clangd ninja install-clangdtool-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-bolt ninja install-bolttool-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-lld ninja install-lldtool-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-libcpp ninja install-stdlib-distribution-stripped
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}} ninja install-toolchain-distribution-stripped
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-clang-tidy
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-clang-doc
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-clang-format
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-clangd
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-bolt
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-lld
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}-libcpp
../toolchain/scripts/flatten_usr_dirs.sh $PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}
ninja llvm-dwp
DESTDIR=$PWD/../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}} ninja install-pstl
cp ./bin/llvm-dwp ../install/${{inputs.llvm_tag}}-macos-${{matrix.cpu}}/bin/
cd ../install
tar --zstd -cf ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}.tar.zst ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}
tar --zstd -cf ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-clang-tidy.tar.zst ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-clang-tidy
tar --zstd -cf ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-clang-doc.tar.zst ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-clang-doc
tar --zstd -cf ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-clang-format.tar.zst ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-clang-format
tar --zstd -cf ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-clangd.tar.zst ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-clangd
tar --zstd -cf ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-bolt.tar.zst ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-bolt
tar --zstd -cf ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-lld.tar.zst ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-lld
tar --zstd -cf ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-libcpp.tar.zst ${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}-libcpp
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
path: install/${{ inputs.llvm_tag }}-macos-${{matrix.cpu}}*.tar.zst
name: macos-${{matrix.cpu}}-toolchain
publish_release:
needs: ["build_linux", "build_macos"]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Collect sha256 checksums
run: |
touch RELASE.txt
sha256sum linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64.tar.zst >> RELEASE.txt
sha256sum linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-clang-tidy.tar.zst >> RELEASE.txt
sha256sum linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-clang-doc.tar.zst >> RELEASE.txt
sha256sum linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-clang-format.tar.zst >> RELEASE.txt
sha256sum linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-clangd.tar.zst >> RELEASE.txt
sha256sum linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-bolt.tar.zst >> RELEASE.txt
sha256sum linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-lld.tar.zst >> RELEASE.txt
sha256sum linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-libcpp.tar.zst >> RELEASE.txt
sha256sum linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64.tar.zst >> RELEASE.txt
sha256sum linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-clang-tidy.tar.zst >> RELEASE.txt
sha256sum linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-clang-doc.tar.zst >> RELEASE.txt
sha256sum linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-clang-format.tar.zst >> RELEASE.txt
sha256sum linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-clangd.tar.zst >> RELEASE.txt
sha256sum linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-bolt.tar.zst >> RELEASE.txt
sha256sum linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-lld.tar.zst >> RELEASE.txt
sha256sum linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-libcpp.tar.zst >> RELEASE.txt
sha256sum linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64.tar.zst >> RELEASE.txt
sha256sum linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-clang-tidy.tar.zst >> RELEASE.txt
sha256sum linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-clang-doc.tar.zst >> RELEASE.txt
sha256sum linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-clang-format.tar.zst >> RELEASE.txt
sha256sum linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-clangd.tar.zst >> RELEASE.txt
sha256sum linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-bolt.tar.zst >> RELEASE.txt
sha256sum linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-lld.tar.zst >> RELEASE.txt
sha256sum linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-libcpp.tar.zst >> RELEASE.txt
sha256sum macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64.tar.zst >> RELEASE.txt
sha256sum macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-clang-tidy.tar.zst >> RELEASE.txt
sha256sum macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-clang-doc.tar.zst >> RELEASE.txt
sha256sum macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-clang-format.tar.zst >> RELEASE.txt
sha256sum macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-clangd.tar.zst >> RELEASE.txt
sha256sum macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-bolt.tar.zst >> RELEASE.txt
sha256sum macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-lld.tar.zst >> RELEASE.txt
sha256sum macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-libcpp.tar.zst >> RELEASE.txt
sha256sum macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64.tar.zst >> RELEASE.txt
sha256sum macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-clang-tidy.tar.zst >> RELEASE.txt
sha256sum macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-clang-doc.tar.zst >> RELEASE.txt
sha256sum macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-clang-format.tar.zst >> RELEASE.txt
sha256sum macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-clangd.tar.zst >> RELEASE.txt
sha256sum macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-bolt.tar.zst >> RELEASE.txt
sha256sum macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-lld.tar.zst >> RELEASE.txt
sha256sum macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-libcpp.tar.zst >> RELEASE.txt
- name: Create release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.RELEASE_TOKEN }}
body_path: RELEASE.txt
tag_name: ${{ inputs.llvm_tag }}-${{ github.sha }}
name: LLVM Toolchain ${{ inputs.llvm_tag }}
prerelease: true
files: |
linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64.tar.zst
linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-clang-tidy.tar.zst
linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-clang-doc.tar.zst
linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-clang-format.tar.zst
linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-clangd.tar.zst
linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-bolt.tar.zst
linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-lld.tar.zst
linux-x86_64-toolchain/${{ inputs.llvm_tag }}-linux-x86_64-libcpp.tar.zst
linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64.tar.zst
linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-clang-tidy.tar.zst
linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-clang-doc.tar.zst
linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-clang-format.tar.zst
linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-clangd.tar.zst
linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-bolt.tar.zst
linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-lld.tar.zst
linux-aarch64-toolchain/${{ inputs.llvm_tag }}-linux-aarch64-libcpp.tar.zst
linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64.tar.zst
linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-clang-tidy.tar.zst
linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-clang-doc.tar.zst
linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-clang-format.tar.zst
linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-clangd.tar.zst
linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-bolt.tar.zst
linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-lld.tar.zst
linux-riscv64-toolchain/${{ inputs.llvm_tag }}-linux-riscv64-libcpp.tar.zst
macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64.tar.zst
macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-clang-tidy.tar.zst
macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-clang-doc.tar.zst
macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-clang-format.tar.zst
macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-clangd.tar.zst
macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-bolt.tar.zst
macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-lld.tar.zst
macos-x86_64-toolchain/${{ inputs.llvm_tag }}-macos-x86_64-libcpp.tar.zst
macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64.tar.zst
macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-clang-tidy.tar.zst
macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-clang-doc.tar.zst
macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-clang-format.tar.zst
macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-clangd.tar.zst
macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-bolt.tar.zst
macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-lld.tar.zst
macos-aarch64-toolchain/${{ inputs.llvm_tag }}-macos-aarch64-libcpp.tar.zst