Skip to content

Commit df84ac7

Browse files
authored
Rollup merge of rust-lang#76465 - jyn514:auto-versioning, r=elichai
Add a script to automatically update Rust/Clang versions in documentation From rust-lang#76402 (comment). r? @elichai
2 parents d0c2a2d + 0c9bf13 commit df84ac7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/doc/rustc/src/linker-plugin-lto.md

+22
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,28 @@ rustc -Clinker-plugin-lto="/path/to/LLVMgold.so" -L. -Copt-level=2 ./main.rs
8989

9090
## Toolchain Compatibility
9191

92+
<!-- NOTE: to update the below table, you can use this shell script:
93+
94+
```sh
95+
rustup toolchain install --profile minimal nightly
96+
MINOR_VERSION=$(rustc +nightly --version | cut -d . -f 2)
97+
LOWER_BOUND=44
98+
99+
llvm_version() {
100+
toolchain="$1"
101+
printf "Rust $toolchain | Clang "
102+
rustc +"$toolchain" -Vv | grep LLVM | cut -d ':' -f 2 | tr -d ' '
103+
}
104+
105+
for version in `seq $LOWER_BOUND $((MINOR_VERSION - 2))`; do
106+
toolchain=1.$version.0
107+
rustup toolchain install --no-self-update --profile minimal $toolchain >/dev/null 2>&1
108+
llvm_version $toolchain
109+
done
110+
```
111+
112+
-->
113+
92114
In order for this kind of LTO to work, the LLVM linker plugin must be able to
93115
handle the LLVM bitcode produced by both `rustc` and `clang`.
94116

0 commit comments

Comments
 (0)