@@ -222,6 +222,8 @@ pub struct Config {
222
222
pub rust_debuginfo_level_tests : DebuginfoLevel ,
223
223
pub rust_split_debuginfo : SplitDebuginfo ,
224
224
pub rust_rpath : bool ,
225
+ pub rust_strip : bool ,
226
+ pub rust_stack_protector : StackProtector ,
225
227
pub rustc_parallel : bool ,
226
228
pub rustc_default_linker : Option < String > ,
227
229
pub rust_optimize_tests : bool ,
@@ -394,6 +396,29 @@ impl SplitDebuginfo {
394
396
}
395
397
}
396
398
399
+ /// Stack protector mode for compiling rustc itself
400
+ #[ derive( Default , Clone , PartialEq , Debug ) ]
401
+ pub enum StackProtector {
402
+ #[ default]
403
+ None ,
404
+ Basic ,
405
+ Strong ,
406
+ All ,
407
+ }
408
+
409
+ impl std:: str:: FromStr for StackProtector {
410
+ type Err = String ;
411
+ fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
412
+ match s {
413
+ "none" => Ok ( StackProtector :: None ) ,
414
+ "basic" => Ok ( StackProtector :: Basic ) ,
415
+ "strong" => Ok ( StackProtector :: Strong ) ,
416
+ "all" => Ok ( StackProtector :: All ) ,
417
+ _ => Err ( format ! ( "Invalid value for stack protector: {s}" ) ) ,
418
+ }
419
+ }
420
+ }
421
+
397
422
/// LTO mode used for compiling rustc itself.
398
423
#[ derive( Default , Clone , PartialEq , Debug ) ]
399
424
pub enum RustcLto {
@@ -1000,6 +1025,8 @@ define_config! {
1000
1025
description: Option <String > = "description" ,
1001
1026
musl_root: Option <String > = "musl-root" ,
1002
1027
rpath: Option <bool > = "rpath" ,
1028
+ strip: Option <bool > = "strip" ,
1029
+ stack_protector: Option <String > = "stack-protector" ,
1003
1030
verbose_tests: Option <bool > = "verbose-tests" ,
1004
1031
optimize_tests: Option <bool > = "optimize-tests" ,
1005
1032
codegen_tests: Option <bool > = "codegen-tests" ,
@@ -1067,6 +1094,7 @@ impl Config {
1067
1094
config. docs = true ;
1068
1095
config. docs_minification = true ;
1069
1096
config. rust_rpath = true ;
1097
+ config. rust_strip = false ;
1070
1098
config. channel = "dev" . to_string ( ) ;
1071
1099
config. codegen_tests = true ;
1072
1100
config. rust_dist_src = true ;
@@ -1420,6 +1448,12 @@ impl Config {
1420
1448
set ( & mut config. rust_optimize_tests , rust. optimize_tests ) ;
1421
1449
set ( & mut config. codegen_tests , rust. codegen_tests ) ;
1422
1450
set ( & mut config. rust_rpath , rust. rpath ) ;
1451
+ set ( & mut config. rust_strip , rust. strip ) ;
1452
+ config. rust_stack_protector = rust
1453
+ . stack_protector
1454
+ . as_deref ( )
1455
+ . map ( |value| StackProtector :: from_str ( value) . unwrap ( ) )
1456
+ . unwrap_or_default ( ) ;
1423
1457
set ( & mut config. jemalloc , rust. jemalloc ) ;
1424
1458
set ( & mut config. test_compare_mode , rust. test_compare_mode ) ;
1425
1459
set ( & mut config. backtrace , rust. backtrace ) ;
0 commit comments