From 0df21d27c994ef256329c91d8981a173a6a39f44 Mon Sep 17 00:00:00 2001 From: melhuishj Date: Mon, 10 Oct 2022 21:27:46 -0500 Subject: [PATCH 1/2] Update qemu.md with debugging information --- src/start/qemu.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/start/qemu.md b/src/start/qemu.md index d4dfc361..bade873b 100644 --- a/src/start/qemu.md +++ b/src/start/qemu.md @@ -168,6 +168,26 @@ cargo build --target thumbv7m-none-eabi cargo build ``` +> **NOTE**: If you encounter an error during this build step, you may need to switch +> to the GNU linker. This is achieved by commenting out the LLD linker and +> uncommenting the GNU linker in `.cargo/config` likebelow. +> ```toml +> # LLD (shipped with the Rust toolchain) is used as the default linker +> # "-C", "link-arg=-Tlink.x", +> +> # if you run into problems with LLD switch to the GNU linker by commenting out +> # this line +> "-C", "linker=arm-none-eabi-ld", +> ``` +> At this point you should +> ```console +> cargo clean +> cargo build +> ``` +> If you encounter ``error: linker `arm-none-eabi-ld` not found`` you will need to +> install `libnewlib-arm-none-eabi` (`sudo apt install libnewlib-arm-none-eabi` in +> Ubuntu/Debian). You may also need to `clean` before building again like above. + ## Inspecting Now we have a non-native ELF binary in `target/thumbv7m-none-eabi/debug/app`. We From 8afa0ae2d48a8c5331e1a718baaf70c4a58a5684 Mon Sep 17 00:00:00 2001 From: melhuishj Date: Mon, 10 Oct 2022 21:32:20 -0500 Subject: [PATCH 2/2] Update qemu.md --- src/start/qemu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/start/qemu.md b/src/start/qemu.md index bade873b..c9992e79 100644 --- a/src/start/qemu.md +++ b/src/start/qemu.md @@ -170,7 +170,7 @@ cargo build > **NOTE**: If you encounter an error during this build step, you may need to switch > to the GNU linker. This is achieved by commenting out the LLD linker and -> uncommenting the GNU linker in `.cargo/config` likebelow. +> uncommenting the GNU linker in `.cargo/config` like below. > ```toml > # LLD (shipped with the Rust toolchain) is used as the default linker > # "-C", "link-arg=-Tlink.x",