I'm writing for education purposes an embedded Rust program for ARM.
Since it is a bare metal system, I use the core library only. The library's manual page claims that corelib depends on nothing, but memcpy
, memcmp
, and memset
, and the unwind functions (see https://doc.rust-lang.org/core/index.html).
However, especially if I use atomic types, I continue to get linker errors because of missing symbols, such as __sync_val_compare_and_swap_4
or __sync_lock_test_and_set_4
that indicates a missing compiler-rt library. I understand, that compiler-rt should on top of corelib. That looks like a circular dependency, what shouldn't be. In addition, I understand that compiler-rt in turn depends on an OS.
- What part of my understanding is not correct?
- How can I get a real independent corelib, or what parts of it are really independent? I know that I could re-implement the missing functions, but they seem to be quite a lot. Also, I'm aware of the compiler-builtins crate, but it still leaves me with unresolved symbols.