]> git.lizzy.rs Git - rust.git/blobdiff - src/doc/rustc/src/linker-plugin-lto.md
Rollup merge of #75454 - ltratt:option_optimisation_guarantees, r=dtolnay
[rust.git] / src / doc / rustc / src / linker-plugin-lto.md
index f7843abf4d6f2b1d7eeadb8b1159f79c83b52aed..18f1be6a1faa7939d1dfaba3728ecf71caf5c89c 100644 (file)
@@ -89,6 +89,28 @@ rustc -Clinker-plugin-lto="/path/to/LLVMgold.so" -L. -Copt-level=2 ./main.rs
 
 ## Toolchain Compatibility
 
+<!-- NOTE: to update the below table, you can use this shell script:
+
+```sh
+rustup toolchain install --profile minimal nightly
+MINOR_VERSION=$(rustc +nightly --version | cut -d . -f 2)
+LOWER_BOUND=44
+
+llvm_version() {
+    toolchain="$1"
+    printf "Rust $toolchain    |    Clang "
+    rustc +"$toolchain" -Vv | grep LLVM | cut -d ':' -f 2 | tr -d ' '
+}
+
+for version in `seq $LOWER_BOUND $((MINOR_VERSION - 2))`; do
+    toolchain=1.$version.0
+    rustup toolchain install --no-self-update --profile  minimal $toolchain >/dev/null 2>&1
+    llvm_version $toolchain
+done
+```
+
+-->
+
 In order for this kind of LTO to work, the LLVM linker plugin must be able to
 handle the LLVM bitcode produced by both `rustc` and `clang`.