Skip to content

Commit 69c0a72

Browse files
petrhosekraggi
authored andcommitted
Update Fuchsia toolchain build
compiler-rt is now being built as part of the toolchain itself.
1 parent b314ed5 commit 69c0a72

File tree

3 files changed

+28
-103
lines changed

3 files changed

+28
-103
lines changed

src/ci/docker/dist-fuchsia/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1717
libncurses5-dev \
1818
patch
1919

20-
RUN curl -L https://cmake.org/files/v3.8/cmake-3.8.0-rc1-Linux-x86_64.tar.gz | \
20+
RUN curl -L https://cmake.org/files/v3.9/cmake-3.9.2-Linux-x86_64.tar.gz | \
2121
tar xzf - -C /usr/local --strip-components=1
2222

2323
WORKDIR /tmp
24-
COPY dist-fuchsia/shared.sh dist-fuchsia/build-toolchain.sh dist-fuchsia/compiler-rt-dso-handle.patch /tmp/
24+
COPY dist-fuchsia/shared.sh dist-fuchsia/build-toolchain.sh /tmp/
2525
RUN /tmp/build-toolchain.sh
2626

2727
COPY scripts/sccache.sh /scripts/

src/ci/docker/dist-fuchsia/build-toolchain.sh

Lines changed: 26 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ source shared.sh
1717
# Download sources
1818
SRCS=(
1919
"https://fuchsia.googlesource.com/zircon zircon e9a26dbc70d631029f8ee9763103910b7e3a2fe1"
20-
"https://llvm.googlesource.com/llvm llvm 3f58a16d8eec385e2b3ebdfbb84ff9d3bf27e025"
21-
"https://llvm.googlesource.com/clang llvm/tools/clang 727ea63e6e82677f6e10e05e08bc7d6bdbae3111"
22-
"https://llvm.googlesource.com/lld llvm/tools/lld a31286c1366e5e89b8872803fded13805a1a084b"
23-
"https://llvm.googlesource.com/lldb llvm/tools/lldb 0b2384abec4cb99ad66687712e07dee4dd9d187e"
24-
"https://llvm.googlesource.com/compiler-rt llvm/runtimes/compiler-rt 9093a35c599fe41278606a20b51095ea8bd5a081"
25-
"https://llvm.googlesource.com/libcxx llvm/runtimes/libcxx 607e0c71ec4f7fd377ad3f6c47b08dbe89f66eaa"
26-
"https://llvm.googlesource.com/libcxxabi llvm/runtimes/libcxxabi 0a3a1a8a5ca5ef69e0f6b7d5b9d13e63e6fd2c19"
27-
"https://llvm.googlesource.com/libunwind llvm/runtimes/libunwind e128003563d99d9ee62247c4cee40f07d21c03e3"
20+
"https://llvm.googlesource.com/llvm llvm 65bdf0ae4a87e6992c24f06e2612909952468710"
21+
"https://llvm.googlesource.com/clang llvm/tools/clang 914987de45cf83636537909ce09156aa7a37d6ec"
22+
"https://llvm.googlesource.com/lld llvm/tools/lld f8ed4483c589b390daafac92e28f4680ad052643"
23+
"https://llvm.googlesource.com/lldb llvm/tools/lldb 55cf8753321782668cb7e2d879457ee1ad57a2b9"
24+
"https://llvm.googlesource.com/compiler-rt llvm/runtimes/compiler-rt a8682fdf74d3cb93769b7394f2cdffc5cefb8bd8"
25+
"https://llvm.googlesource.com/libcxx llvm/runtimes/libcxx 5f919fe349450b3da0e29611ae37f6a940179290"
26+
"https://llvm.googlesource.com/libcxxabi llvm/runtimes/libcxxabi caa78daf9285dada17e3e6b8aebcf7d128427f83"
27+
"https://llvm.googlesource.com/libunwind llvm/runtimes/libunwind 469bacd2ea64679c15bb4d86adf000f2f2c27328"
2828
)
2929

