File tree 3 files changed +21
-2
lines changed 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ pub struct Config {
55
55
pub llvm_version_check: bool,
56
56
pub llvm_static_stdcpp: bool,
57
57
pub llvm_link_shared: bool,
58
+ pub llvm_targets: Option<String>,
58
59
59
60
// rust codegen options
60
61
pub rust_optimize: bool,
@@ -154,6 +155,7 @@ struct Llvm {
154
155
release_debuginfo: Option<bool>,
155
156
version_check: Option<bool>,
156
157
static_libstdcpp: Option<bool>,
158
+ targets: Option<String>,
157
159
}
158
160
159
161
#[derive(RustcDecodable)]
@@ -288,6 +290,7 @@ impl Config {
288
290
set(&mut config.llvm_release_debuginfo, llvm.release_debuginfo);
289
291
set(&mut config.llvm_version_check, llvm.version_check);
290
292
set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp);
293
+ config.llvm_targets = llvm.targets.clone();
291
294
}
292
295
293
296
if let Some(ref rust) = toml.rust {
Original file line number Diff line number Diff line change 42
42
# example.
43
43
#ninja = false
44
44
45
+ # LLVM targets to build support for.
46
+ # Note: this is NOT related to Rust compilation targets. However, as Rust is
47
+ # dependent on LLVM for code generation, turning targets off here WILL lead to
48
+ # the resulting rustc being unable to compile for the disabled architectures.
49
+ # Also worth pointing out is that, in case support for new targets are added to
50
+ # LLVM, enabling them here doesn't mean Rust is automatically gaining said
51
+ # support. You'll need to write a target specification at least, and most
52
+ # likely, teach rustc about the C ABI of the target. Get in touch with the
53
+ # Rust team and file an issue if you need assistance in porting!
54
+ #targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc"
55
+
45
56
# =============================================================================
46
57
# General build configuration options
47
58
# =============================================================================
Original file line number Diff line number Diff line change @@ -75,13 +75,18 @@ pub fn llvm(build: &Build, target: &str) {
75
75
(true, true) => "RelWithDebInfo",
76
76
};
77
77
78
+ // NOTE: remember to also update `config.toml.example` when changing the defaults!
79
+ let llvm_targets = match build.config.llvm_targets {
80
+ Some(ref s) => s,
81
+ None => "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX",
82
+ };
83
+
78
84
cfg.target(target)
79
85
.host(&build.config.build)
80
86
.out_dir(&dst)
81
87
.profile(profile)
82
88
.define("LLVM_ENABLE_ASSERTIONS", assertions)
83
- .define("LLVM_TARGETS_TO_BUILD",
84
- "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX")
89
+ .define("LLVM_TARGETS_TO_BUILD", llvm_targets)
85
90
.define("LLVM_INCLUDE_EXAMPLES", "OFF")
86
91
.define("LLVM_INCLUDE_TESTS", "OFF")
87
92
.define("LLVM_INCLUDE_DOCS", "OFF")
You can’t perform that action at this time.
0 commit comments