2018-07-19 18:41:37 +02:00
|
|
|
#!/bin/bash --verbose
|
2018-09-18 18:41:41 +02:00
|
|
|
set -e
|
|
|
|
|
2018-10-06 11:30:32 +02:00
|
|
|
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
|
2018-10-06 14:57:06 +02:00
|
|
|
cp -r $SRC_DIR/src $DST_DIR/
|
|
|
|
|
2018-11-12 19:37:54 +01:00
|
|
|
pushd $DST_DIR
|
2018-09-18 18:41:41 +02:00
|
|
|
git init
|
|
|
|
git add .
|
|
|
|
git commit -m "Initial commit" -q
|
2018-12-03 18:50:00 +01:00
|
|
|
git apply ../../patches/*.patch
|
2018-11-12 19:37:54 +01:00
|
|
|
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
|
2018-09-18 18:41:41 +02:00
|
|
|
|
2018-07-19 18:41:37 +02:00
|
|
|
echo "Successfully prepared libcore for building"
|