Skip to content

Commit 1e4c2ae

Browse files
committed
Update clang to build LLVM to 9.0.0
This also ensure that we're using the same clang version for all our major platforms instead of 8.0 on Linux and 7.0 on OSX/Windows.
1 parent 50f8aad commit 1e4c2ae

File tree

5 files changed

+36
-14
lines changed

5 files changed

+36
-14
lines changed

src/ci/docker/dist-i686-linux/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ RUN ./build-python.sh
6969

7070
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
7171
# clang/clang++ compilers.
72-
COPY dist-x86_64-linux/build-clang.sh /tmp/
72+
COPY dist-x86_64-linux/build-clang.sh dist-x86_64-linux/llvm-project-centos.patch /tmp/
7373
RUN ./build-clang.sh
7474
ENV CC=clang CXX=clang++
7575

src/ci/docker/dist-x86_64-linux/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ RUN ./build-python.sh
6969

7070
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
7171
# clang/clang++ compilers.
72-
COPY dist-x86_64-linux/build-clang.sh /tmp/
72+
COPY dist-x86_64-linux/build-clang.sh dist-x86_64-linux/llvm-project-centos.patch /tmp/
7373
RUN ./build-clang.sh
7474
ENV CC=clang CXX=clang++
7575

src/ci/docker/dist-x86_64-linux/build-clang.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ set -ex
44

55
source shared.sh
66

7-
LLVM=llvmorg-8.0.0-rc2
7+
LLVM=llvmorg-9.0.0
88

99
mkdir llvm-project
1010
cd llvm-project
1111

1212
curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz | \
1313
tar xzf - --strip-components=1
1414

15+
yum install -y patch
16+
patch -Np1 < ../llvm-project-centos.patch
17+
1518
mkdir clang-build
1619
cd clang-build
1720

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp b/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
2+
index 176d6d6abf3..a6d63bf24b8 100644
3+
--- a/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
4+
+++ b/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
5+
@@ -33,6 +33,13 @@ namespace {
6+
using namespace llvm;
7+
using namespace clang;
8+
9+
+#define EPOLL_CLOEXEC -1
10+
+#define IN_CLOEXEC -1
11+
+#define O_CLOEXEC -1
12+
+static int epoll_create1(int flags) { return -1; }
13+
+static int inotify_init1(int flags) { return -1; }
14+
+static int pipe2(int *fds, int flags) { return -1; }
15+
+
16+
/// Pipe for inter-thread synchronization - for epoll-ing on multiple
17+
/// conditions. It is meant for uni-directional 1:1 signalling - specifically:
18+
/// no multiple consumers, no data passing. Thread waiting for signal should

src/ci/scripts/install-clang.sh

+12-11
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ IFS=$'\n\t'
99
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
1010

1111
if isMacOS; then
12-
curl -f "${MIRRORS_BASE}/clang%2Bllvm-7.0.0-x86_64-apple-darwin.tar.xz" | tar xJf -
12+
curl -f "${MIRRORS_BASE}/clang%2Bllvm-9.0.0-x86_64-darwin-apple.tar.xz" | tar xJf -
1313

14-
ciCommandSetEnv CC "$(pwd)/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang"
15-
ciCommandSetEnv CXX "$(pwd)/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang++"
14+
ciCommandSetEnv CC "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang"
15+
ciCommandSetEnv CXX "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang++"
1616

1717
# Configure `AR` specifically so rustbuild doesn't try to infer it as
1818
# `clang-ar` by accident.
@@ -27,17 +27,18 @@ elif isWindows && [[ -z ${MINGW_URL+x} ]]; then
2727
# Note that the LLVM installer is an NSIS installer
2828
#
2929
# Original downloaded here came from
30-
# http://releases.llvm.org/7.0.0/LLVM-7.0.0-win64.exe
31-
# That installer was run through `wine` on Linux and then the resulting
32-
# installation directory (found in `$HOME/.wine/drive_c/Program Files/LLVM`) was
33-
# packaged up into a tarball. We've had issues otherwise that the installer will
34-
# randomly hang, provide not a lot of useful information, pollute global state,
35-
# etc. In general the tarball is just more confined and easier to deal with when
36-
# working with various CI environments.
30+
# http://releases.llvm.org/9.0.0/LLVM-9.0.0-win64.exe
31+
# That installer was run through `wine ./installer.exe /S /NCRC` on Linux
32+
# and then the resulting installation directory (found in
33+
# `$HOME/.wine/drive_c/Program Files/LLVM`) was packaged up into a tarball.
34+
# We've had issues otherwise that the installer will randomly hang, provide
35+
# not a lot of useful information, pollute global state, etc. In general the
36+
# tarball is just more confined and easier to deal with when working with
37+
# various CI environments.
3738

3839
mkdir -p citools
3940
cd citools
40-
curl -f "${MIRRORS_BASE}/LLVM-7.0.0-win64.tar.gz" | tar xzf -
41+
curl -f "${MIRRORS_BASE}/LLVM-9.0.0-win64.tar.gz" | tar xzf -
4142
ciCommandSetEnv RUST_CONFIGURE_ARGS \
4243
"${RUST_CONFIGURE_ARGS} --set llvm.clang-cl=$(pwd)/clang-rust/bin/clang-cl.exe"
4344
fi

0 commit comments

Comments
 (0)