Skip to content

Commit cd93969

Browse files
committed
Auto merge of #44612 - pylaligand:magenta-to-zircon, r=alexcrichton
The Magenta kernel is now called Zircon.
2 parents 7a9cdc4 + a3aef1a commit cd93969

File tree

11 files changed

+181
-280
lines changed

11 files changed

+181
-280
lines changed

src/bootstrap/sanity.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,9 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
221221
let run = |cmd: &mut Command| {
222222
cmd.output().map(|output| {
223223
String::from_utf8_lossy(&output.stdout)
224-
.lines().next().unwrap()
225-
.to_string()
224+
.lines().next().unwrap_or_else(|| {
225+
panic!("{:?} failed {:?}", cmd, output)
226+
}).to_string()
226227
})
227228
};
228229
build.lldb_version = run(Command::new("lldb").arg("--version")).ok();

src/ci/docker/dist-fuchsia/Dockerfile

+14-15
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
FROM ubuntu:16.04
22

3-
RUN apt-get update && apt-get install -y --no-install-recommends \
3+
RUN apt-get update && apt-get build-dep -y clang llvm && apt-get install -y \
4+
build-essential \
5+
bzip2 \
6+
ca-certificates \
7+
cmake \
8+
curl \
9+
file \
410
g++ \
11+
gdb \
12+
git \
13+
libedit-dev \
514
make \
615
ninja-build \
7-
file \
8-
curl \
9-
ca-certificates \
16+
nodejs \
1017
python2.7-dev \
11-
git \
1218
sudo \
13-
bzip2 \
1419
xz-utils \
15-
swig \
16-
libedit-dev \
17-
libncurses5-dev \
18-
patch
19-
20-
RUN curl -L https://cmake.org/files/v3.8/cmake-3.8.0-rc1-Linux-x86_64.tar.gz | \
21-
tar xzf - -C /usr/local --strip-components=1
20+
unzip
2221

2322
WORKDIR /tmp
24-
COPY dist-fuchsia/shared.sh dist-fuchsia/build-toolchain.sh dist-fuchsia/compiler-rt-dso-handle.patch /tmp/
23+
COPY dist-fuchsia/shared.sh dist-fuchsia/build-toolchain.sh /tmp/
2524
RUN /tmp/build-toolchain.sh
2625

2726
COPY scripts/sccache.sh /scripts/
@@ -39,4 +38,4 @@ ENV TARGETS=x86_64-unknown-fuchsia
3938
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
4039

4140
ENV RUST_CONFIGURE_ARGS --target=$TARGETS --enable-extended
42-
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
41+
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS

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

+24-85
Original file line numberDiff line numberDiff line change
@@ -14,105 +14,44 @@
1414
set -ex
1515
source shared.sh
1616

17-
# Download sources
18-
SRCS=(
19-
"https://fuchsia.googlesource.com/magenta magenta d17073dc8de344ead3b65e8cc6a12280dec38c84"
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"
28-
)
29-
30-
fetch() {
31-
mkdir -p $2
32-
pushd $2 > /dev/null
33-
git init
34-
git remote add origin $1
35-
git fetch --depth=1 origin $3
36-
git reset --hard FETCH_HEAD
37-
popd > /dev/null
38-
}
17+
ZIRCON=e9a26dbc70d631029f8ee9763103910b7e3a2fe1
3918

40-
for i in "${SRCS[@]}"; do
41-
fetch $i
42-
done
19+
mkdir -p zircon
20+
pushd zircon > /dev/null
4321

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 ../../..
22+
# Download sources
23+
git init
24+
git remote add origin https://fuchsia.googlesource.com/zircon
25+
git fetch --depth=1 origin $ZIRCON
26+
git reset --hard FETCH_HEAD
4827

49-
# Build toolchain
50-
cd llvm
51-
mkdir build
52-
cd build
53-
hide_output cmake -GNinja \
54-
-DFUCHSIA_SYSROOT=${PWD}/../../magenta/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 ../..
28+
# Download toolchain
29+
./scripts/download-toolchain
30+
chmod -R a+rx prebuilt/downloads/clang+llvm-x86_64-linux
31+
cp -a prebuilt/downloads/clang+llvm-x86_64-linux/. /usr/local
6232

63-
# Build sysroot
64-
rm -rf llvm/runtimes/compiler-rt
65-
./magenta/scripts/download-toolchain
66-
67-
build_sysroot() {
33+
build() {
6834
local arch="$1"
6935

7036
case "${arch}" in
71-
x86_64) tgt="magenta-pc-x86-64" ;;
72-
aarch64) tgt="magenta-qemu-arm64" ;;
37+
x86_64) tgt="zircon-pc-x86-64" ;;
38+
aarch64) tgt="zircon-qemu-arm64" ;;
7339
esac
7440

75-
hide_output make -C magenta -j$(getconf _NPROCESSORS_ONLN) $tgt
41+
hide_output make -j$(getconf _NPROCESSORS_ONLN) $tgt
7642
dst=/usr/local/${arch}-unknown-fuchsia
7743
mkdir -p $dst
78-
cp -r magenta/build-${tgt}/sysroot/include $dst/
79-
cp -r magenta/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 ../..
44+
cp -a build-${tgt}/sysroot/include $dst/
45+
cp -a build-${tgt}/sysroot/lib $dst/
11046
}
11147

112-
build_sysroot "x86_64"
113-
build_sysroot "aarch64"
48+
# Build sysroot
49+
for arch in x86_64 aarch64; do
50+
build ${arch}
51+
done
11452

115-
rm -rf magenta llvm
53+
popd > /dev/null
54+
rm -rf zircon
11655

11756
for arch in x86_64 aarch64; do
11857
for tool in clang clang++; do

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

-41
This file was deleted.

src/libstd/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ fn main() {
6868
if cfg!(feature = "backtrace") {
6969
println!("cargo:rustc-link-lib=backtrace");
7070
}
71-
println!("cargo:rustc-link-lib=magenta");
72-
println!("cargo:rustc-link-lib=mxio");
71+
println!("cargo:rustc-link-lib=zircon");
72+
println!("cargo:rustc-link-lib=fdio");
7373
println!("cargo:rustc-link-lib=launchpad"); // for std::process
7474
}
7575
}

src/libstd/sys/unix/process/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ mod process_inner;
1919
#[path = "process_fuchsia.rs"]
2020
mod process_inner;
2121
#[cfg(target_os = "fuchsia")]
22-
mod magenta;
22+
mod zircon;

0 commit comments

Comments
 (0)