Commit 0753501
refactor(rustc_codegen_nvvm): parameterize build.rs over LlvmFlavor
Collapse the per-LLVM duplication in the build script into a single
`LlvmFlavor` struct with two const instances (LLVM7, LLVM19). One
`find_llvm_config`, `find_llvm_as`, `configure_libintrinsics`, and
`rustc_llvm_build` now drive both toolchain paths;
`required_major_llvm_version`, `find_llvm_config_llvm7`,
`find_llvm_config_llvm19`, and `find_llvm_as_llvm19` are gone.
Functional changes that fall out of the refactor:
- Prebuilt LLVM download now works for the `llvm19` feature too, gated on
`USE_PREBUILT_LLVM=1` or as an automatic fallback when no LLVM 19
toolchain is found locally. New `PREBUILT_LLVM_URL_LLVM19` points at
the `llvm-19.1.7` release tag.
- Prebuilt download now supports `linux-x86_64` and `linux-aarch64` in
addition to `windows-x86_64`. The "currently disabled because of
segfaults" note on Linux x86_64 is gone — the prebuild repos that
produce these archives have been refactored to fix the underlying
issue.
- `PREBUILT_LLVM_URL_LLVM7` retagged to lowercase `llvm-7.1.0/` to match
the new release-tag scheme used by the prebuild repos.
- `libintrinsics.bc` is no longer checked in; both LLVM versions now
assemble `libintrinsics.ll` on the fly using the `llvm-as` that ships
next to the resolved `llvm-config`. Removes the only remaining
version-specific branch and means the LLVM 7 path can no longer drift
silently when the `.ll` changes.
The LLVM 7 candidate-search behavior is also slightly stricter:
previously `LLVM_CONFIG` only had to literally start with "7" (matching
7, 70, 700...) and a mismatched env var skipped straight to download;
now major-version match is exact and PATH `llvm-config` is tried as a
fallback before downloading. `USE_PREBUILT_LLVM=1` still forces direct
download.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 929562e commit 0753501
3 files changed
Lines changed: 148 additions & 141 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
170 | | - | |
171 | | - | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
0 commit comments