Skip to content

Commit affd24f

Browse files
committed
document another common error
overwriting the `.cargo/config` file instead of appending text to it
1 parent 67003f0 commit affd24f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/lib.rs

+29
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,35 @@
188188
//! (see [Usage] section), or call Xargo with `--target` flag:
189189
//! `xargo build --target thumbv7em-none-eabi`.
190190
//!
191+
//! ## Overwrote the original `.cargo/config` file
192+
//!
193+
//! Error message:
194+
//!
195+
//! ``` text
196+
//! error: linking with `arm-none-eabi-gcc` failed: exit code: 1
197+
//! |
198+
//! = note: (..)
199+
//! (..)
200+
//! (..)/crt0.o: In function `_start':
201+
//! (.text+0x90): undefined reference to `memset'
202+
//! (..)/crt0.o: In function `_start':
203+
//! (.text+0xd0): undefined reference to `atexit'
204+
//! (..)/crt0.o: In function `_start':
205+
//! (.text+0xd4): undefined reference to `__libc_init_array'
206+
//! (..)/crt0.o: In function `_start':
207+
//! (.text+0xe4): undefined reference to `exit'
208+
//! (..)/crt0.o: In function `_start':
209+
//! (.text+0x100): undefined reference to `__libc_fini_array'
210+
//! collect2: error: ld returned 1 exit status
211+
//! ```
212+
//!
213+
//! Solution: You probably overwrote the original `.cargo/config` instead of
214+
//! appending the default build target (e.g. `cat >` instead of `cat >>`). The
215+
//! less error prone way to fix this is to remove the `.cargo` directory, clone
216+
//! a new copy of the template and then copy the `.cargo` directory from that
217+
//! fresh template into your current project. Don't forget to *append* the
218+
//! default build target to `.cargo/config`.
219+
//!
191220
//! ## Called OpenOCD with wrong arguments
192221
//!
193222
//! Error message:

0 commit comments

Comments
 (0)