about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-08-15 22:28:52 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2023-08-16 13:55:22 +0200
commit4cbf1c76ff0d8b35c08a841aadee52f26be564d1 (patch)
tree9dc7d0f7563af3e533372ecf7efdd921664ee933
parent2f11b37c80e82852e1e47ae7cbcc5c07cf95f497 (diff)
downloadrust-4cbf1c76ff0d8b35c08a841aadee52f26be564d1.tar.gz
rust-4cbf1c76ff0d8b35c08a841aadee52f26be564d1.zip
Fix command to run custom rustc
-rw-r--r--Readme.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/Readme.md b/Readme.md
index 55daad6dcd0..254aad61123 100644
--- a/Readme.md
+++ b/Readme.md
@@ -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.
@@ -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