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
51
51
> You should prefer using the Cargo method.
52
52
53
53
``` bash
54
- $ $cg_clif_dir /build/cg_clif my_crate.rs
54
+ $ $cg_clif_dir /build/bin/ cg_clif my_crate.rs
55
55
```
56
56
57
57
### Jit mode
@@ -68,7 +68,7 @@ $ $cg_clif_dir/build/cargo.sh jit
68
68
or
69
69
70
70
``` bash
71
- $ $cg_clif_dir /build/cg_clif --jit my_crate.rs
71
+ $ $cg_clif_dir /build/bin/ cg_clif --jit my_crate.rs
72
72
```
73
73
74
74
### Shell
@@ -77,7 +77,7 @@ These are a few functions that allow you to easily run rust code from the shell
77
77
78
78
``` bash
79
79
function jit_naked() {
80
- echo " $@ " | $cg_clif_dir /build/cg_clif - --jit
80
+ echo " $@ " | $cg_clif_dir /build/bin/ cg_clif - --jit
81
81
}
82
82
83
83
function jit() {
Original file line number Diff line number Diff line change 36
36
37
37
rm -rf " $target_dir "
38
38
mkdir " $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
40
42
cp -a rust-toolchain scripts/config.sh scripts/cargo.sh " $target_dir "
41
43
42
44
if [[ " $build_sysroot " == " 1" ]]; then
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ dir=$(pwd)
10
10
11
11
# Use rustc with cg_clif as hotpluggable backend instead of the custom cg_clif driver so that
12
12
# 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"
14
14
export RUSTFLAGS=$RUSTFLAGS " --clif"
15
15
16
16
cd " $( dirname " $0 " ) "
35
35
fi
36
36
37
37
# 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 43
43
44
44
dir=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " ; pwd)
45
45
46
- export RUSTC=$dir " /cg_clif"
46
+ export RUSTC=$dir " /bin/ cg_clif"
47
47
export RUSTFLAGS=$linker " " $RUSTFLAGS
48
48
export 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
50
50
51
51
# FIXME remove once the atomic shim is gone
52
52
if [[ $( uname) == ' Darwin' ]]; then
53
53
export RUSTFLAGS=" $RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
54
54
fi
55
55
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"
57
57
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
58
58
59
59
export CG_CLIF_DISPLAY_CG_TIME=1
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ cat > config.toml <<EOF
48
48
ninja = false
49
49
50
50
[build]
51
- rustc = "$( pwd) /../build/cg_clif"
51
+ rustc = "$( pwd) /../build/bin/ cg_clif"
52
52
cargo = "$( rustup which cargo) "
53
53
full-bootstrap = true
54
54
local-rebuild = true
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
32
32
. unwrap ( )
33
33
. parent ( )
34
34
. unwrap ( )
35
- . join ( "sysroot" ) ,
35
+ . parent ( )
36
+ . unwrap ( )
37
+ . to_owned ( ) ,
36
38
) ,
37
39
) ;
38
40
}
You can’t perform that action at this time.
0 commit comments