Skip to content

Commit 87f2937

Browse files
committed
Merge branch 'main' into pauth-gnuprop-clang
2 parents fdb26a1 + e68d505 commit 87f2937

File tree

5,288 files changed

+390425
-174795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,288 files changed

+390425
-174795
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function add-dependencies() {
9191
echo "${project}"
9292
case ${project} in
9393
bolt)
94-
for p in lld llvm; do
94+
for p in clang lld llvm; do
9595
echo $p
9696
done
9797
;;

.ci/monolithic-linux.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4848
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --timeout=1200 --time-tests" \
4949
-D LLVM_ENABLE_LLD=ON \
5050
-D CMAKE_CXX_FLAGS=-gmlt \
51-
-D BOLT_CLANG_EXE=/usr/bin/clang \
5251
-D LLVM_CCACHE_BUILD=ON \
5352
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
5453

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
clang/lib/AST/Interp/ @tbaederr
3636
clang/test/AST/Interp/ @tbaederr
3737

38+
/clang/include/clang/CIR @lanza @bcardosolopes
39+
/clang/lib/CIR @lanza @bcardosolopes
40+
/clang/tools/cir-* @lanza @bcardosolopes
41+
3842
/lldb/ @JDevlieghere
3943

4044
# MLIR Interfaces.

.github/new-prs-labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
BOLT:
2+
- bolt/**/*
3+
14
ClangIR:
25
- clang/include/clang/CIR/**/*
36
- clang/lib/CIR/**/*
@@ -467,6 +470,7 @@ backend:m68k:
467470

