Skip to content

Commit 2b8fe8f

Browse files
authored
Merge pull request #317 from GuillaumeGomez/fix-command
Fix command to run custom rustc
2 parents 2f11b37 + 4cbf1c7 commit 2b8fe8f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Readme.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,16 @@ $ ./test.sh --release
7777

7878
## Usage
7979

80-
`$cg_gccjit_dir` is the directory you cloned this repo into in the following instructions.
80+
`$CG_GCCJIT_DIR` is the directory you cloned this repo into in the following instructions:
81+
82+
```bash
83+
export CG_GCCJIT_DIR=[the full path to rustc_codegen_gcc]
84+
```
8185

8286
### Cargo
8387

8488
```bash
85-
$ CHANNEL="release" $cg_gccjit_dir/cargo.sh run
89+
$ CHANNEL="release" $CG_GCCJIT_DIR/cargo.sh run
8690
```
8791

8892
If you compiled cg_gccjit in debug mode (aka you didn't pass `--release` to `./test.sh`) you should use `CHANNEL="debug"` instead or omit `CHANNEL="release"` completely.
@@ -92,7 +96,7 @@ If you compiled cg_gccjit in debug mode (aka you didn't pass `--release` to `./t
9296
> You should prefer using the Cargo method.
9397
9498
```bash
95-
$ rustc +$(cat $cg_gccjit_dir/rust-toolchain) -Cpanic=abort -Zcodegen-backend=$cg_gccjit_dir/target/release/librustc_codegen_gcc.so --sysroot $cg_gccjit_dir/build_sysroot/sysroot my_crate.rs
99+
$ LIBRARY_PATH=$(cat gcc_path) LD_LIBRARY_PATH=$(cat gcc_path) rustc +$(cat $CG_GCCJIT_DIR/rust-toolchain | grep 'channel' | cut -d '=' -f 2 | sed 's/"//g' | sed 's/ //g') -Cpanic=abort -Zcodegen-backend=$CG_GCCJIT_DIR/target/release/librustc_codegen_gcc.so --sysroot $CG_GCCJIT_DIR/build_sysroot/sysroot my_crate.rs
96100
```
97101

98102
## Env vars

0 commit comments

Comments
 (0)