Skip to content

Fix command to run custom rustc #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,16 @@ $ ./test.sh --release

## Usage

`$cg_gccjit_dir` is the directory you cloned this repo into in the following instructions.
`$CG_GCCJIT_DIR` is the directory you cloned this repo into in the following instructions:

```bash
export CG_GCCJIT_DIR=[the full path to rustc_codegen_gcc]
```

### Cargo

```bash
$ CHANNEL="release" $cg_gccjit_dir/cargo.sh run
$ CHANNEL="release" $CG_GCCJIT_DIR/cargo.sh run
```

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.
Expand All @@ -92,7 +96,7 @@ If you compiled cg_gccjit in debug mode (aka you didn't pass `--release` to `./t
> You should prefer using the Cargo method.

```bash
$ 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
$ 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
```

## Env vars
Expand Down