468471
libc++:
469472
- libcxx/**
473+
- .github/workflows/libcxx-*
470474

471475
libc++abi:
472476
- libcxxabi/**

.github/workflows/release-binaries.yml

Lines changed: 183 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ jobs:
3838
if: github.repository == 'llvm/llvm-project'
3939
outputs:
4040
release-version: ${{ steps.vars.outputs.release-version }}
41-
flags: ${{ steps.vars.outputs.flags }}
42-
build-dir: ${{ steps.vars.outputs.build-dir }}
43-
rc-flags: ${{ steps.vars.outputs.rc-flags }}
4441
ref: ${{ steps.vars.outputs.ref }}
4542
upload: ${{ steps.vars.outputs.upload }}
4643

@@ -85,17 +82,11 @@ jobs:
8582
fi
8683
bash .github/workflows/set-release-binary-outputs.sh "$tag" "$upload"
8784
88-
# Try to get around the 6 hour timeout by first running a job to fill
89-
# the build cache.
90-
fill-cache:
91-
name: "Fill Cache ${{ matrix.os }}"
85+
build-stage1-linux:
86+
name: "Build Stage 1 Linux"
9287
needs: prepare
93-
runs-on: ${{ matrix.os }}
88+
runs-on: ubuntu-22.04
9489
if: github.repository == 'llvm/llvm-project'
95-
strategy:
96-
matrix:
97-
os:
98-
- ubuntu-22.04
9990
steps:
10091
- name: Checkout LLVM
10192
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -109,81 +100,207 @@ jobs:
109100
uses: hendrikmuhs/ccache-action@ca3acd2731eef11f1572ccb126356c2f9298d35e # v1.2.9
110101
with:
111102
max-size: 250M
112-
key: sccache-${{ matrix.os }}-release
103+
key: sccache-${{ runner.os }}-release
113104
variant: sccache
114105

115-
- name: Build Clang
106+
- name: Build Stage 1 Clang
116107
run: |
117-
cmake -G Ninja -C clang/cmake/caches/Release.cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_POSITION_INDEPENDENT_CODE=ON -S llvm -B build
118-
ninja -v -C build clang
108+
sudo chown $USER:$USER /mnt/
109+
cmake -G Ninja -C clang/cmake/caches/Release.cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -S llvm -B /mnt/build
110+
ninja -v -C /mnt/build
119111
112+
# We need to create an archive of the build directory, because it has too
113+
# many files to upload.
114+
- name: Package Build and Source Directories
115+
run: |
116+
tar -c . | zstd -T0 -c > llvm-project.tar.zst
117+
tar -C /mnt/ -c build/ | zstd -T0 -c > build.tar.zst
120118
121-
build-binaries:
122-
name: ${{ matrix.target.triple }}
123-
permissions:
124-
contents: write # To upload assets to release.
119+
- name: Upload Stage 1 Source
120+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
121+
with:
122+
name: stage1-source
123+
path: llvm-project.tar.zst
124+
retention-days: 2
125+
126+
- name: Upload Stage 1 Build Dir
127+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
128+
with:
129+
name: stage1-build
130+
path: build.tar.zst
131+
retention-days: 2
132+
133+
build-stage2-linux:
134+
name: "Build Stage 2 Linux"
125135
needs:
126136
- prepare
127-
- fill-cache
128-
runs-on: ${{ matrix.target.runs-on }}
137+
- build-stage1-linux
138+
runs-on: ubuntu-22.04
129139
if: github.repository == 'llvm/llvm-project'
130-
strategy:
131-
fail-fast: false
132-
matrix:
133-
target:
134-
- triple: x86_64-linux-gnu-ubuntu-22.04
135-
os: ubuntu-22.04
136-
runs-on: ubuntu-22.04-16x64
137-
debian-build-deps: >
138-
chrpath
139-
gcc-multilib
140-
ninja-build
141-
142140
steps:
143-
- name: Checkout LLVM
144-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
141+
- name: Install Ninja
142+
uses: llvm/actions/install-ninja@22e9f909d35b50bd1181709564bfe816eaeaae81 # main
143+
144+
- name: Download Stage 1 Artifacts
145+
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
145146
with:
146-
ref: ${{ needs.prepare.outputs.ref }}
147-
path: ${{ needs.prepare.outputs.build-dir }}/llvm-project
147+
pattern: stage1-*
148+
merge-multiple: true
148149

149-
- name: Setup sccache
150-
uses: hendrikmuhs/ccache-action@ca3acd2731eef11f1572ccb126356c2f9298d35e # v1.2.9
150+
- name: Unpack Artifacts
151+
run: |
152+
tar --zstd -xf llvm-project.tar.zst
153+
rm llvm-project.tar.zst
154+
sudo chown $USER:$USER /mnt/
155+
tar --zstd -C /mnt -xf build.tar.zst
156+
rm build.tar.zst
157+
158+
- name: Build Stage 2
159+
run: |
160+
ninja -C /mnt/build stage2-instrumented
161+
162+
# We need to create an archive of the build directory, because it has too
163+
# many files to upload.
164+
- name: Save Build and Source Directories
165+
run: |
166+
tar -c . | zstd -T0 -c > llvm-project.tar.zst
167+
tar -C /mnt/ -c build/ | zstd -T0 -c > build.tar.zst
168+
169+
- name: Upload Stage 2 Source
170+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
151171
with:
152-
max-size: 250M
153-
key: sccache-${{ matrix.target.os }}-release
154-
save: false
155-
variant: sccache
172+
name: stage2-source
173+
path: ${{ github.workspace }}/llvm-project.tar.zst
174+
retention-days: 2
175+
176+
- name: Upload Stage 2 Build Dir
177+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
178+
with:
179+
name: stage2-build
180+
path: ${{ github.workspace }}/build.tar.zst
181+
retention-days: 2
156182

157-
- name: Install Brew build dependencies
158-
if: matrix.target.brew-build-deps != ''
159-
run: brew install ${{ matrix.target.brew-build-deps }}
160183

161-
- name: Install Debian build dependencies
162-
if: matrix.target.debian-build-deps != ''
163-
run: sudo apt install ${{ matrix.target.debian-build-deps }}
184+
build-stage3-linux:
185+
name: "Build Stage 3 Linux"
186+
needs:
187+
- prepare
188+
- build-stage2-linux
189+
outputs:
190+
filename: ${{ steps.package-info.outputs.release-filename }}
191+
runs-on: ubuntu-22.04-16x64
192+
if: github.repository == 'llvm/llvm-project'
193+
steps:
194+
- name: Install Ninja
195+
uses: llvm/actions/install-ninja@22e9f909d35b50bd1181709564bfe816eaeaae81 # main
196+
197+
- name: 'Download artifact'
198+
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
199+
with:
200+
pattern: stage2-*
201+
merge-multiple: true
164202

165-
- name: Set macOS build env variables
166-
if: runner.os == 'macOS'
203+
- name: Unpack Artifact
167204
run: |
168-
echo "MACOSX_DEPLOYMENT_TARGET=10.9" >> "$GITHUB_ENV"
205+
tar --zstd -xf llvm-project.tar.zst
206+
rm llvm-project.tar.zst
207+
sudo chown $USER:$USER /mnt/
208+
tar --zstd -C /mnt -xf build.tar.zst
209+
rm build.tar.zst
169210
170-
- name: Build and test release
211+
- name: Build Release Package
171212
run: |
172-
${{ needs.prepare.outputs.build-dir }}/llvm-project/llvm/utils/release/test-release.sh \
173-
${{ needs.prepare.outputs.flags }} \
174-
-triple ${{ matrix.target.triple }} \
175-
-use-ninja \
176-
-no-checkout \
177-
-use-cmake-cache \
178-
-no-test-suite \
179-
-configure-flags "-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
213+
ninja -C /mnt/build stage2-package
180214
181-
- name: Upload binaries
182-
if: ${{ always() && needs.prepare.outputs.upload == 'true' }}
215+
- id: package-info
216+
run: |
217+
filename="LLVM-${{ needs.prepare.outputs.release-version }}-Linux.tar.gz"
218+
echo "filename=$filename" >> $GITHUB_OUTPUT
219+
echo "path=/mnt/build/tools/clang/stage2-bins/$filename" >> $GITHUB_OUTPUT
220+
221+
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
222+
if: always()
223+
with:
224+
name: release-binary
225+
path: ${{ steps.package-info.outputs.path }}
226+
227+
# Clean up some build files to reduce size of artifact.
228+
- name: Clean Up Build Directory
229+
run: |
230+
find /mnt/build -iname ${{ steps.package-info.outputs.filename }} -delete
231+
232+
# We need to create an archive of the build directory, because it has too
233+
# many files to upload.
234+
- name: Save Build and Source Directories
235+
run: |
236+
tar -c . | zstd -T0 -c > llvm-project.tar.zst
237+
tar -C /mnt/ -c build/ | zstd -T0 -c > build.tar.zst
238+
239+
- name: Upload Stage 3 Source
240+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
241+
with:
242+
name: stage3-source
243+
path: llvm-project.tar.zst
244+
retention-days: 2
245+
246+
- name: Upload Stage 3 Build Dir
247+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
248+
with:
249+
name: stage3-build
250+
path: build.tar.zst
251+
retention-days: 2
252+
253+
upload-release-binaries-linux:
254+
name: "Upload Linux Release Binaries"
255+
needs:
256+
- prepare
257+
- build-stage3-linux
258+
if : ${{ needs.prepare.outputs.upload == 'true' }}
259+
runs-on: ubuntu-22.04
260+
permissions:
261+
contents: write # For release uploads
262+
263+
steps:
264+
- name: 'Download artifact'
265+
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
266+
with:
267+
name: release-binary
268+
269+
- name: Upload Release
183270
run: |
184271
sudo apt install python3-github
185-
${{ needs.prepare.outputs.build-dir }}/llvm-project/llvm/utils/release/github-upload-release.py \
272+
./llvm-project/llvm/utils/release/github-upload-release.py \
186273
--token ${{ github.token }} \
187274
--release ${{ needs.prepare.outputs.release-version }} \
188275
upload \
189-
--files ${{ needs.prepare.outputs.build-dir }}/clang+llvm-${{ needs.prepare.outputs.release-version }}-${{ matrix.target.triple }}.tar.xz
276+
--files ${{ needs.build-stage3-linux.outputs.release-filename }}
277+
278+
279+
test-stage3-linux:
280+
name: "Test Stage 3 Linux"
281+
needs:
282+
- prepare
283+
- build-stage3-linux
284+
runs-on: ubuntu-22.04
285+
if: github.repository == 'llvm/llvm-project'
286+
steps:
287+
- name: Install Ninja
288+
uses: llvm/actions/install-ninja@22e9f909d35b50bd1181709564bfe816eaeaae81 # main
289+
290+
- name: 'Download artifact'
291+
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
292+
with:
293+
pattern: stage3-*
294+
merge-multiple: true
295+
296+
- name: Unpack Artifact
297+
run: |
298+
tar --zstd -xf llvm-project.tar.zst
299+
rm llvm-project.tar.zst
300+
sudo chown $USER:$USER /mnt/
301+
tar --zstd -C /mnt -xf build.tar.zst
302+
rm build.tar.zst
303+
304+
- name: Run Tests
305+
run: |
306+
ninja -C /mnt/build stage2-check-all

.github/workflows/set-release-binary-outputs.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ if echo $tag | grep -e '^[0-9a-f]\+$'; then
1515
# This is a plain commit.
1616
# TODO: Don't hardcode this.
1717
release_version="18"
18-
build_dir="$tag"
1918
upload='false'
2019
ref="$tag"
21-
flags="-git-ref $tag -test-asserts"
2220

2321
else
2422

@@ -30,12 +28,7 @@ else
3028
fi
3129
release_version=`echo "$tag" | sed 's/llvmorg-//g'`
3230
release=`echo "$release_version" | sed 's/-.*//g'`
33-
build_dir=`echo "$release_version" | sed 's,^[^-]\+,final,' | sed 's,[^-]\+-rc\(.\+\),rc\1,'`
34-
rc_flags=`echo "$release_version" | sed 's,^[^-]\+,-final,' | sed 's,[^-]\+-rc\(.\+\),-rc \1 -test-asserts,' | sed 's,--,-,'`
35-
flags="-release $release $rc_flags"
3631
fi
3732
echo "release-version=$release_version" >> $GITHUB_OUTPUT
38-
echo "build-dir=$build_dir" >> $GITHUB_OUTPUT
39-
echo "flags=$flags" >> $GITHUB_OUTPUT
4033
echo "upload=$upload" >> $GITHUB_OUTPUT
4134
echo "ref=$tag" >> $GITHUB_OUTPUT

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "bolt/Core/JumpTable.h"
2121
#include "bolt/Core/MCPlusBuilder.h"
2222
#include "bolt/RuntimeLibs/RuntimeLibrary.h"
23+
#include "llvm/ADT/AddressRanges.h"
2324
#include "llvm/ADT/ArrayRef.h"
2425
#include "llvm/ADT/StringMap.h"
2526
#include "llvm/ADT/iterator.h"
@@ -726,6 +727,9 @@ class BinaryContext {
726727
uint64_t OldTextSectionOffset{0};
727728
uint64_t OldTextSectionSize{0};
728729

730+
/// Area in the input binary reserved for BOLT.
731+
AddressRange BOLTReserved;
732+
729733
/// Address of the code/function that is executed before any other code in
730734
/// the binary.
731735
std::optional<uint64_t> StartFunctionAddress;

bolt/include/bolt/Passes/BinaryPasses.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,7 @@ class PrintProfileStats : public BinaryFunctionPass {
400400
/// dyno stats categories.
401401
class PrintProgramStats : public BinaryFunctionPass {
402402
public:
403-
explicit PrintProgramStats(const cl::opt<bool> &PrintPass)
404-
: BinaryFunctionPass(PrintPass) {}
403+
explicit PrintProgramStats() : BinaryFunctionPass(false) {}
405404

406405
const char *getName() const override { return "print-stats"; }
407406
bool shouldPrint(const BinaryFunction &) const override { return false; }

0 commit comments

Comments
 (0)