@@ -68,7 +68,6 @@ pub struct Config {
68
68
pub rustc_error_format : Option < String > ,
69
69
pub json_output : bool ,
70
70
pub test_compare_mode : bool ,
71
- pub llvm_libunwind : LlvmLibunwind ,
72
71
pub color : Color ,
73
72
74
73
pub on_fail : Option < String > ,
@@ -146,6 +145,7 @@ pub struct Config {
146
145
pub rust_profile_generate : Option < String > ,
147
146
pub llvm_profile_use : Option < String > ,
148
147
pub llvm_profile_generate : bool ,
148
+ pub llvm_libunwind_default : Option < LlvmLibunwind > ,
149
149
150
150
pub build : TargetSelection ,
151
151
pub hosts : Vec < TargetSelection > ,
@@ -290,6 +290,7 @@ pub struct Target {
290
290
pub llvm_config : Option < PathBuf > ,
291
291
/// Some(path to FileCheck) if one was specified.
292
292
pub llvm_filecheck : Option < PathBuf > ,
293
+ pub llvm_libunwind : Option < LlvmLibunwind > ,
293
294
pub cc : Option < PathBuf > ,
294
295
pub cxx : Option < PathBuf > ,
295
296
pub ar : Option < PathBuf > ,
@@ -574,6 +575,7 @@ derive_merge! {
574
575
linker: Option <String >,
575
576
llvm_config: Option <String >,
576
577
llvm_filecheck: Option <String >,
578
+ llvm_libunwind: Option <String >,
577
579
android_ndk: Option <String >,
578
580
sanitizers: Option <bool >,
579
581
profiler: Option <bool >,
@@ -921,10 +923,6 @@ impl Config {
921
923
set ( & mut config. rust_rpath , rust. rpath ) ;
922
924
set ( & mut config. jemalloc , rust. jemalloc ) ;
923
925
set ( & mut config. test_compare_mode , rust. test_compare_mode ) ;
924
- config. llvm_libunwind = rust
925
- . llvm_libunwind
926
- . map ( |v| v. parse ( ) . expect ( "failed to parse rust.llvm-libunwind" ) )
927
- . unwrap_or_default ( ) ;
928
926
set ( & mut config. backtrace , rust. backtrace ) ;
929
927
set ( & mut config. channel , rust. channel ) ;
930
928
config. description = rust. description ;
@@ -947,6 +945,9 @@ impl Config {
947
945
config. rust_thin_lto_import_instr_limit = rust. thin_lto_import_instr_limit ;
948
946
set ( & mut config. rust_remap_debuginfo , rust. remap_debuginfo ) ;
949
947
set ( & mut config. control_flow_guard , rust. control_flow_guard ) ;
948
+ config. llvm_libunwind_default = rust
949
+ . llvm_libunwind
950
+ . map ( |v| v. parse ( ) . expect ( "failed to parse rust.llvm-libunwind" ) ) ;
950
951
951
952
if let Some ( ref backends) = rust. codegen_backends {
952
953
config. rust_codegen_backends =
@@ -973,6 +974,10 @@ impl Config {
973
974
if let Some ( ref s) = cfg. llvm_filecheck {
974
975
target. llvm_filecheck = Some ( config. src . join ( s) ) ;
975
976
}
977
+ target. llvm_libunwind = cfg
978
+ . llvm_libunwind
979
+ . as_ref ( )
980
+ . map ( |v| v. parse ( ) . expect ( "failed to parse rust.llvm-libunwind" ) ) ;
976
981
if let Some ( ref s) = cfg. android_ndk {
977
982
target. ndk = Some ( config. src . join ( s) ) ;
978
983
}
@@ -1170,6 +1175,14 @@ impl Config {
1170
1175
self . rust_codegen_backends . contains ( & INTERNER . intern_str ( "llvm" ) )
1171
1176
}
1172
1177
1178
+ pub fn llvm_libunwind ( & self , target : TargetSelection ) -> LlvmLibunwind {
1179
+ self . target_config
1180
+ . get ( & target)
1181
+ . and_then ( |t| t. llvm_libunwind )
1182
+ . or ( self . llvm_libunwind_default )
1183
+ . unwrap_or ( LlvmLibunwind :: No )
1184
+ }
1185
+
1173
1186
pub fn submodules ( & self , rust_info : & GitInfo ) -> bool {
1174
1187
self . submodules . unwrap_or ( rust_info. is_git ( ) )
1175
1188
}
0 commit comments