about summary refs log tree commit diff
path: root/src/ci/docker
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-09-25 05:05:14 +0000
committerbors <bors@rust-lang.org>2017-09-25 05:05:14 +0000
commitcd93969ec4fb2d0bc2b5376aec269cf08491187b (patch)
tree700a94606a181eaf708c80335232ed7778e7b5c8 /src/ci/docker
parent7a9cdc4c2a98c3a889604762dccd463757079798 (diff)
parenta3aef1aa95a3f2807b80af0336c4fe14dba06bb1 (diff)
downloadrust-cd93969ec4fb2d0bc2b5376aec269cf08491187b.tar.gz
rust-cd93969ec4fb2d0bc2b5376aec269cf08491187b.zip
Auto merge of #44612 - pylaligand:magenta-to-zircon, r=alexcrichton
The Magenta kernel is now called Zircon.
Diffstat (limited to 'src/ci/docker')
-rw-r--r--src/ci/docker/dist-fuchsia/Dockerfile29
-rwxr-xr-xsrc/ci/docker/dist-fuchsia/build-toolchain.sh109
-rw-r--r--src/ci/docker/dist-fuchsia/compiler-rt-dso-handle.patch41
3 files changed, 38 insertions, 141 deletions
diff --git a/src/ci/docker/dist-fuchsia/Dockerfile b/src/ci/docker/dist-fuchsia/Dockerfile
index e18cb453baf..bcd95924b42 100644
--- a/src/ci/docker/dist-fuchsia/Dockerfile
+++ b/src/ci/docker/dist-fuchsia/Dockerfile
@@ -1,27 +1,26 @@
 FROM ubuntu:16.04
 
-RUN apt-get update && apt-get install -y --no-install-recommends \
+RUN apt-get update && apt-get build-dep -y clang llvm && apt-get install -y \
+  build-essential \
+  bzip2 \
+  ca-certificates \
+  cmake \
+  curl \
+  file \
   g++ \
+  gdb \
+  git \
+  libedit-dev \
   make \
   ninja-build \
-  file \
-  curl \
-  ca-certificates \
+  nodejs \
   python2.7-dev \
-  git \
   sudo \
-  bzip2 \
   xz-utils \
-  swig \
-  libedit-dev \
-  libncurses5-dev \
-  patch
-
-RUN curl -L https://cmake.org/files/v3.8/cmake-3.8.0-rc1-Linux-x86_64.tar.gz | \
-      tar xzf - -C /usr/local --strip-components=1
+  unzip
 
 WORKDIR /tmp
-COPY dist-fuchsia/shared.sh dist-fuchsia/build-toolchain.sh dist-fuchsia/compiler-rt-dso-handle.patch /tmp/
+COPY dist-fuchsia/shared.sh dist-fuchsia/build-toolchain.sh /tmp/
 RUN /tmp/build-toolchain.sh
 
 COPY scripts/sccache.sh /scripts/
@@ -39,4 +38,4 @@ ENV TARGETS=x86_64-unknown-fuchsia
 ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
 
 ENV RUST_CONFIGURE_ARGS --target=$TARGETS --enable-extended
-ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
+ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
\ No newline at end of file
diff --git a/src/ci/docker/dist-fuchsia/build-toolchain.sh b/src/ci/docker/dist-fuchsia/build-toolchain.sh
index 10b285a5466..756013a235c 100755
--- a/src/ci/docker/dist-fuchsia/build-toolchain.sh
+++ b/src/ci/docker/dist-fuchsia/build-toolchain.sh
@@ -14,105 +14,44 @@
 set -ex
 source shared.sh
 
-# Download sources
-SRCS=(
-  "https://fuchsia.googlesource.com/magenta magenta d17073dc8de344ead3b65e8cc6a12280dec38c84"
-  "https://llvm.googlesource.com/llvm llvm 3f58a16d8eec385e2b3ebdfbb84ff9d3bf27e025"
-  "https://llvm.googlesource.com/clang llvm/tools/clang 727ea63e6e82677f6e10e05e08bc7d6bdbae3111"
-  "https://llvm.googlesource.com/lld llvm/tools/lld a31286c1366e5e89b8872803fded13805a1a084b"
-  "https://llvm.googlesource.com/lldb llvm/tools/lldb 0b2384abec4cb99ad66687712e07dee4dd9d187e"
-  "https://llvm.googlesource.com/compiler-rt llvm/runtimes/compiler-rt 9093a35c599fe41278606a20b51095ea8bd5a081"
-  "https://llvm.googlesource.com/libcxx llvm/runtimes/libcxx 607e0c71ec4f7fd377ad3f6c47b08dbe89f66eaa"
-  "https://llvm.googlesource.com/libcxxabi llvm/runtimes/libcxxabi 0a3a1a8a5ca5ef69e0f6b7d5b9d13e63e6fd2c19"
-  "https://llvm.googlesource.com/libunwind llvm/runtimes/libunwind e128003563d99d9ee62247c4cee40f07d21c03e3"
-)
-
-fetch() {
-  mkdir -p $2
-  pushd $2 > /dev/null
-  git init
-  git remote add origin $1
-  git fetch --depth=1 origin $3
-  git reset --hard FETCH_HEAD
-  popd > /dev/null
-}
+ZIRCON=e9a26dbc70d631029f8ee9763103910b7e3a2fe1
 
-for i in "${SRCS[@]}"; do
-  fetch $i
-done
+mkdir -p zircon
+pushd zircon > /dev/null
 
-# Remove this once https://reviews.llvm.org/D28791 is resolved
-cd llvm/runtimes/compiler-rt
-patch -Np1 < /tmp/compiler-rt-dso-handle.patch
-cd ../../..
+# Download sources
+git init
+git remote add origin https://fuchsia.googlesource.com/zircon
+git fetch --depth=1 origin $ZIRCON
+git reset --hard FETCH_HEAD
 
-# Build toolchain
-cd llvm
-mkdir build
-cd build
-hide_output cmake -GNinja \
-  -DFUCHSIA_SYSROOT=${PWD}/../../magenta/third_party/ulib/musl \
-  -DLLVM_ENABLE_LTO=OFF \
-  -DCLANG_BOOTSTRAP_PASSTHROUGH=LLVM_ENABLE_LTO \
-  -C ../tools/clang/cmake/caches/Fuchsia.cmake \
-  ..
-hide_output ninja stage2-distribution
-hide_output ninja stage2-install-distribution
-cd ../..
+# Download toolchain
+./scripts/download-toolchain
+chmod -R a+rx prebuilt/downloads/clang+llvm-x86_64-linux
+cp -a prebuilt/downloads/clang+llvm-x86_64-linux/. /usr/local
 
-# Build sysroot
-rm -rf llvm/runtimes/compiler-rt
-./magenta/scripts/download-toolchain
-
-build_sysroot() {
+build() {
   local arch="$1"
 
   case "${arch}" in
-    x86_64) tgt="magenta-pc-x86-64" ;;
-    aarch64) tgt="magenta-qemu-arm64" ;;
+    x86_64) tgt="zircon-pc-x86-64" ;;
+    aarch64) tgt="zircon-qemu-arm64" ;;
   esac
 
-  hide_output make -C magenta -j$(getconf _NPROCESSORS_ONLN) $tgt
+  hide_output make -j$(getconf _NPROCESSORS_ONLN) $tgt
   dst=/usr/local/${arch}-unknown-fuchsia
   mkdir -p $dst
