File tree Expand file tree Collapse file tree 6 files changed +17
-13
lines changed
Expand file tree Collapse file tree 6 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ This should build and run your project with rustc_codegen_cranelift instead of t
5151> You should prefer using the Cargo method.
5252
5353``` bash
54- $ $cg_clif_dir /build/cg_clif my_crate.rs
54+ $ $cg_clif_dir /build/bin/ cg_clif my_crate.rs
5555```
5656
5757### Jit mode
@@ -68,7 +68,7 @@ $ $cg_clif_dir/build/cargo.sh jit
6868or
6969
7070``` bash
71- $ $cg_clif_dir /build/cg_clif --jit my_crate.rs
71+ $ $cg_clif_dir /build/bin/ cg_clif --jit my_crate.rs
7272```
7373
7474### Shell
@@ -77,7 +77,7 @@ These are a few functions that allow you to easily run rust code from the shell
7777
7878``` bash
7979function jit_naked() {
80- echo " $@ " | $cg_clif_dir /build/cg_clif - --jit
80+ echo " $@ " | $cg_clif_dir /build/bin/ cg_clif - --jit
8181}
8282
8383function jit() {
Original file line number Diff line number Diff line change 3636
3737rm -rf " $target_dir "
3838mkdir " $target_dir "
39- cp -a target/$CHANNEL /cg_clif{,_build_sysroot} target/$CHANNEL /* rustc_codegen_cranelift* " $target_dir /"
39+ mkdir " $target_dir " /bin " $target_dir " /lib
40+ cp -a target/$CHANNEL /cg_clif{,_build_sysroot} " $target_dir " /bin
41+ cp -a target/$CHANNEL /* rustc_codegen_cranelift* " $target_dir " /lib
4042cp -a rust-toolchain scripts/config.sh scripts/cargo.sh " $target_dir "
4143
4244if [[ " $build_sysroot " == " 1" ]]; then
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ dir=$(pwd)
1010
1111# Use rustc with cg_clif as hotpluggable backend instead of the custom cg_clif driver so that
1212# build scripts are still compiled using cg_llvm.
13- export RUSTC=$dir " /cg_clif_build_sysroot"
13+ export RUSTC=$dir " /bin/ cg_clif_build_sysroot"
1414export RUSTFLAGS=$RUSTFLAGS " --clif"
1515
1616cd " $( dirname " $0 " ) "
3535fi
3636
3737# Copy files to sysroot
38- mkdir -p " $dir /sysroot/ lib/rustlib/$TARGET_TRIPLE /lib/"
39- cp -a " target/$TARGET_TRIPLE /$sysroot_channel /deps/" * " $dir /sysroot/ lib/rustlib/$TARGET_TRIPLE /lib/"
40- rm " $dir /sysroot/ lib/rustlib/$TARGET_TRIPLE /lib/" * .{rmeta,d}
38+ mkdir -p " $dir /lib/rustlib/$TARGET_TRIPLE /lib/"
39+ cp -a " target/$TARGET_TRIPLE /$sysroot_channel /deps/" * " $dir /lib/rustlib/$TARGET_TRIPLE /lib/"
40+ rm " $dir /lib/rustlib/$TARGET_TRIPLE /lib/" * .{rmeta,d}
Original file line number Diff line number Diff line change 4343
4444dir=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " ; pwd)
4545
46- export RUSTC=$dir " /cg_clif"
46+ export RUSTC=$dir " /bin/ cg_clif"
4747export RUSTFLAGS=$linker " " $RUSTFLAGS
4848export RUSTDOCFLAGS=$linker ' -Cpanic=abort -Zpanic-abort-tests ' \
49- ' -Zcodegen-backend=' $dir ' /librustc_codegen_cranelift.' $dylib_ext ' --sysroot ' $dir ' /sysroot '
49+ ' -Zcodegen-backend=' $dir ' /lib/ librustc_codegen_cranelift.' $dylib_ext ' --sysroot ' $dir
5050
5151# FIXME remove once the atomic shim is gone
5252if [[ $( uname) == ' Darwin' ]]; then
5353 export RUSTFLAGS=" $RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
5454fi
5555
56- export LD_LIBRARY_PATH=" $dir :$( rustc --print sysroot) /lib:$dir /target/out:$dir /sysroot/lib/rustlib/$TARGET_TRIPLE /lib"
56+ export LD_LIBRARY_PATH=" $dir /lib :$( rustc --print sysroot) /lib:$dir /target/out:$dir /sysroot/lib/rustlib/$TARGET_TRIPLE /lib"
5757export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
5858
5959export CG_CLIF_DISPLAY_CG_TIME=1
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ cat > config.toml <<EOF
4848ninja = false
4949
5050[build]
51- rustc = "$( pwd) /../build/cg_clif"
51+ rustc = "$( pwd) /../build/bin/ cg_clif"
5252cargo = "$( rustup which cargo) "
5353full-bootstrap = true
5454local-rebuild = true
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
3232 . unwrap ( )
3333 . parent ( )
3434 . unwrap ( )
35- . join ( "sysroot" ) ,
35+ . parent ( )
36+ . unwrap ( )
37+ . to_owned ( ) ,
3638 ) ,
3739 ) ;
3840 }
You can’t perform that action at this time.
0 commit comments