2018-06-17 16:05:11 +00:00
|
|
|
cargo build || exit 1
|
|
|
|
|
2018-07-30 16:20:37 +00:00
|
|
|
cd examples/
|
2018-07-20 11:38:49 +00:00
|
|
|
|
2018-08-08 17:46:16 +00:00
|
|
|
unamestr=`uname`
|
|
|
|
if [[ "$unamestr" == 'Linux' ]]; then
|
|
|
|
dylib_ext='so'
|
|
|
|
elif [[ "$unamestr" == 'Darwin' ]]; then
|
|
|
|
dylib_ext='dylib'
|
|
|
|
else
|
|
|
|
echo "Unsupported os"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-08-09 08:55:13 +00:00
|
|
|
RUSTC="rustc -Zcodegen-backend=$(pwd)/../target/debug/librustc_codegen_cranelift.$dylib_ext -L crate=. --crate-type lib -Og"
|
2018-07-30 16:20:37 +00:00
|
|
|
|
|
|
|
$RUSTC mini_core.rs --crate-name mini_core &&
|
|
|
|
$RUSTC example.rs &&
|
|
|
|
$RUSTC mini_core_hello_world.rs &&
|
2018-08-09 13:08:54 +00:00
|
|
|
$RUSTC ../target/libcore/src/libcore/lib.rs 2>&1 | (head -n 10; echo "===="; tail -n 1000) ||
|
2018-08-09 08:55:13 +00:00
|
|
|
(rm *.rlib; exit 1)
|
2018-07-30 16:20:37 +00:00
|
|
|
|
|
|
|
rm *.rlib
|