Skip to content

Commit 23414c6

Browse files
committed
Merge commit 'e5ed7b6e2fd3' (Feb 27th)
commit e5ed7b6 Author: rohit-rao <rohitrao@google.com> Date: Tue Feb 27 15:23:00 2024 -0500 [clang] Extend define-target-os-macros to support XROS. (llvm#82833)
2 parents 96256f4 + e5ed7b6 commit 23414c6

File tree

9,985 files changed

+706085
-610966
lines changed

Some content is hidden

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

9,985 files changed

+706085
-610966
lines changed

.ci/monolithic-windows.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ targets="${2}"
3838

3939
echo "--- cmake"
4040
pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
41+
42+
# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
43+
# on fixing a build reliability issue on the build server, please
44+
# see https://github.com/llvm/llvm-project/pull/82393 and
45+
# https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/40
46+
# for further information.
4147
cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4248
-D LLVM_ENABLE_PROJECTS="${projects}" \
4349
-G Ninja \
@@ -49,7 +55,10 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4955
-D COMPILER_RT_BUILD_ORC=OFF \
5056
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
5157
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
52-
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
58+
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
59+
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
60+
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
61+
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO"
5362

5463
echo "--- ninja"
5564
# Targets are not escaped as they are passed as separate arguments.

.git-blame-ignore-revs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,11 @@ f6d557ee34b6bbdb1dc32f29e34b4a4a8ad35e81
7373

7474
# [libc++] Format the code base (#74334)
7575
9783f28cbb155e4a8d49c12e1c60ce14dcfaf0c7
76+
77+
# [RFC] compiler-rt builtins cleanup and refactoring
78+
082b89b25faae3e45a023caf51b65ca0f02f377f
79+
0ba22f51d128bee9d69756c56c4678097270e10b
80+
84da0e1bb75f8666cf222d2f600f37bebb9ea389
81+
82+
# [NFC] clang-format utils/TableGen (#80973)
83+
b9079baaddfed5e604fbfaa1d81a7a1c38e78c26

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,6 @@
101101

102102
# MLIR Sparsifier.
103103
/mlir/**/*SparseTensor*/ @aartbik @PeimingLiu @yinying-lisa-li @matthias-springer
104+
105+
# BOLT
106+
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci

.github/new-prs-labeler.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,49 @@ mc:
7575
clang:driver:
7676
- clang/*/Driver/**
7777

78+
compiler-rt:asan:
79+
- compiler-rt/lib/asan/**
80+
- compiler-rt/include/sanitizer/asan_interface.h
81+
- compiler-rt/test/asan/**
82+
- compiler-rt/lib/asan_abi/**
83+
- compiler-rt/test/asan_abi/**
84+
85+
compiler-rt:builtins:
86+
- compiler-rt/lib/builtins/**
87+
- compiler-rt/test/builtins/**
88+
89+
compiler-rt:cfi:
90+
- compiler-rt/lib/cfi/**
91+
- compiler-rt/test/cfi/**
92+
93+
compiler-rt:fuzzer:
94+
- compiler-rt/lib/fuzzer/**
95+
- compiler-rt/include/fuzzer/**
96+
- compiler-rt/test/fuzzer/**
97+
98+
compiler-rt:hwasan:
99+
- compiler-rt/lib/hwasan/**
100+
- compiler-rt/include/sanitizer/hwasan_interface.h
101+
- compiler-rt/test/hwasan/**
102+
103+
compiler-rt:lsan:
104+
- compiler-rt/lib/lsan/**
105+
- compiler-rt/include/sanitizer/lsan_interface.h
106+
- compiler-rt/test/lsan/**
107+
108+
compiler-rt:msan:
109+
- compiler-rt/lib/msan/**
110+
- compiler-rt/include/sanitizer/msan_interface.h
111+
- compiler-rt/test/msan/**
112+
78113
compiler-rt:sanitizer:
79114
- llvm/lib/Transforms/Instrumentation/*Sanitizer*
80115
- compiler-rt/lib/interception/**
81116
- compiler-rt/lib/*san*/**
117+
- compiler-rt/include/sanitizer/**
82118
- compiler-rt/test/*san*/**
83119
- compiler-rt/lib/fuzzer/**
120+
- compiler-rt/include/fuzzer/**
84121
- compiler-rt/test/fuzzer/**
85122
- compiler-rt/lib/scudo/**
86123
- compiler-rt/test/scudo/**
@@ -89,6 +126,19 @@ compiler-rt:scudo:
89126
- compiler-rt/lib/scudo/**
90127
- compiler-rt/test/scudo/**
91128

129+
compiler-rt:tsan:
130+
- compiler-rt/lib/tsan/**
131+
- compiler-rt/include/sanitizer/tsan_interface.h
132+
- compiler-rt/include/sanitizer/tsan_interface_atomic.h
133+
- compiler-rt/test/tsan/**
134+
135+
compiler-rt:ubsan:
136+
- compiler-rt/lib/ubsan/**
137+
- compiler-rt/include/sanitizer/ubsan_interface.h
138+
- compiler-rt/test/ubsan/**
139+
- compiler-rt/lib/ubsan_minimal/**
140+
- compiler-rt/test/ubsan_minimal/**
141+
92142
xray:
93143
- llvm/tools/llvm-xray/**
94144
- compiler-rt/*/xray/**
@@ -772,6 +822,50 @@ backend:X86:
772822
- llvm/lib/TargetParser/X86*
773823
- llvm/utils/TableGen/X86*
774824

825+
backend:PowerPC:
826+
- llvm/include/llvm/BinaryFormat/ELFRelocs/PowerPC*
827+
- llvm/include/llvm/BinaryFormat/XCOFF.h
828+
- llvm/include/llvm/IR/IntrinsicsPowerPC.td
829+
- llvm/lib/CodeGen/AsmPrinter/AIXException.cpp
830+
- llvm/lib/Target/PowerPC/**
831+
- llvm/test/Analysis/**/PowerPC/**
832+
- llvm/test/CodeGen/PowerPC/**
833+
- llvm/test/CodeGen/MIR/PowerPC/**
834+
- llvm/test/DebugInfo/XCOFF/**
835+
- llvm/test/DebugInfo/PowerPC/**
836+
- llvm/test/LTO/PowerPC/**
837+
- llvm/test/MC/Disassembler/PowerPC/**
838+
- llvm/test/MC/PowerPC/**
839+
- llvm/test/MC/XCOFF/**
840+
- llvm/test/Transforms/**/PowerPC/**
841+
- clang/include/clang/Basic/BuiltinsPPC.*
842+
- clang/lib/Basic/Targets/PPC.*
843+
- clang/lib/CodeGen/Targets/PPC.cpp
844+
- clang/lib/Driver/ToolChains/PPC*
845+
- clang/lib/Driver/ToolChains/AIX*
846+
- clang/lib/Driver/ToolChains/Arch/PPC.*
847+
- clang/test/CodeGen/PowerPC/**
848+
849+
backend:SystemZ:
850+
- llvm/include/llvm/BinaryFormat/ELFRelocs/SystemZ*
851+
- llvm/include/llvm/BinaryFormat/GOFF.h
852+
- llvm/include/llvm/IR/IntrinsicsSystemZ.td
853+
- llvm/lib/Target/SystemZ/**
854+
- llvm/test/Analysis/**/SystemZ/**
855+
- llvm/test/CodeGen/SystemZ/**
856+
- llvm/test/DebugInfo/SystemZ/**
857+
- llvm/test/ExecutionEngine/**/SystemZ/**
858+
- llvm/test/MC/Disassembler/SystemZ/**
859+
- llvm/test/MC/GOFF/**
860+
- llvm/test/MC/SystemZ/**
861+
- llvm/test/Transforms/**/SystemZ/**
862+
- clang/include/clang/Basic/BuiltinsSystemZ.*
863+
- clang/lib/Basic/Targets/SystemZ.*
864+
- clang/lib/CodeGen/Targets/SystemZ.cpp
865+
- clang/lib/Driver/ToolChains/ZOS*
866+
- clang/lib/Driver/ToolChains/Arch/SystemZ.*
867+
- clang/test/CodeGen/SystemZ/**
868+
775869
third-party:unittests:
776870
- third-party/unittests/**
777871

.github/workflows/build-ci-container.yml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Build CI Container
32

43
permissions:
@@ -19,9 +18,41 @@ on:
1918
- '.github/workflows/containers/github-action-ci/**'
2019

2120
jobs:
22-
build-ci-container:
21+
# TODO(boomanaiden154): Switch this back to a single stage build when we can
22+
# run this on the self-hosted runners and don't have to do it this way to
23+
# avoid timeouts.
24+
build-ci-container-stage1:
2325
if: github.repository_owner == 'llvm'
2426
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout LLVM
29+
uses: actions/checkout@v4
30+
with:
31+
sparse-checkout: .github/workflows/containers/github-action-ci/
32+
- name: Change podman Root Direcotry
33+
run: |
34+
mkdir -p ~/.config/containers
35+
sudo mkdir -p /mnt/podman
36+
sudo chown `whoami`:`whoami` /mnt/podman
37+
cp ./.github/workflows/containers/github-action-ci/storage.conf ~/.config/containers/storage.conf
38+
podman info
39+
- name: Build container stage1
40+
working-directory: ./.github/workflows/containers/github-action-ci/
41+
run: |
42+
podman build -t stage1-toolchain --target stage1-toolchain -f stage1.Dockerfile .
43+
- name: Save container image
44+
run: |
45+
podman save stage1-toolchain > stage1-toolchain.tar
46+
- name: Upload container image
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: stage1-toolchain
50+
path: stage1-toolchain.tar
51+
retention-days: 1
52+
build-ci-container-stage2:
53+
if: github.repository_owner == 'llvm'
54+
runs-on: ubuntu-latest
55+
needs: build-ci-container-stage1
2556
permissions:
2657
packages: write
2758
steps:
@@ -38,10 +69,27 @@ jobs:
3869
with:
3970
sparse-checkout: .github/workflows/containers/github-action-ci/
4071

72+
- name: Change podman Root Direcotry
73+
run: |
74+
mkdir -p ~/.config/containers
75+
sudo mkdir -p /mnt/podman
76+
sudo chown `whoami`:`whoami` /mnt/podman
77+
cp ./.github/workflows/containers/github-action-ci/storage.conf ~/.config/containers/storage.conf
78+
podman info
79+
80+
- name: Download stage1-toolchain
81+
uses: actions/download-artifact@v4
82+
with:
83+
name: stage1-toolchain
84+
85+
- name: Load stage1-toolchain
86+
run: |
87+
podman load -i stage1-toolchain.tar
88+
4189
- name: Build Container
4290
working-directory: ./.github/workflows/containers/github-action-ci/
4391
run: |
44-
podman build -t ${{ steps.vars.outputs.container-name-tag }} .
92+
podman build -t ${{ steps.vars.outputs.container-name-tag }} -f stage2.Dockerfile .
4593
podman tag ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name }}:latest
4694
4795
- name: Test Container

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/clang/cmake/caches/BOLT-PGO.cmake b/clang/cmake/caches/BOLT-PGO.cmake
2+
index 1a04ca9a74e5..d092820e4115 100644
3+
--- a/clang/cmake/caches/BOLT-PGO.cmake
4+
+++ b/clang/cmake/caches/BOLT-PGO.cmake
5+
@@ -4,6 +4,8 @@ set(CLANG_BOOTSTRAP_TARGETS
6+
stage2-clang-bolt
7+
stage2-distribution
8+
stage2-install-distribution
9+
+ clang
10+
+ lld
11+
CACHE STRING "")
12+
set(BOOTSTRAP_CLANG_BOOTSTRAP_TARGETS
13+
clang-bolt
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM docker.io/library/ubuntu:22.04 as base
2+
ENV LLVM_SYSROOT=/opt/llvm
3+
4+
FROM base as stage1-toolchain
5+
ENV LLVM_VERSION=17.0.6
6+
7+
RUN apt-get update && \
8+
apt-get install -y \
9+
wget \
10+
gcc \
11+
g++ \
12+
cmake \
13+
ninja-build \
14+
python3 \
15+
git \
16+
curl
17+
18+
RUN curl -O -L https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-$LLVM_VERSION.tar.gz && tar -xf llvmorg-$LLVM_VERSION.tar.gz
19+
20+
WORKDIR /llvm-project-llvmorg-$LLVM_VERSION
21+
22+
COPY bootstrap.patch /
23+
24+
# TODO(boomanaiden154): Remove the patch pulled from a LLVM PR once we bump
25+
# the toolchain to version 18 and the patch is in-tree.
26+
# TODO(boomanaiden154): Remove the bootstrap patch once we unsplit the build
27+
# and no longer need to explicitly build the stage2 dependencies.
28+
RUN curl https://github.com/llvm/llvm-project/commit/dd0356d741aefa25ece973d6cc4b55dcb73b84b4.patch | patch -p1 && cat /bootstrap.patch | patch -p1
29+
30+
RUN mkdir build
31+
32+
RUN cmake -B ./build -G Ninja ./llvm \
33+
-C ./clang/cmake/caches/BOLT-PGO.cmake \
34+
-DBOOTSTRAP_LLVM_ENABLE_LLD=ON \
35+
-DBOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_LLD=ON \
36+
-DPGO_INSTRUMENT_LTO=Thin \
37+
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
38+
-DCMAKE_INSTALL_PREFIX="$LLVM_SYSROOT" \
39+
-DLLVM_ENABLE_PROJECTS="bolt;clang;lld;clang-tools-extra" \
40+
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format" \
41+
-DCLANG_DEFAULT_LINKER="lld" \
42+
-DBOOTSTRAP_CLANG_PGO_TRAINING_DATA_SOURCE_DIR=/llvm-project-llvmorg-$LLVM_VERSION/llvm
43+
44+
RUN ninja -C ./build stage2-instrumented-clang stage2-instrumented-lld
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM docker.io/library/ubuntu:22.04 as base
2+
ENV LLVM_SYSROOT=/opt/llvm
3+
4+
FROM stage1-toolchain AS stage2-toolchain
5+
6+
RUN ninja -C ./build stage2-clang-bolt stage2-install-distribution && ninja -C ./build install-distribution && rm -rf ./build
7+
8+
FROM base
9+
10+
COPY --from=stage2-toolchain $LLVM_SYSROOT $LLVM_SYSROOT
11+
12+
# Need to install curl for hendrikmuhs/ccache-action
13+
# Need nodejs for some of the GitHub actions.
14+
# Need perl-modules for clang analyzer tests.
15+
RUN apt-get update && \
16+
apt-get install -y \
17+
binutils \
18+
cmake \
19+
curl \
20+
libstdc++-11-dev \
21+
ninja-build \
22+
nodejs \
23+
perl-modules \
24+
python3-psutil
25+
26+
ENV LLVM_SYSROOT=$LLVM_SYSROOT
27+
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[storage]
2+
driver = "overlay"
3+
runroot = "/mnt/podman/container"
4+
graphroot = "/mnt/podman/image"

0 commit comments

Comments
 (0)