Skip to content

Commit a687b97

Browse files
author
Jorge Aparicio
committed
README: when and how to use this crate
1 parent 0978555 commit a687b97

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,27 @@ See [rust-lang/rust#35437][0].
1212

1313
[0]: https://github.com/rust-lang/rust/issues/35437
1414

15+
## When and how to use this crate?
16+
17+
If you are working with a target that doesn't have binary releases of std available via rustup (this
18+
probably means you are building the core crate yourself) and need compiler-rt intrinsics (i.e. you
19+
are probably getting linker errors when building an executable: "undefined reference to
20+
__aeabi_memcpy"), you can use this crate to get those intrinsics and solve the linker errors. To do
21+
that, simply add this crate as a Cargo dependency (it doesn't matter where in the dependency graph
22+
this crate ends up, as long as it's there):
23+
24+
``` toml
25+
[dependencies]
26+
rustc-builtins = { git = "https://github.com/japaric/rustc-builtins" }
27+
```
28+
29+
If you still get an "undefined reference to $INTRINSIC" error after that change, that means that we
30+
haven't ported `$INTRINSIC` to Rust yet! Please open [an issue] with the name of the intrinsic and
31+
the LLVM triple (e.g. thumbv7m-none-eabi) of the target you are using. That way we can prioritize
32+
porting that particular intrinsic.
33+
34+
[an issue]: https://github.com/japaric/rustc-builtins/issues
35+
1536
## Contributing
1637

1738
1. Pick one or more intrinsics from the [pending list][#progress].

0 commit comments

Comments
 (0)