diff --git a/Readme.md b/Readme.md index f8a5e13ed54..de54bf67f4a 100644 --- a/Readme.md +++ b/Readme.md @@ -51,7 +51,7 @@ This should build and run your project with rustc_codegen_cranelift instead of t > You should prefer using the Cargo method. ```bash -$ $cg_clif_dir/build/cg_clif my_crate.rs +$ $cg_clif_dir/build/bin/cg_clif my_crate.rs ``` ### Jit mode @@ -68,7 +68,7 @@ $ $cg_clif_dir/build/cargo.sh jit or ```bash -$ $cg_clif_dir/build/cg_clif --jit my_crate.rs +$ $cg_clif_dir/build/bin/cg_clif --jit my_crate.rs ``` ### Shell @@ -77,7 +77,7 @@ These are a few functions that allow you to easily run rust code from the shell ```bash function jit_naked() { - echo "$@" | $cg_clif_dir/build/cg_clif - --jit + echo "$@" | $cg_clif_dir/build/bin/cg_clif - --jit } function jit() { diff --git a/build.sh b/build.sh index fcaa99a0f7b..3d77d1d8729 100755 --- a/build.sh +++ b/build.sh @@ -36,7 +36,9 @@ fi rm -rf "$target_dir" mkdir "$target_dir" -cp -a target/$CHANNEL/cg_clif{,_build_sysroot} target/$CHANNEL/*rustc_codegen_cranelift* "$target_dir/" +mkdir "$target_dir"/bin "$target_dir"/lib +cp -a target/$CHANNEL/cg_clif{,_build_sysroot} "$target_dir"/bin +cp -a target/$CHANNEL/*rustc_codegen_cranelift* "$target_dir"/lib cp -a rust-toolchain scripts/config.sh scripts/cargo.sh "$target_dir" if [[ "$build_sysroot" == "1" ]]; then diff --git a/build_sysroot/build_sysroot.sh b/build_sysroot/build_sysroot.sh index c356482058a..0223cf74e81 100755 --- a/build_sysroot/build_sysroot.sh +++ b/build_sysroot/build_sysroot.sh @@ -10,7 +10,7 @@ dir=$(pwd) # Use rustc with cg_clif as hotpluggable backend instead of the custom cg_clif driver so that # build scripts are still compiled using cg_llvm. -export RUSTC=$dir"/cg_clif_build_sysroot" +export RUSTC=$dir"/bin/cg_clif_build_sysroot" export RUSTFLAGS=$RUSTFLAGS" --clif" cd "$(dirname "$0")" @@ -35,6 +35,6 @@ else fi # Copy files to sysroot -mkdir -p "$dir/sysroot/lib/rustlib/$TARGET_TRIPLE/lib/" -cp -a "target/$TARGET_TRIPLE/$sysroot_channel/deps/"* "$dir/sysroot/lib/rustlib/$TARGET_TRIPLE/lib/" -rm "$dir/sysroot/lib/rustlib/$TARGET_TRIPLE/lib/"*.{rmeta,d} +mkdir -p "$dir/lib/rustlib/$TARGET_TRIPLE/lib/" +cp -a "target/$TARGET_TRIPLE/$sysroot_channel/deps/"* "$dir/lib/rustlib/$TARGET_TRIPLE/lib/" +rm "$dir/lib/rustlib/$TARGET_TRIPLE/lib/"*.{rmeta,d} diff --git a/scripts/config.sh b/scripts/config.sh index 10c0ec0e293..1ac6bf265b4 100644 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -43,17 +43,17 @@ fi dir=$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd) -export RUSTC=$dir"/cg_clif" +export RUSTC=$dir"/bin/cg_clif" export RUSTFLAGS=$linker" "$RUSTFLAGS export RUSTDOCFLAGS=$linker' -Cpanic=abort -Zpanic-abort-tests '\ -'-Zcodegen-backend='$dir'/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$dir'/sysroot' +'-Zcodegen-backend='$dir'/lib/librustc_codegen_cranelift.'$dylib_ext' --sysroot '$dir # FIXME remove once the atomic shim is gone if [[ $(uname) == 'Darwin' ]]; then export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup" fi -export LD_LIBRARY_PATH="$dir:$(rustc --print sysroot)/lib:$dir/target/out:$dir/sysroot/lib/rustlib/$TARGET_TRIPLE/lib" +export LD_LIBRARY_PATH="$dir/lib:$(rustc --print sysroot)/lib:$dir/target/out:$dir/sysroot/lib/rustlib/$TARGET_TRIPLE/lib" export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH export CG_CLIF_DISPLAY_CG_TIME=1 diff --git a/scripts/test_bootstrap.sh b/scripts/test_bootstrap.sh index e8d5c628638..db69541b226 100755 --- a/scripts/test_bootstrap.sh +++ b/scripts/test_bootstrap.sh @@ -48,7 +48,7 @@ cat > config.toml <