2 # Copyright 2017 The Rust Project Developers. See the COPYRIGHT
3 # file at the top-level directory of this distribution and at
4 # http://rust-lang.org/COPYRIGHT.
6 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9 # option. This file may not be copied, modified, or distributed
10 # except according to those terms.
12 # ignore-tidy-linelength
17 ZIRCON=e9a26dbc70d631029f8ee9763103910b7e3a2fe1
20 pushd zircon > /dev/null
24 git remote add origin https://fuchsia.googlesource.com/zircon
25 git fetch --depth=1 origin $ZIRCON
26 git reset --hard FETCH_HEAD
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
37 x86_64) tgt="zircon-pc-x86-64" ;;
38 aarch64) tgt="zircon-qemu-arm64" ;;
41 hide_output make -j$(getconf _NPROCESSORS_ONLN) $tgt
42 dst=/usr/local/${arch}-unknown-fuchsia
44 cp -a build-${tgt}/sysroot/include $dst/
45 cp -a build-${tgt}/sysroot/lib $dst/
49 for arch in x86_64 aarch64; do
56 for arch in x86_64 aarch64; do
57 for tool in clang clang++; do
58 cat >/usr/local/bin/${arch}-unknown-fuchsia-${tool} <<EOF
60 ${tool} --target=${arch}-unknown-fuchsia --sysroot=/usr/local/${arch}-unknown-fuchsia "\$@"
62 chmod +x /usr/local/bin/${arch}-unknown-fuchsia-${tool}
64 ln -s /usr/local/bin/llvm-ar /usr/local/bin/${arch}-unknown-fuchsia-ar