about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2020-09-09 15:05:53 -0700
committerGitHub <noreply@github.com>2020-09-09 15:05:53 -0700
commitdf84ac74bd21f4757873963363755047ef9010f1 (patch)
tree98945b5ca6b0229ec3b7a6892d84b3c79861442d
parentd0c2a2d37c5c2a2fcec73e5997b390b383635fb3 (diff)
parent0c9bf13f5f11047bb03313624f0430d93d4e840d (diff)
downloadrust-df84ac74bd21f4757873963363755047ef9010f1.tar.gz
rust-df84ac74bd21f4757873963363755047ef9010f1.zip
Rollup merge of #76465 - jyn514:auto-versioning, r=elichai
Add a script to automatically update Rust/Clang versions in documentation

From https://github.com/rust-lang/rust/pull/76402#issuecomment-687974508.

r? @elichai
-rw-r--r--src/doc/rustc/src/linker-plugin-lto.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/doc/rustc/src/linker-plugin-lto.md b/src/doc/rustc/src/linker-plugin-lto.md
index f7843abf4d6..18f1be6a1fa 100644
--- a/src/doc/rustc/src/linker-plugin-lto.md
+++ b/src/doc/rustc/src/linker-plugin-lto.md
@@ -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`.