Skip to content

Commit 184fb08

Browse files
committed
rustbuild: RISC-V is no longer an experimental LLVM target
This commit moves RISC-V from the experimental LLVM targets to the regular LLVM targets. RISC-V was made non-experimental in https://reviews.llvm.org/rL366399 I have also sorted the list of LLVM targets, and changed the code around setting llvm_exp_targets (and its default) to match the code setting llvm_targets (and its default), ensuring future changes to the defaults, as LLVM targets become stable, affect as few places as possible.
1 parent fc3ef96 commit 184fb08

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

config.toml.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@
5757
# support. You'll need to write a target specification at least, and most
5858
# likely, teach rustc about the C ABI of the target. Get in touch with the
5959
# Rust team and file an issue if you need assistance in porting!
60-
#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;MSP430;Sparc;NVPTX;Hexagon"
60+
#targets = "AArch64;ARM;Hexagon;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;X86"
6161

6262
# LLVM experimental targets to build support for. These targets are specified in
6363
# the same format as above, but since these targets are experimental, they are
6464
# not built by default and the experimental Rust compilation targets that depend
6565
# on them will not work unless the user opts in to building them. By default the
66-
# `WebAssembly` and `RISCV` targets are enabled when compiling LLVM from scratch.
67-
#experimental-targets = "WebAssembly;RISCV"
66+
# `WebAssembly` target is enabled when compiling LLVM from scratch.
67+
#experimental-targets = "WebAssembly"
6868

6969
# Cap the number of parallel linker invocations when compiling LLVM.
7070
# This can be useful when building LLVM with debug info, which significantly

src/bootstrap/config.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub struct Config {
7575
pub llvm_link_shared: bool,
7676
pub llvm_clang_cl: Option<String>,
7777
pub llvm_targets: Option<String>,
78-
pub llvm_experimental_targets: String,
78+
pub llvm_experimental_targets: Option<String>,
7979
pub llvm_link_jobs: Option<u32>,
8080
pub llvm_version_suffix: Option<String>,
8181
pub llvm_use_linker: Option<String>,
@@ -524,8 +524,7 @@ impl Config {
524524
set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp);
525525
set(&mut config.llvm_link_shared, llvm.link_shared);
526526
config.llvm_targets = llvm.targets.clone();
527-
config.llvm_experimental_targets = llvm.experimental_targets.clone()
528-
.unwrap_or_else(|| "WebAssembly;RISCV".to_string());
527+
config.llvm_experimental_targets = llvm.experimental_targets.clone();
529528
config.llvm_link_jobs = llvm.link_jobs;
530529
config.llvm_version_suffix = llvm.version_suffix.clone();
531530
config.llvm_clang_cl = llvm.clang_cl.clone();

src/bootstrap/native.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,17 @@ impl Step for Llvm {
125125
} else {
126126
match builder.config.llvm_targets {
127127
Some(ref s) => s,
128-
None => "X86;ARM;AArch64;Mips;PowerPC;SystemZ;MSP430;Sparc;NVPTX;Hexagon",
128+
None => "AArch64;ARM;Hexagon;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;X86",
129129
}
130130
};
131131

132132
let llvm_exp_targets = if self.emscripten {
133133
""
134134
} else {
135-
&builder.config.llvm_experimental_targets[..]
135+
match builder.config.llvm_experimental_targets {
136+
Some(ref s) => s,
137+
None => "WebAssembly",
138+
}
136139
};
137140

138141
let assertions = if builder.config.llvm_assertions {"ON"} else {"OFF"};

0 commit comments

Comments
 (0)