File tree 3 files changed +17
-0
lines changed
3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ pub struct Config {
59
59
pub llvm_static_stdcpp : bool ,
60
60
pub llvm_link_shared : bool ,
61
61
pub llvm_targets : Option < String > ,
62
+ pub llvm_link_jobs : Option < u32 > ,
62
63
63
64
// rust codegen options
64
65
pub rust_optimize : bool ,
@@ -179,6 +180,7 @@ struct Llvm {
179
180
version_check : Option < bool > ,
180
181
static_libstdcpp : Option < bool > ,
181
182
targets : Option < String > ,
183
+ link_jobs : Option < u32 > ,
182
184
}
183
185
184
186
#[ derive( RustcDecodable , Default , Clone ) ]
@@ -333,6 +335,7 @@ impl Config {
333
335
set ( & mut config. llvm_version_check , llvm. version_check ) ;
334
336
set ( & mut config. llvm_static_stdcpp , llvm. static_libstdcpp ) ;
335
337
config. llvm_targets = llvm. targets . clone ( ) ;
338
+ config. llvm_link_jobs = llvm. link_jobs ;
336
339
}
337
340
338
341
if let Some ( ref rust) = toml. rust {
Original file line number Diff line number Diff line change 53
53
# Rust team and file an issue if you need assistance in porting!
54
54
#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX"
55
55
56
+ # Cap the number of parallel linker invocations when compiling LLVM.
57
+ # This can be useful when building LLVM with debug info, which significantly
58
+ # increases the size of binaries and consequently the memory required by
59
+ # each linker process.
60
+ # If absent or 0, linker invocations are treated like any other job and
61
+ # controlled by rustbuild's -j parameter.
62
+ #link-jobs = 0
63
+
56
64
# =============================================================================
57
65
# General build configuration options
58
66
# =============================================================================
Original file line number Diff line number Diff line change @@ -109,6 +109,12 @@ pub fn llvm(build: &Build, target: &str) {
109
109
cfg. define ( "LLVM_BUILD_32_BITS" , "ON" ) ;
110
110
}
111
111
112
+ if let Some ( num_linkers) = build. config . llvm_link_jobs {
113
+ if num_linkers > 0 {
114
+ cfg. define ( "LLVM_PARALLEL_LINK_JOBS" , num_linkers. to_string ( ) ) ;
115
+ }
116
+ }
117
+
112
118
// http://llvm.org/docs/HowToCrossCompileLLVM.html
113
119
if target != build. config . build {
114
120
// FIXME: if the llvm root for the build triple is overridden then we
You can’t perform that action at this time.
0 commit comments