> 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
or
```bash
-$ $cg_clif_dir/build/cg_clif --jit my_crate.rs
+$ $cg_clif_dir/build/bin/cg_clif --jit my_crate.rs
```
### Shell
```bash
function jit_naked() {
- echo "$@" | $cg_clif_dir/build/cg_clif - --jit
+ echo "$@" | $cg_clif_dir/build/bin/cg_clif - --jit
}
function jit() {
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
# 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")"
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}
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
ninja = false
[build]
-rustc = "$(pwd)/../build/cg_clif"
+rustc = "$(pwd)/../build/bin/cg_clif"
cargo = "$(rustup which cargo)"
full-bootstrap = true
local-rebuild = true
.unwrap()
.parent()
.unwrap()
- .join("sysroot"),
+ .parent()
+ .unwrap()
+ .to_owned(),
),
);
}