3030
fetch() {
@@ -41,27 +41,7 @@ for i in "${SRCS[@]}"; do
4141
fetch $i
4242
done
4343

44-
# Remove this once https://reviews.llvm.org/D28791 is resolved
45-
cd llvm/runtimes/compiler-rt
46-
patch -Np1 < /tmp/compiler-rt-dso-handle.patch
47-
cd ../../..
48-
49-
# Build toolchain
50-
cd llvm
51-
mkdir build
52-
cd build
53-
hide_output cmake -GNinja \
54-
-DFUCHSIA_SYSROOT=${PWD}/../../zircon/third_party/ulib/musl \
55-
-DLLVM_ENABLE_LTO=OFF \
56-
-DCLANG_BOOTSTRAP_PASSTHROUGH=LLVM_ENABLE_LTO \
57-
-C ../tools/clang/cmake/caches/Fuchsia.cmake \
58-
..
59-
hide_output ninja stage2-distribution
60-
hide_output ninja stage2-install-distribution
61-
cd ../..
62-
6344
# Build sysroot
64-
rm -rf llvm/runtimes/compiler-rt
6545
./zircon/scripts/download-toolchain
6646

6747
build_sysroot() {
@@ -77,40 +57,26 @@ build_sysroot() {
7757
mkdir -p $dst
7858
cp -r zircon/build-${tgt}/sysroot/include $dst/
7959
cp -r zircon/build-${tgt}/sysroot/lib $dst/
80-
81-
cd llvm
82-
mkdir build-runtimes-${arch}
83-
cd build-runtimes-${arch}
84-
hide_output cmake -GNinja \
85-
-DCMAKE_C_COMPILER=clang \
86-
-DCMAKE_CXX_COMPILER=clang++ \
87-
-DCMAKE_AR=/usr/local/bin/llvm-ar \
88-
-DCMAKE_RANLIB=/usr/local/bin/llvm-ranlib \
89-
-DCMAKE_INSTALL_PREFIX= \
90-
-DLLVM_MAIN_SRC_DIR=${PWD}/.. \
91-
-DLLVM_BINARY_DIR=${PWD}/../build \
92-
-DLLVM_ENABLE_WERROR=OFF \
93-
-DCMAKE_BUILD_TYPE=Release \
94-
-DLLVM_INCLUDE_TESTS=ON \
95-
-DCMAKE_SYSTEM_NAME=Fuchsia \
96-
-DCMAKE_C_COMPILER_TARGET=${arch}-fuchsia \
97-
-DCMAKE_CXX_COMPILER_TARGET=${arch}-fuchsia \
98-
-DUNIX=1 \
99-
-DLIBCXX_HAS_MUSL_LIBC=ON \
100-
-DLIBCXXABI_USE_LLVM_UNWINDER=ON \
101-
-DCMAKE_SYSROOT=${dst} \
102-
-DCMAKE_C_COMPILER_FORCED=TRUE \
103-
-DCMAKE_CXX_COMPILER_FORCED=TRUE \
104-
-DLLVM_ENABLE_LIBCXX=ON \
105-
-DCMAKE_EXE_LINKER_FLAGS="-nodefaultlibs -lc" \
106-
-DCMAKE_SHARED_LINKER_FLAGS="$(clang --target=${arch}-fuchsia -print-libgcc-file-name)" \
107-
../runtimes
108-
hide_output env DESTDIR="${dst}" ninja install
109-
cd ../..
11060
}
11161

112-
build_sysroot "x86_64"
113-
build_sysroot "aarch64"
62+
for arch in x86_64 aarch64; do
63+
build_sysroot ${arch}
64+
done
65+
66+
# Build toolchain
67+
cd llvm
68+
mkdir build
69+
cd build
70+
hide_output cmake -GNinja \
71+
-DFUCHSIA_x86_64_SYSROOT=/usr/local/x86_64-unknown-fuchsia \
72+
-DFUCHSIA_aarch64_SYSROOT=/usr/local/aarch64-unknown-fuchsia \
73+
-DLLVM_ENABLE_LTO=OFF \
74+
-DCLANG_BOOTSTRAP_PASSTHROUGH=LLVM_ENABLE_LTO \
75+
-C ../tools/clang/cmake/caches/Fuchsia.cmake \
76+
..
77+
hide_output ninja stage2-distribution
78+
hide_output ninja stage2-install-distribution
79+
cd ../..
11480

11581
rm -rf zircon llvm
11682

src/ci/docker/dist-fuchsia/compiler-rt-dso-handle.patch

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)