Skip to content

Commit 1881087

Browse files
committed
Update the doc to reflect the new way to specify the linker for cross-compilation
1 parent 21c8639 commit 1881087

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/tips.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ generate it in [gimple.md](./doc/gimple.md).
6262

6363
* Run `./y.sh prepare --cross` so that the sysroot is patched for the cross-compiling case.
6464
* Set the path to the cross-compiling libgccjit in `gcc-path` (in `config.toml`).
65-
* Make sure you have the linker for your target (for instance `m68k-unknown-linux-gnu-gcc`) in your `$PATH`. Currently, the linker name is hardcoded as being `$TARGET-gcc`. Specify the target when building the sysroot: `./y.sh build --sysroot --target-triple m68k-unknown-linux-gnu`.
66-
* Build your project by specifying the target: `../y.sh cargo build --target m68k-unknown-linux-gnu`.
65+
* Make sure you have the linker for your target (for instance `m68k-unknown-linux-gnu-gcc`) in your `$PATH`. You can specify which linker to use via `CG_RUSTFLAGS="-Clinker=<linker>"`, for instance: `CG_RUSTFLAGS="-Clinker=m68k-unknown-linux-gnu-gcc"`. Specify the target when building the sysroot: `./y.sh build --sysroot --target-triple m68k-unknown-linux-gnu`.
66+
* Build your project by specifying the target and the linker to use: `CG_RUSTFLAGS="-Clinker=m68k-unknown-linux-gnu-gcc" ../y.sh cargo build --target m68k-unknown-linux-gnu`.
6767

6868
If the target is not yet supported by the Rust compiler, create a [target specification file](https://docs.rust-embedded.org/embedonomicon/custom-target.html) (note that the `arch` specified in this file must be supported by the rust compiler).
6969
Then, you can use it the following way:

0 commit comments

Comments
 (0)