rust/prepare_libcore.sh
bjorn3 1fb6912cfd Rustup to rustc 1.32.0-nightly (ca79ecd69 2018-11-11)
I had to put the original source of liballoc_system in tree, because it got removed from rustc
2018-11-12 19:37:54 +01:00

28 lines
634 B
Bash
Executable File

#!/bin/bash --verbose
set -e
SRC_DIR=$(dirname $(rustup which rustc))"/../lib/rustlib/src/rust/"
DST_DIR="target/libcore"
if [ ! -e $SRC_DIR ]; then
echo "Please install rust-src component"
exit 1
fi
rm -rf $DST_DIR
mkdir -p $DST_DIR/src
cp -r $SRC_DIR/src $DST_DIR/
pushd $DST_DIR
git init
git add .
git commit -m "Initial commit" -q
git apply ../../000*.patch
popd
# `alloc_system` has been merged with libstd, which doesn't build yet.
# This copies the original source to the sysroot source dir to simplify building it
cp -r alloc_system $DST_DIR/src/liballoc_system
echo "Successfully prepared libcore for building"