-  cp -r magenta/build-${tgt}/sysroot/include $dst/
-  cp -r magenta/build-${tgt}/sysroot/lib $dst/
-
-  cd llvm
-  mkdir build-runtimes-${arch}
-  cd build-runtimes-${arch}
-  hide_output cmake -GNinja \
-    -DCMAKE_C_COMPILER=clang \
-    -DCMAKE_CXX_COMPILER=clang++ \
-    -DCMAKE_AR=/usr/local/bin/llvm-ar \
-    -DCMAKE_RANLIB=/usr/local/bin/llvm-ranlib \
-    -DCMAKE_INSTALL_PREFIX= \
-    -DLLVM_MAIN_SRC_DIR=${PWD}/.. \
-    -DLLVM_BINARY_DIR=${PWD}/../build \
-    -DLLVM_ENABLE_WERROR=OFF \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DLLVM_INCLUDE_TESTS=ON \
-    -DCMAKE_SYSTEM_NAME=Fuchsia \
-    -DCMAKE_C_COMPILER_TARGET=${arch}-fuchsia \
-    -DCMAKE_CXX_COMPILER_TARGET=${arch}-fuchsia \
-    -DUNIX=1 \
-    -DLIBCXX_HAS_MUSL_LIBC=ON \
-    -DLIBCXXABI_USE_LLVM_UNWINDER=ON \
-    -DCMAKE_SYSROOT=${dst} \
-    -DCMAKE_C_COMPILER_FORCED=TRUE \
-    -DCMAKE_CXX_COMPILER_FORCED=TRUE \
-    -DLLVM_ENABLE_LIBCXX=ON \
-    -DCMAKE_EXE_LINKER_FLAGS="-nodefaultlibs -lc" \
-    -DCMAKE_SHARED_LINKER_FLAGS="$(clang --target=${arch}-fuchsia -print-libgcc-file-name)" \
-    ../runtimes
-  hide_output env DESTDIR="${dst}" ninja install
-  cd ../..
+  cp -a build-${tgt}/sysroot/include $dst/
+  cp -a build-${tgt}/sysroot/lib $dst/
 }
 
-build_sysroot "x86_64"
-build_sysroot "aarch64"
+# Build sysroot
+for arch in x86_64 aarch64; do
+  build ${arch}
+done
 
-rm -rf magenta llvm
+popd > /dev/null
+rm -rf zircon
 
 for arch in x86_64 aarch64; do
   for tool in clang clang++; do
diff --git a/src/ci/docker/dist-fuchsia/compiler-rt-dso-handle.patch b/src/ci/docker/dist-fuchsia/compiler-rt-dso-handle.patch
deleted file mode 100644
index 0b702894bb2..00000000000
--- a/src/ci/docker/dist-fuchsia/compiler-rt-dso-handle.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
-index fc4384af2..b442264c0 100644
---- a/lib/builtins/CMakeLists.txt
-+++ b/lib/builtins/CMakeLists.txt
-@@ -194,6 +194,12 @@ if(APPLE)
-     atomic_thread_fence.c)
- endif()
- 
-+if(FUCHSIA)
-+  set(GENERIC_SOURCES
-+    ${GENERIC_SOURCES}
-+    dso_handle.c)
-+endif()
-+
- if(NOT WIN32 OR MINGW)
-   set(GENERIC_SOURCES
-       ${GENERIC_SOURCES}
-diff --git a/lib/builtins/dso_handle.c b/lib/builtins/dso_handle.c
-new file mode 100644
-index 000000000..7766cd0aa
---- /dev/null
-+++ b/lib/builtins/dso_handle.c
-@@ -0,0 +1,18 @@
-+/* ===-- dso_handle.c - Provide __dso_handle -------------------------------===
-+ *
-+ *               The LLVM Compiler Infrastructure
-+ *
-+ * This file is dual licensed under the MIT and the University of Illinois Open
-+ * Source Licenses. See LICENSE.TXT for details.
-+ *
-+ * ===----------------------------------------------------------------------===
-+ */
-+
-+/* __dso_handle symbol is mandated by C++ ABI with a value which is an address
-+ * in one of the object's segments, and as such this symbol has to be included
-+ * statically and cannot be a part of a shared library. Traditionally, it has
-+ * been defined in crtbegin.o but there's no principled reason for it to be
-+ * there. We defined this symbol in the builtin library which is built as a
-+ * static library and always included in the final link.
-+ */
-+__attribute__((visibility("hidden"))) void *const __dso_handle;