diff --git a/book/src/build/other.md b/book/src/build/other.md index af835e658..c0c6e911d 100644 --- a/book/src/build/other.md +++ b/book/src/build/other.md @@ -48,6 +48,12 @@ When linking a binary which contains mixed Rust and C++ code, you will have to choose between using the Rust toolchain (`rustc`) or the C++ toolchain which you may already have extensively tuned. +The generated C++ code and the Rust code generated by the procedural macro both +depend on each other. Simple examples may only require one or the other, but in +general your linking will need to handle both directions. For some linkers, such +as llvm-ld, this is not a problem at all. For others, such as GNU ld, flags like +`--start-lib`/`--end-lib` may help. + Rust does not generate simple standalone `.o` files, so you can't just throw the Rust-generated code into your existing C++ toolchain linker. Instead you need to choose one of these options: