@@ -280,6 +280,7 @@ pub struct Config {
280280 pub rust_codegen_backends : Vec < String > ,
281281 pub rust_verify_llvm_ir : bool ,
282282 pub rust_thin_lto_import_instr_limit : Option < u32 > ,
283+ pub rust_randomize_layout : bool ,
283284 pub rust_remap_debuginfo : bool ,
284285 pub rust_new_symbol_mangling : Option < bool > ,
285286 pub rust_profile_use : Option < String > ,
@@ -1088,6 +1089,7 @@ define_config! {
10881089 codegen_units: Option <u32 > = "codegen-units" ,
10891090 codegen_units_std: Option <u32 > = "codegen-units-std" ,
10901091 debug_assertions: Option <bool > = "debug-assertions" ,
1092+ randomize_layout: Option <bool > = "randomize-layout" ,
10911093 debug_assertions_std: Option <bool > = "debug-assertions-std" ,
10921094 overflow_checks: Option <bool > = "overflow-checks" ,
10931095 overflow_checks_std: Option <bool > = "overflow-checks-std" ,
@@ -1179,6 +1181,7 @@ impl Config {
11791181 backtrace : true ,
11801182 rust_optimize : RustOptimize :: Bool ( true ) ,
11811183 rust_optimize_tests : true ,
1184+ rust_randomize_layout : false ,
11821185 submodules : None ,
11831186 docs : true ,
11841187 docs_minification : true ,
@@ -1629,6 +1632,7 @@ impl Config {
16291632 backtrace,
16301633 incremental,
16311634 parallel_compiler,
1635+ randomize_layout,
16321636 default_linker,
16331637 channel,
16341638 description,
@@ -1718,6 +1722,7 @@ impl Config {
17181722 set ( & mut config. lld_mode , lld_mode) ;
17191723 set ( & mut config. llvm_bitcode_linker_enabled , llvm_bitcode_linker) ;
17201724
1725+ config. rust_randomize_layout = randomize_layout. unwrap_or_default ( ) ;
17211726 config. llvm_tools_enabled = llvm_tools. unwrap_or ( true ) ;
17221727 config. rustc_parallel =
17231728 parallel_compiler. unwrap_or ( config. channel == "dev" || config. channel == "nightly" ) ;
@@ -2889,6 +2894,7 @@ fn check_incompatible_options_for_ci_rustc(
28892894 let Rust {
28902895 // Following options are the CI rustc incompatible ones.
28912896 optimize,
2897+ randomize_layout,
28922898 debug_logging,
28932899 debuginfo_level_rustc,
28942900 llvm_tools,
@@ -2953,6 +2959,7 @@ fn check_incompatible_options_for_ci_rustc(
29532959 // otherwise, we just print a warning with `warn` macro.
29542960
29552961 err ! ( current_rust_config. optimize, optimize) ;
2962+ err ! ( current_rust_config. randomize_layout, randomize_layout) ;
29562963 err ! ( current_rust_config. debug_logging, debug_logging) ;
29572964 err ! ( current_rust_config. debuginfo_level_rustc, debuginfo_level_rustc) ;
29582965 err ! ( current_rust_config. rpath, rpath) ;
0 commit comments