Skip to content

Commit 6a38ef7

Browse files
authored
Rollup merge of #63218 - lenary:riscv-non-experimental, r=alexcrichton
rustbuild: RISC-V is no longer an experimental LLVM target This 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. Given WebAssembly is in `LLVM_ALL_TARGETS` and is therefore built by default (and has been since October 2018), I'm not sure why rust still has it in `experimental-targets`. I'm happy to update this PR to move it into the main list of LLVM targets. r? @alexcrichton
2 parents 15b5aac + 2921de6 commit 6a38ef7

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

config.toml.example

+3-4
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,13 @@
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;WebAssembly;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
65-
# 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"
65+
# on them will not work unless the user opts in to building them.
66+
#experimental-targets = ""
6867

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

src/bootstrap/config.rs

+2-3
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

+6-2
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,18 @@ 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;\
129+
Sparc;SystemZ;WebAssembly;X86",
129130
}
130131
};
131132

132133
let llvm_exp_targets = if self.emscripten {
133134
""
134135
} else {
135-
&builder.config.llvm_experimental_targets[..]
136+
match builder.config.llvm_experimental_targets {
137+
Some(ref s) => s,
138+
None => "",
139+
}
136140
};
137141

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

0 commit comments

Comments
 (0)